diff --git a/website/build/deploy.js b/website/build/deploy.js index 8936b3e357..f7c0357083 100644 --- a/website/build/deploy.js +++ b/website/build/deploy.js @@ -1,19 +1,8 @@ const cp = require("child_process"); -const fs = require("fs"); const deploy = require("gh-pages"); cp.execSync("npm run build", { stdio: "inherit" }); -for (const file of fs.readdirSync(`${__dirname}/../public`)) - if ( - file === "robots.txt" || - (file.startsWith("sitemap") && file.endsWith(".xml")) - ) - fs.copyFileSync( - `${__dirname}/../public/${file}`, - `${__dirname}/../out/${file}`, - ); - deploy.publish( "out", { diff --git a/website/build/sitemap.js b/website/build/sitemap.js new file mode 100644 index 0000000000..d4d40d30f1 --- /dev/null +++ b/website/build/sitemap.js @@ -0,0 +1,17 @@ +const cp = require("child_process"); +const fs = require("fs"); + +cp.execSync("next-sitemap", { + stdio: "inherit", + cwd: `${__dirname}/..`, +}); + +for (const file of fs.readdirSync(`${__dirname}/../public`)) + if ( + file === "robots.txt" || + (file.startsWith("sitemap") && file.endsWith(".xml")) + ) + fs.copyFileSync( + `${__dirname}/../public/${file}`, + `${__dirname}/../out/${file}`, + ); diff --git a/website/package.json b/website/package.json index 7fee53c2a4..3e1ee2cb2e 100644 --- a/website/package.json +++ b/website/package.json @@ -4,10 +4,10 @@ "description": "Typia Guide Documents", "private": true, "scripts": { - "build": "rimraf .next && rimraf out && npm run build:typedoc && next build && next-sitemap", + "build": "rimraf .next && rimraf out && npm run build:typedoc && next build && node build/sitemap", "build:typedoc": "typedoc --plugin typedoc-github-theme --theme typedoc-github-theme", "deploy": "node build/deploy", - "dev": "next dev", + "dev": "next-sitemap && next dev", "prepare": "node build/raw && rspack && npm run build:typedoc" }, "repository": {