Skip to content

Commit 205a4cb

Browse files
committed
feat: enhance SEO metadata, configure GitHub Pages deployment, and add sitemap generation script
1 parent f0a02b1 commit 205a4cb

33 files changed

Lines changed: 1489 additions & 209 deletions

‎.github/workflows/deploy.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: sb_publishable_OF9FwM-9TGsktwDYvCZxQg_PcM0Rvjm
3939
NEXT_PUBLIC_TELEGRAM_CLIENT_ID: "8954964070"
4040

41+
- name: Ensure .nojekyll exists
42+
run: touch ./out/.nojekyll
43+
4144
- name: Push to gh-pages branch
4245
uses: peaceiris/actions-gh-pages@v4
4346
with:

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ package-lock.json
1313

1414
# next.js
1515
/.next/
16+
/.next-prod/
1617
/out/
1718

1819
# production

‎SEO-AUDIT-REPORT.md‎

Lines changed: 150 additions & 0 deletions
Large diffs are not rendered by default.

‎next.config.js‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ if (isGithubActions) {
1616
basePath = branch === 'main' ? '' : `/${branch}`;
1717
}
1818

19+
const isProduction =
20+
process.env.NODE_ENV === 'production' ||
21+
process.argv.includes('build') ||
22+
process.argv.some((arg) => arg.endsWith('/next') || arg.endsWith('/next.js'));
23+
1924
const nextConfig = {
2025
reactStrictMode: true,
26+
distDir: isProduction ? 'out' : '.next',
2127
// Static export only for production builds (GH Pages).
22-
// next.devs stays dynamic so new /members/[slug] works without rebuild.
23-
...(process.env.NODE_ENV === 'production' ? { output: 'export' } : {}),
28+
// next dev stays dynamic so new /members/[slug] works without rebuild.
29+
...(isProduction ? { output: 'export' } : {}),
2430
images: {
2531
unoptimized: true,
2632
},

‎package.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
"author": "FrontChapter Community <info@frontchapter.ir>",
1212
"scripts": {
1313
"dev": "next dev",
14-
"build": "next build",
15-
"export": "next build",
14+
"sitemap": "node scripts/generate-sitemap.mjs",
15+
"build": "pnpm run sitemap && NODE_ENV=production next build",
16+
"export": "NODE_ENV=production next build",
1617
"postexport": "echo 'frontchapter.ir' > out/CNAME",
17-
"build:pages": "next build && echo 'frontchapter.ir' > out/CNAME && touch out/.nojekyll",
18+
"build:pages": "pnpm run sitemap && NODE_ENV=production next build && echo 'frontchapter.ir' > out/CNAME && touch out/.nojekyll",
1819
"deploy": "pnpm run build:pages && gh-pages -d out --dotfiles",
1920
"deploy:backend": "node scripts/deploy-backend.mjs",
2021
"lint": "next lint",

‎public/.nojekyll‎

Whitespace-only changes.

‎public/CNAME‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frontchapter.ir

‎public/robots.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
User-agent: *
22
Allow: /
33

4-
Disallow: /api/*
4+
Disallow: /api/
5+
Disallow: /elements/
56

67
Sitemap: https://frontchapter.ir/sitemap.xml

0 commit comments

Comments
 (0)