Conversation
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Preview deployment ✅ Deployment complete!
|
morinokami
left a comment
There was a problem hiding this comment.
こちら対応いただきありがとうございます!何点かコメントしましたので、妥当そうなものについて修正をお願いします。
|
|
||
| <p><Since v="2.9.0" /></p> | ||
|
|
||
| `redirects`値を使用して、Astroの設定から永久的なリダイレクトのマッピングを指定できます。 |
There was a problem hiding this comment.
こちら英語版では redirects はリンクになっているようです:
You can specify a mapping of permanent redirects in your Astro config with the
redirectsvalue.
|
|
||
| const { lang, version } = Astro.params; | ||
| --- | ||
| ... |
There was a problem hiding this comment.
英語版にない「...」が入ってしまっている?
| ... |
|
|
||
| const { path } = Astro.params; | ||
| --- | ||
| ... |
|
|
||
| ```astro title="src/pages/[...slug].astro" | ||
| --- | ||
| export async function getStaticPaths() { |
There was a problem hiding this comment.
これも細かいのですが英語版では async は付いていないようです:
| export async function getStaticPaths() { | |
| export function getStaticPaths() { |
| { | ||
| slug: undefined, | ||
| title: "Astroストア", | ||
| text: "Astroにようこそ!", |
There was a problem hiding this comment.
原文では「Welcome to the Astro store!」なので、「ストア」が抜けてしまっているようです:
| text: "Astroにようこそ!", | |
| text: "Astroストアにようこそ!", |
| { | ||
| slug: undefined, | ||
| title: "Astroストア", | ||
| text: "Astroにようこそ!", |
There was a problem hiding this comment.
同じく:
| text: "Astroにようこそ!", | |
| text: "Astroストアにようこそ!", |
| 意図的にリライトを使って`/404`ページをレンダリングすることもできます。例えば、eコマースショップの商品が利用できなくなったことを示す場合、以下のようにHTTPレスポンスステータスに基づいて条件付きでリライトできます。 | ||
|
|
||
| ```astro title="src/pages/[item].astro" | ||
| --- | ||
| const { item } = Astro.params; | ||
|
|
||
| if (!itemExists(item)) { | ||
| return Astro.rewrite("/404"); | ||
| } | ||
| --- | ||
| ``` | ||
|
|
||
| また、例えば存在しないURLにアクセスした際にサイトの特定のページを表示する場合は、以下のようにパスを指定できます。 |
There was a problem hiding this comment.
L359 と L371 の原文はそれぞれ
You can intentionally create a rewrite to render your
/404page, for example to indicate that a product in your e-commerce shop is no longer available:
と
You can also conditionally rewrite based on an HTTP response status, for example to display a certain page on your site when visiting a URL that doesn't exist:
なのですが、後者の内容である「HTTPレスポンスステータスに基づいて条件付きでリライト」が前者の訳に含まれてしまっているようでした。こちら確認の上修正をお願いできますか 🙏
Description
This PR is based on the following file:
https://github.com/withastro/docs/blob/main/src/content/docs/en/guides/routing.mdx
I'd appreciate it if you could review this when you have time 🫡