-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/next-sitemap #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
364aa5c
CDP-141 choreโ๏ธ(next-sitemap): ํจํค์ง ์ค์น
leeunduck ab6684b
CDP-140 fix๐ (commit-msg): ์ปค๋ฐ ๋ฉ์ธ์ง ๊ท์น ์์
leeunduck 470c53d
CDP-142 choreโ๏ธ (next-sitemap): next-sitemap.config.js ์์ฑ ๋ฐ ์ค์
leeunduck 9a84ed7
CDP-143 choreโ๏ธ (next-sitemap): i18n & ๋ฉํฐ ๋๋ฉ์ธ (hreflang, alternateRefโฆ
leeunduck 8b59fee
CDP-148 choreโ๏ธ (next-sitemap): ์๋ฒ ์์ฑ ์ฌ์ดํธ๋งต ๋ณํฉ (๋์ค์ 2๋ฒ 3๋ฒ ๋จ๊ณ ์งํํด์ผํจ)
leeunduck 29f7afd
CDP-150 choreโ๏ธ (next-sitemap): ์บ๋
ธ๋์ปฌ/์ค๋ณต ๋ฐฉ์ง ์ฐ๊ฒฐ
leeunduck 33971d8
CDP-140 choreโ๏ธ (next-sitemap): ๋น๋ ํ์ผ ์ต์ ํ
leeunduck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| const RAW_SITE_URL = process.env.SITE_URL ?? "https://myplanmate.vercel.app"; | ||
| const siteUrl = RAW_SITE_URL.replace(/\/+$/, ""); // ๋ ์ฌ๋์ ์ ๊ฑฐ | ||
|
|
||
| // "/" ์ด์ธ ๊ฒฝ๋ก์ ๋ ์ฌ๋์ ์ ๊ฑฐ | ||
| const strip = (p) => (p !== "/" && p.endsWith("/") ? p.slice(0, -1) : p); | ||
|
|
||
| const config = { | ||
| siteUrl, | ||
| generateRobotsTxt: true, | ||
| outDir: "public", | ||
| sitemapSize: 5000, | ||
|
|
||
| // ๊ธฐ์กด exclude ๊ทธ๋๋ก ์ ์ง | ||
| exclude: ["/api/*", "/admin/*", "/debug", "/lab/*"], | ||
|
|
||
| // <loc>์ด canonical๊ณผ 1:1๋ก ๋์ผํ๋๋ก ์ ๊ทํ | ||
| transform: async (cfg, path) => { | ||
| const loc = strip(path); | ||
|
|
||
| // ์ฐ์ ์์ ๊ท์น(๋ค ๋ก์ง ๋ณด์กด) | ||
| const priority = loc === "/" ? 1.0 : loc.startsWith("/blog") ? 0.8 : (cfg.priority ?? 0.7); | ||
|
|
||
| return { | ||
| loc, // โ canonical๊ณผ ๋์ผํ ๋ฌธ์์ด | ||
| changefreq: "daily", | ||
| priority, | ||
| lastmod: new Date().toISOString(), | ||
|
|
||
| // ์ธ์ด๋ณ ํ์ด์ง๊ฐ ์๋ค๋ฉด ๊ฒฝ๋ก ๋จ์๋ก alternateRefs ๋งคํ | ||
| // ์) /todos โ /ko/todos, /en/todos | ||
| alternateRefs: [ | ||
| { href: `${siteUrl}/ko${loc === "/" ? "" : loc}`, hreflang: "ko" }, | ||
| { href: `${siteUrl}/en${loc === "/" ? "" : loc}`, hreflang: "en" }, | ||
| ], | ||
| }; | ||
| }, | ||
|
|
||
| // robots.txt (๋ค ๋ก์ง ๋ณด์กด) | ||
| robotsTxtOptions: { | ||
| policies: [ | ||
| { userAgent: "*", allow: "/" }, | ||
| { userAgent: "*", disallow: ["/api/", "/admin/", "/debug", "/lab/"] }, | ||
| ], | ||
| additionalSitemaps: [`${siteUrl}/server-sitemap.xml`], // ๋์ sitemap | ||
| }, | ||
| }; | ||
|
|
||
| export default config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # * | ||
| User-agent: * | ||
| Allow: / | ||
|
|
||
| # * | ||
| User-agent: * | ||
| Disallow: /api/ | ||
| Disallow: /admin/ | ||
| Disallow: /debug | ||
| Disallow: /lab/ | ||
|
|
||
| # Host | ||
| Host: https://myplanmate.vercel.app | ||
|
|
||
| # Sitemaps | ||
| Sitemap: https://myplanmate.vercel.app/sitemap.xml | ||
| Sitemap: https://myplanmate.vercel.app/server-sitemap.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> | ||
| <url><loc>https://myplanmate.vercel.app</loc><lastmod>2025-10-21T17:20:15.421Z</lastmod><changefreq>daily</changefreq><priority>1</priority><xhtml:link rel="alternate" hreflang="ko" href="https://myplanmate.vercel.app/ko"/><xhtml:link rel="alternate" hreflang="en" href="https://myplanmate.vercel.app/en"/></url> | ||
| </urlset> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
| <sitemap><loc>https://myplanmate.vercel.app/sitemap-0.xml</loc></sitemap> | ||
| <sitemap><loc>https://myplanmate.vercel.app/server-sitemap.xml</loc></sitemap> | ||
| </sitemapindex> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
alternatesblock in the root layout setscanonical: "/"and fixed language URLs for/koand/en. Because root layout metadata is inherited by every route unless explicitly overridden, all nonโhome pages will now emit<link rel="canonical" href="https://myplanmate.vercel.app/">and hreflang links to/koand/en, regardless of the current path. This causes search engines to treat every page as a duplicate of the home page and drop the correct localized versions from the index unless each page defines its own metadata. Consider removing the global canonical/hreflang or generating them per route instead.Useful? React with ๐ย / ๐.