feat: Support language redirection for any docs pages#12
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends language redirection functionality to all documentation pages, not just the homepage. It implements automatic language detection and redirection for any documentation path based on browser preferences, and adds proper SEO tags including canonical links and sitemap references.
Changes:
- Added
availableLanguagesprop to all page components to enable language-specific metadata - Created new
LanguageSwitchLayoutcomponent for language detection and redirection - Implemented catch-all route
[...slug].astroto handle language redirection for any documentation path - Updated sitemap configuration to filter and properly handle multi-language pages
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/[...slug].astro | New catch-all route that generates language redirect pages for all documentation paths by scanning existing language-specific pages |
| src/layouts/LanguageSwitchLayout.astro | New layout component implementing client-side language detection and redirection logic |
| src/pages/index.astro | Simplified to use the new LanguageSwitchLayout instead of inline redirect code |
| src/layouts/DocsLayout.astro | Added canonical, alternate language, and sitemap link tags; accepts availableLanguages prop |
| astro.config.mjs | Updated sitemap integration to filter language-specific pages and configure i18n settings |
| src/pages/ja/**/*.astro | Added availableLanguages prop to Japanese documentation pages |
| src/pages/en/**/*.astro | Added availableLanguages prop to English documentation pages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ogwata
approved these changes
Feb 2, 2026
Member
ogwata
left a comment
There was a problem hiding this comment.
承認します。全ページでの言語リダイレクト対応とSEOタグの追加、素晴らしいです。Copilotの指摘事項も適切に修正されています。
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
About
トップページ以外のページについても、language省略時のリダイレクトを有効化します。
http://docs.vivliostyle.org/cli/→http://docs.vivliostyle.org/ja/cli/https://docs.vivliostyle.org/viewer/vivliostyle-viewer/→https://docs.vivliostyle.org/ja/viewer/vivliostyle-viewer/また、SEO観点で適切なHTMLタグを設定します。(
<link rel="canonical">,<link rel="sitemap">)