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