Skip to content

Commit ef3ece6

Browse files
committed
chore: sitemap configuration
1 parent b9f39ad commit ef3ece6

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
lines changed

app/robots.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { MetadataRoute } from 'next';
2+
3+
export default function robots(): MetadataRoute.Robots {
4+
return {
5+
rules: {
6+
userAgent: '*',
7+
allow: '/',
8+
},
9+
sitemap: 'https://yuhwan-park.github.io/sitemap.xml',
10+
host: 'https://yuhwan-park.github.io/',
11+
};
12+
}

app/sitemap.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { MetadataRoute } from 'next';
2+
3+
import { reducedAllBlogPosts } from '@/libs/post';
4+
5+
export default function sitemap(): MetadataRoute.Sitemap {
6+
return [
7+
{
8+
url: 'https://yuhwan-park.github.io/',
9+
lastModified: new Date(),
10+
changeFrequency: 'daily',
11+
priority: 1,
12+
},
13+
...reducedAllBlogPosts.map(
14+
({ slug }) =>
15+
({
16+
url: `https://yuhwan-park.github.io${slug}`,
17+
lastModified: new Date(),
18+
changeFrequency: 'daily',
19+
priority: 0.8,
20+
}) as const,
21+
),
22+
];
23+
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "next build && next dev --turbo",
7-
"build": "next-sitemap && next build",
7+
"build": "next build",
88
"start": "next start",
99
"lint": "next lint"
1010
},
@@ -13,7 +13,6 @@
1313
"clsx": "^2.1.1",
1414
"lodash.throttle": "^4.1.1",
1515
"next": "14.2.15",
16-
"next-sitemap": "^4.2.3",
1716
"react": "^18",
1817
"react-dom": "^18",
1918
"tailwind-merge": "^2.5.4"

yarn.lock

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,6 @@
124124
ts-pattern "^4.3.0"
125125
type-fest "^3.12.0"
126126

127-
"@corex/deepmerge@^4.0.43":
128-
version "4.0.43"
129-
resolved "https://registry.yarnpkg.com/@corex/deepmerge/-/deepmerge-4.0.43.tgz#9bd42559ebb41cc5a7fb7cfeea5f231c20977dca"
130-
integrity sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==
131-
132127
"@cspotcode/source-map-support@^0.8.0":
133128
version "0.8.1"
134129
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
@@ -463,11 +458,6 @@
463458
resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.15.tgz#06d984e37e670d93ddd6790af1844aeb935f332f"
464459
integrity sha512-S1qaj25Wru2dUpcIZMjxeMVSwkt8BK4dmWHHiBuRstcIyOsMapqT4A4jSB6onvqeygkSSmOkyny9VVx8JIGamQ==
465460

466-
"@next/env@^13.4.3":
467-
version "13.5.7"
468-
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.5.7.tgz#5006f4460a7fa598a03e1c2aa4e59e45c71082d3"
469-
integrity sha512-uVuRqoj28Ys/AI/5gVEgRAISd0KWI0HRjOO1CTpNgmX3ZsHb5mdn14Y59yk0IxizXdo7ZjsI2S7qbWnO+GNBcA==
470-
471461
472462
version "14.2.15"
473463
resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.15.tgz#796ae942a95b859e1add58e5b7ae78cfd55d59bb"
@@ -4589,7 +4579,7 @@ minimatch@^9.0.0, minimatch@^9.0.1, minimatch@^9.0.4:
45894579
dependencies:
45904580
brace-expansion "^2.0.1"
45914581

4592-
minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8:
4582+
minimist@^1.2.0, minimist@^1.2.6:
45934583
version "1.2.8"
45944584
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
45954585
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
@@ -4636,16 +4626,6 @@ next-contentlayer@^0.3.4:
46364626
"@contentlayer/core" "0.3.4"
46374627
"@contentlayer/utils" "0.3.4"
46384628

4639-
next-sitemap@^4.2.3:
4640-
version "4.2.3"
4641-
resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-4.2.3.tgz#5db3f650351a51e84b9fd6b58c5af2f9257b5058"
4642-
integrity sha512-vjdCxeDuWDzldhCnyFCQipw5bfpl4HmZA7uoo3GAaYGjGgfL4Cxb1CiztPuWGmS+auYs7/8OekRS8C2cjdAsjQ==
4643-
dependencies:
4644-
"@corex/deepmerge" "^4.0.43"
4645-
"@next/env" "^13.4.3"
4646-
fast-glob "^3.2.12"
4647-
minimist "^1.2.8"
4648-
46494629
46504630
version "14.2.15"
46514631
resolved "https://registry.yarnpkg.com/next/-/next-14.2.15.tgz#348e5603e22649775d19c785c09a89c9acb5189a"

0 commit comments

Comments
 (0)