Skip to content

Commit

Permalink
Revive siitemap again
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Sep 4, 2024
1 parent df9f013 commit f58deb0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
11 changes: 0 additions & 11 deletions website/build/deploy.js
Original file line number Diff line number Diff line change
@@ -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",
{
Expand Down
17 changes: 17 additions & 0 deletions website/build/sitemap.js
Original file line number Diff line number Diff line change
@@ -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}`,
);
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Typia Guide Documents",
"private": true,
"scripts": {
"build": "rimraf .next && rimraf out && typedoc && next build && next-sitemap",
"build": "rimraf .next && rimraf out && typedoc && next build && node build/sitemap",
"deploy": "node build/deploy",
"dev": "next dev",
"prepare": "typedoc"
Expand Down

0 comments on commit f58deb0

Please sign in to comment.