Skip to content

Commit

Permalink
feat: add next-sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
tapeds committed Apr 27, 2024
1 parent 84b18c0 commit 375deb1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
NEXT_PUBLIC_RUN_MODE = 'development' # development, production
NEXT_PUBLIC_API_URL_DEV = 'http://localhost:3000/api' # API URL DEV
NEXT_PUBLIC_API_URL_PROD = 'https://api.example.com' # API URL PROD

SITE_URL = 'http://localhost:3000/'
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts=true
6 changes: 6 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL || 'https://example.com',
generateRobotsTxt: true, // (optional)
// ...other options
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"postbuild": "next-sitemap",
"start": "next start",
"lint": "next lint",
"lint:strict": "next lint --max-warnings 0",
Expand All @@ -21,6 +22,7 @@
"clsx": "^2.1.0",
"cssnano": "^6.0.3",
"next": "14.2.1",
"next-sitemap": "^4.2.3",
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.51.3",
Expand Down
44 changes: 25 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 375deb1

Please sign in to comment.