Update .gitignore and development.astro for improved configuration and API integration
- Specify .env file handling in .gitignore to prevent accidental exposure of sensitive data. - Change Git API URL to Gitea for fetching commits, ensuring compatibility with the new repository structure.
This commit is contained in:
@@ -7,17 +7,12 @@ const lang = Astro.params.lang || 'en';
|
||||
const t = getTranslation(lang);
|
||||
|
||||
// Fetch Git repository data at build time
|
||||
const GIT_API_URL = 'https://git.365devnet.eu/api/v4/projects/Richard%2F365devnet';
|
||||
const GIT_COMMITS_URL = `${GIT_API_URL}/repository/commits`;
|
||||
const GITEA_COMMITS_URL = 'https://git.365devnet.eu/api/v1/repos/365DevNet/365devnet/commits';
|
||||
|
||||
// Fetch commits data
|
||||
let commits: any[] = [];
|
||||
try {
|
||||
const commitsResponse = await fetch(GIT_COMMITS_URL, {
|
||||
headers: {
|
||||
'PRIVATE-TOKEN': import.meta.env.GITLAB_TOKEN || '',
|
||||
},
|
||||
});
|
||||
const commitsResponse = await fetch(GITEA_COMMITS_URL);
|
||||
|
||||
if (commitsResponse.ok) {
|
||||
commits = await commitsResponse.json();
|
||||
|
Reference in New Issue
Block a user