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:
2025-06-06 21:40:28 +02:00
parent 61478dcc38
commit 2da6ae3078
2 changed files with 5 additions and 9 deletions

5
.gitignore vendored
View File

@@ -6,7 +6,8 @@ yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
# Local env and secrets # Local env and secrets
.env* .env
.env.*
!.env.example !.env.example
# OS/IDE/editor files # OS/IDE/editor files
@@ -49,7 +50,7 @@ inter.zip
.vercel/ .vercel/
.netlify/ .netlify/
# Optional: ignore public/index.html if its generated dynamically # Optional: ignore public/index.html if it's generated dynamically
# public/index.html # public/index.html
# Astro preview build cache (if used) # Astro preview build cache (if used)

View File

@@ -7,17 +7,12 @@ const lang = Astro.params.lang || 'en';
const t = getTranslation(lang); const t = getTranslation(lang);
// Fetch Git repository data at build time // Fetch Git repository data at build time
const GIT_API_URL = 'https://git.365devnet.eu/api/v4/projects/Richard%2F365devnet'; const GITEA_COMMITS_URL = 'https://git.365devnet.eu/api/v1/repos/365DevNet/365devnet/commits';
const GIT_COMMITS_URL = `${GIT_API_URL}/repository/commits`;
// Fetch commits data // Fetch commits data
let commits: any[] = []; let commits: any[] = [];
try { try {
const commitsResponse = await fetch(GIT_COMMITS_URL, { const commitsResponse = await fetch(GITEA_COMMITS_URL);
headers: {
'PRIVATE-TOKEN': import.meta.env.GITLAB_TOKEN || '',
},
});
if (commitsResponse.ok) { if (commitsResponse.ok) {
commits = await commitsResponse.json(); commits = await commitsResponse.json();