Skip to content

Fix: Use raw tags for paths and links for GitHub Pages#3

Merged
ningen merged 1 commit intomainfrom
fix-japanese-tag-404
May 21, 2025
Merged

Fix: Use raw tags for paths and links for GitHub Pages#3
ningen merged 1 commit intomainfrom
fix-japanese-tag-404

Conversation

@ningen
Copy link
Copy Markdown
Owner

@ningen ningen commented May 21, 2025

This is my third attempt to resolve 404 errors for tags with Japanese characters on GitHub Pages. I'm basing this on your feedback indicating that URLs are being resolved to a raw (decoded) form with a trailing slash (e.g., /tags/未AC/).

This commit implements the following strategy:

  1. Ensures trailingSlash: true in next.config.ts to support directory/index.html structures.
  2. Configures generateStaticParams in src/app/tags/[tag]/page.tsx to use raw (decoded) tag names for path generation. This should result in Next.js creating directories with names like out/tags/未AC/index.html.
  3. Updates the TagPage component in src/app/tags/[tag]/page.tsx to expect these raw tag names as parameters.
  4. Modifies the link generation in src/app/tags/page.tsx to use raw (decoded) tag names in the href attributes of Link components. This ensures that generated links match the directory structure (e.g., /tags/未AC).

This is my third attempt to resolve 404 errors for tags with Japanese characters on GitHub Pages. I'm basing this on your feedback indicating that URLs are being resolved to a raw (decoded) form with a trailing slash (e.g., /tags/未AC/).

This commit implements the following strategy:
1. Ensures `trailingSlash: true` in `next.config.ts` to support `directory/index.html` structures.
2. Configures `generateStaticParams` in `src/app/tags/[tag]/page.tsx` to use raw (decoded) tag names for path generation. This should result in Next.js creating directories with names like `out/tags/未AC/index.html`.
3. Updates the `TagPage` component in `src/app/tags/[tag]/page.tsx` to expect these raw tag names as parameters.
4. Modifies the link generation in `src/app/tags/page.tsx` to use raw (decoded) tag names in the `href` attributes of `Link` components. This ensures that generated links match the directory structure (e.g., `/tags/未AC`).
@ningen ningen merged commit 7645c47 into main May 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant