Skip to content

Commit

Permalink
fixes issue with sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
judemanutd committed Sep 14, 2023
1 parent 84f315e commit cf6f707
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 80 deletions.
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
28 changes: 28 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @type {import('next-sitemap').IConfig} */

const ENVIRONMENT = process.env.NEXT_PUBLIC_ENVIRONMENT;
const isLive = ENVIRONMENT === "production";

module.exports = {
siteUrl: `https://${process.env.NEXT_PUBLIC_HOST}`,
changefreq: "weekly",
generateRobotsTxt: true,
generateIndexSitemap: false,
robotsTxtOptions: isLive
? {
policies: [
{
userAgent: "*",
allow: "/",
},
],
}
: {
policies: [
{
userAgent: "*",
disallow: "/",
},
],
},
};
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dev": "doppler run -- concurrently \"npm:next:dev\" \"npm:slicemachine\" --names \"next,slicemachine\" --prefix-colors blue,magenta",
"next:dev": "next dev",
"build": "next build",
"postbuild": "npx next-sitemap",
"start": "next start",
"lint": "next lint -c .eslintrc.production.json",
"prettier:format": "npx prettier --write \"**/*.{tsx,ts,jsx,js,css,json,css,scss,md}\"",
Expand All @@ -38,20 +39,20 @@
"voca": "^1.4.1"
},
"devDependencies": {
"@slicemachine/adapter-next": "^0.3.14",
"@slicemachine/adapter-next": "^0.3.15",
"@types/node": "20.6.0",
"@types/react": "^18.2.21",
"@types/react-dom": "18.2.7",
"@types/voca": "^1.4.2",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"autoprefixer": "^10.4.15",
"concurrently": "^8.2.1",
"eslint": "8.49.0",
"eslint-config-next": "^13.4.19",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsdoc": "^46.5.1",
"eslint-plugin-jsdoc": "^46.8.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-unicorn": "^48.0.1",
Expand All @@ -62,7 +63,7 @@
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.4",
"pretty-quick": "^3.1.3",
"slice-machine-ui": "^1.12.0",
"slice-machine-ui": "^1.13.0",
"tailwindcss": "^3.3.3",
"typescript": "5.2.2"
}
Expand Down
Loading

0 comments on commit cf6f707

Please sign in to comment.