Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 65 additions & 26 deletions apps/web/public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">

<!-- NOTE: This static file is superseded by the dynamic sitemap generated by the -->
<!-- Cloudflare Worker at /sitemap.xml, which includes all course detail pages. -->

<!-- ==================== COURSES (highest value) ==================== -->
<url>
<loc>https://nthumods.com/zh/courses</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>daily</changefreq>
<priority>1.00</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/courses"/>
Expand All @@ -18,7 +21,7 @@
</url>
<url>
<loc>https://nthumods.com/en/courses</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>daily</changefreq>
<priority>1.00</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/courses"/>
Expand All @@ -29,7 +32,7 @@
<!-- ==================== TIMETABLE ==================== -->
<url>
<loc>https://nthumods.com/zh/timetable</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.90</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/timetable"/>
Expand All @@ -38,7 +41,7 @@
</url>
<url>
<loc>https://nthumods.com/en/timetable</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.90</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/timetable"/>
Expand All @@ -49,7 +52,7 @@
<!-- ==================== TODAY / CALENDAR ==================== -->
<url>
<loc>https://nthumods.com/zh/today</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>daily</changefreq>
<priority>0.90</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/today"/>
Expand All @@ -58,7 +61,7 @@
</url>
<url>
<loc>https://nthumods.com/en/today</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>daily</changefreq>
<priority>0.90</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/today"/>
Expand All @@ -67,7 +70,7 @@
</url>
<url>
<loc>https://nthumods.com/zh/calendar</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.85</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/calendar"/>
Expand All @@ -76,7 +79,7 @@
</url>
<url>
<loc>https://nthumods.com/en/calendar</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.85</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/calendar"/>
Expand All @@ -87,7 +90,7 @@
<!-- ==================== BUS ==================== -->
<url>
<loc>https://nthumods.com/zh/bus</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.85</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/bus"/>
Expand All @@ -96,18 +99,54 @@
</url>
<url>
<loc>https://nthumods.com/en/bus</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.85</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/bus"/>
<xhtml:link rel="alternate" hreflang="en" href="https://nthumods.com/en/bus"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://nthumods.com/zh/bus"/>
</url>
<url>
<loc>https://nthumods.com/zh/bus/main</loc>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.75</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/bus/main"/>
<xhtml:link rel="alternate" hreflang="en" href="https://nthumods.com/en/bus/main"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://nthumods.com/zh/bus/main"/>
</url>
<url>
<loc>https://nthumods.com/en/bus/main</loc>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.75</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/bus/main"/>
<xhtml:link rel="alternate" hreflang="en" href="https://nthumods.com/en/bus/main"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://nthumods.com/zh/bus/main"/>
</url>
<url>
<loc>https://nthumods.com/zh/bus/nanda</loc>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.75</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/bus/nanda"/>
<xhtml:link rel="alternate" hreflang="en" href="https://nthumods.com/en/bus/nanda"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://nthumods.com/zh/bus/nanda"/>
</url>
<url>
<loc>https://nthumods.com/en/bus/nanda</loc>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.75</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/bus/nanda"/>
<xhtml:link rel="alternate" hreflang="en" href="https://nthumods.com/en/bus/nanda"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://nthumods.com/zh/bus/nanda"/>
</url>

<!-- ==================== VENUES ==================== -->
<url>
<loc>https://nthumods.com/zh/venues</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.80</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/venues"/>
Expand All @@ -116,7 +155,7 @@
</url>
<url>
<loc>https://nthumods.com/en/venues</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.80</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/venues"/>
Expand All @@ -127,7 +166,7 @@
<!-- ==================== SPORTS VENUES ==================== -->
<url>
<loc>https://nthumods.com/zh/sports-venues</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.80</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/sports-venues"/>
Expand All @@ -136,7 +175,7 @@
</url>
<url>
<loc>https://nthumods.com/en/sports-venues</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.80</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/sports-venues"/>
Expand All @@ -147,7 +186,7 @@
<!-- ==================== AI CHAT ==================== -->
<url>
<loc>https://nthumods.com/zh/chat</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.75</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/chat"/>
Expand All @@ -156,7 +195,7 @@
</url>
<url>
<loc>https://nthumods.com/en/chat</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.75</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/chat"/>
Expand All @@ -167,7 +206,7 @@
<!-- ==================== SHOPS ==================== -->
<url>
<loc>https://nthumods.com/zh/shops</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.70</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/shops"/>
Expand All @@ -176,7 +215,7 @@
</url>
<url>
<loc>https://nthumods.com/en/shops</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>weekly</changefreq>
<priority>0.70</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/shops"/>
Expand All @@ -187,7 +226,7 @@
<!-- ==================== APPS / FEATURES ==================== -->
<url>
<loc>https://nthumods.com/zh/apps</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.70</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/apps"/>
Expand All @@ -196,7 +235,7 @@
</url>
<url>
<loc>https://nthumods.com/en/apps</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.70</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/apps"/>
Expand All @@ -207,7 +246,7 @@
<!-- ==================== TEAM ==================== -->
<url>
<loc>https://nthumods.com/zh/team</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.60</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/team"/>
Expand All @@ -216,7 +255,7 @@
</url>
<url>
<loc>https://nthumods.com/en/team</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.60</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/team"/>
Expand All @@ -227,7 +266,7 @@
<!-- ==================== CONTRIBUTE ==================== -->
<url>
<loc>https://nthumods.com/zh/contribute</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.60</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/contribute"/>
Expand All @@ -236,7 +275,7 @@
</url>
<url>
<loc>https://nthumods.com/en/contribute</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>monthly</changefreq>
<priority>0.60</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/contribute"/>
Expand All @@ -247,7 +286,7 @@
<!-- ==================== PRIVACY POLICY ==================== -->
<url>
<loc>https://nthumods.com/zh/privacy-policy</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>yearly</changefreq>
<priority>0.40</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/privacy-policy"/>
Expand All @@ -256,7 +295,7 @@
</url>
<url>
<loc>https://nthumods.com/en/privacy-policy</loc>
<lastmod>2026-04-21</lastmod>
<lastmod>2026-04-27</lastmod>
<changefreq>yearly</changefreq>
<priority>0.40</priority>
<xhtml:link rel="alternate" hreflang="zh-TW" href="https://nthumods.com/zh/privacy-policy"/>
Expand Down
45 changes: 33 additions & 12 deletions apps/web/src/components/CourseDetails/CourseDetailsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const CourseDetailContainer = ({
courseCode: `${course.department} ${course.course}-${course.class}`,
educationalLevel: "University",
inLanguage: "zh-TW",
url: `https://nthumods.com/zh/courses/${course.raw_id}`,
url: `https://nthumods.com/${lang}/courses/${course.raw_id}`,
Comment on lines 167 to +170
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON-LD Course object still hardcodes inLanguage: "zh-TW" even when rendering an /en/... page, while url is now language-specific. This produces inconsistent structured data for English pages. Consider deriving inLanguage (and possibly the primary name) from the lang prop so the schema matches the page language.

Copilot uses AI. Check for mistakes.
offers: {
"@type": "Offer",
price: "0",
Expand Down Expand Up @@ -227,18 +227,24 @@ const CourseDetailContainer = ({
// Handle error state
if (error || !course) {
return (
<div className="py-6 px-4">
<div className="flex flex-col gap-2 border-l border-neutral-500 pl-4 pr-6">
<h1 className="text-2xl font-bold">404</h1>
<p className="text-xl">找不到課程</p>
<>
<Helmet>
<meta name="robots" content="noindex, nofollow" />
<meta name="googlebot" content="noindex, nofollow" />
Comment on lines +232 to +233
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the missing-course/error state, the component sets noindex, nofollow but doesn’t set a canonical URL. Since the rest of the app (e.g. TitleUpdater) will still emit a canonical pointing at the missing /courses/:id URL, crawlers that hit the client-rendered version can see conflicting signals compared to the Worker (which canonicalizes to /courses). Consider explicitly setting a canonical in this error Helmet (and aligning nofollow vs follow with the Worker directive) to keep behavior consistent.

Suggested change
<meta name="robots" content="noindex, nofollow" />
<meta name="googlebot" content="noindex, nofollow" />
<meta name="robots" content="noindex, follow" />
<meta name="googlebot" content="noindex, follow" />
<link
rel="canonical"
href={`https://nthumods.com/${lang}/courses`}
/>

Copilot uses AI. Check for mistakes.
</Helmet>
<div className="py-6 px-4">
<div className="flex flex-col gap-2 border-l border-neutral-500 pl-4 pr-6">
<h1 className="text-2xl font-bold">404</h1>
<p className="text-xl">找不到課程</p>

<Link to="../">
<Button size="sm" variant="outline">
<ChevronLeft /> Back
</Button>
</Link>
<Link to="../">
<Button size="sm" variant="outline">
<ChevronLeft /> Back
</Button>
</Link>
</div>
</div>
</div>
</>
);
}

Expand Down Expand Up @@ -266,6 +272,21 @@ const CourseDetailContainer = ({
/>
<link
rel="canonical"
href={`https://nthumods.com/${lang}/courses/${course.raw_id}`}
/>
<link
rel="alternate"
hrefLang="zh-TW"
href={`https://nthumods.com/zh/courses/${course.raw_id}`}
/>
<link
rel="alternate"
hrefLang="en"
href={`https://nthumods.com/en/courses/${course.raw_id}`}
/>
<link
rel="alternate"
hrefLang="x-default"
href={`https://nthumods.com/zh/courses/${course.raw_id}`}
/>
<meta
Expand All @@ -278,7 +299,7 @@ const CourseDetailContainer = ({
/>
<meta
property="og:url"
content={`https://nthumods.com/zh/courses/${course.raw_id}`}
content={`https://nthumods.com/${lang}/courses/${course.raw_id}`}
/>
<meta name="twitter:card" content="summary" />
<meta
Expand Down
Loading
Loading