Skip to content

Commit fe971ca

Browse files
authored
Merge pull request #310 from Nextjs-ja-translation/chore/update-basic-features-pages
Chore: basic-features/pages の更新
2 parents 1352998 + 7dbcd63 commit fe971ca

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

docs/basic-features/pages.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,22 @@ Next.js ではプリレンダリングに関して**静的生成(Static Generati
5959
<details open>
6060
<summary><b>サンプル</b></summary>
6161
<ul>
62-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-wordpress">WordPressの例</a> (<a href="https://next-blog-wordpress.now.sh">デモ</a>)</li>
63-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/blog-starter">Markdownファイルを用いたブログの例</a> (<a href="https://next-blog-starter.now.sh/">デモ</a>)</li>
64-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-datocms">DatoCMSを用いた例</a> (<a href="https://next-blog-datocms.now.sh/">デモ</a>)</li>
65-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-takeshape">TakeShapeを用いた例</a> (<a href="https://next-blog-takeshape.now.sh/">デモ</a>)</li>
66-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-sanity">Sanityを用いた例</a> (<a href="https://next-blog-sanity.now.sh/">デモ</a>)</li>
67-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-prismic">Prismicを用いた例</a> (<a href="https://next-blog-prismic.now.sh/">デモ</a>)</li>
68-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-contentful">Contentfulを用いた例</a> (<a href="https://next-blog-contentful.now.sh/">デモ</a>)</li>
69-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-strapi">Strapiを用いた例</a> (<a href="https://next-blog-strapi.now.sh/">デモ</a>)</li>
70-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-agilitycms">Agility CMSを用いた例</a> (<a href="https://next-blog-agilitycms.now.sh/">デモ</a>)</li>
71-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-cosmic">Cosmicを用いた例</a> (<a href="https://next-blog-cosmic.now.sh/">デモ</a>)</li>
72-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-buttercms">ButterCMSを用いた例</a> (<a href="https://next-blog-buttercms.now.sh/">デモ</a>)</li>
73-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-storyblok">Storyblokを用いた例</a> (<a href="https://next-blog-storyblok.now.sh/">デモ</a>)</li>
74-
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-graphcms">GraphCMSを用いた例</a> (<a href="https://next-blog-graphcms.now.sh/">デモ</a>)</li>
75-
<li><a href="https://static-tweet.now.sh/">ツイートの静的埋め込みのデモ</a></li>
62+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-wordpress">WordPressの例</a> (<a href="https://next-blog-wordpress.vercel.app">デモ</a>)</li>
63+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/blog-starter">Markdownファイルを用いたブログの例</a> (<a href="https://next-blog-starter.vercel.app/">デモ</a>)</li>
64+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-datocms">DatoCMSを用いた例</a> (<a href="https://next-blog-datocms.vercel.app/">デモ</a>)</li>
65+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-takeshape">TakeShapeを用いた例</a> (<a href="https://next-blog-takeshape.vercel.app/">デモ</a>)</li>
66+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-sanity">Sanityを用いた例</a> (<a href="https://next-blog-sanity.vercel.app/">デモ</a>)</li>
67+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-prismic">Prismicを用いた例</a> (<a href="https://next-blog-prismic.vercel.app/">デモ</a>)</li>
68+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-contentful">Contentfulを用いた例</a> (<a href="https://next-blog-contentful.vercel.app/">デモ</a>)</li>
69+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-strapi">Strapiを用いた例</a> (<a href="https://next-blog-strapi.vercel.app/">デモ</a>)</li>
70+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-prepr">Preprを用いたデモ</a> (<a href="https://next-blog-prepr.vercel.app/">デモ</a>)</li>
71+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-agilitycms">Agility CMSを用いた例</a> (<a href="https://next-blog-agilitycms.vercel.app/">デモ</a>)</li>
72+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-cosmic">Cosmicを用いた例</a> (<a href="https://next-blog-cosmic.vercel.app/">デモ</a>)</li>
73+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-buttercms">ButterCMSを用いた例</a> (<a href="https://next-blog-buttercms.vercel.app/">デモ</a>)</li>
74+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-storyblok">Storyblokを用いた例</a> (<a href="https://next-blog-storyblok.vercel.app/">デモ</a>)</li>
75+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-graphcms">GraphCMSを用いた例</a> (<a href="https://next-blog-graphcms.vercel.app/">デモ</a>)</li>
76+
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-builder-io">Builder.ioを用いた例</a> (<a href="https://cms-builder-io.vercel.app/">デモ</a>)</li>
77+
<li><a href="https://static-tweet.vercel.app/">ツイートの静的埋め込みのデモ</a></li>
7678
</ul>
7779
</details>
7880

@@ -152,7 +154,7 @@ export async function getStaticProps() {
152154
export default Blog;
153155
```
154156

155-
`getStaticProps`の動作についてさらに知るためには、[データ取得のドキュメント](/docs/basic-features/data-fetching.md#getstaticprops-static-generation)をご覧ください。
157+
`getStaticProps`の動作についてさらに知るためには、[データ取得のドキュメント](/docs/basic-features/data-fetching/get-static-props.md)をご覧ください。
156158

157159
#### シナリオ 2: ページのパス(path)が外部データに依存する場合
158160

@@ -178,7 +180,9 @@ export async function getStaticPaths() {
178180
const posts = await res.json();
179181

180182
// 記事にもとづいてプリレンダするパスを取得
181-
const paths = posts.map(post => `/posts/${post.id}`);
183+
const paths = posts.map((post) => ({
184+
params: { id: post.id },
185+
}))
182186

183187
// 設定したパスのみ、ビルド時にプリレンダ
184188
// { fallback: false } は、他のルートが404になるという意味
@@ -212,7 +216,7 @@ export async function getStaticProps({ params }) {
212216
export default Post;
213217
```
214218

215-
`getStaticPaths`の動作についてさらに知りたい場合には、[データ取得のドキュメント](/docs/basic-features/data-fetching.md#getstaticpaths-static-generation)をご覧ください。
219+
`getStaticPaths`の動作についてさらに知りたい場合には、[データ取得のドキュメント](/docs/basic-features/data-fetching/get-static-paths.md)をご覧ください。
216220

217221
### どのような場合に静的生成を行うべきか?
218222

@@ -222,7 +226,7 @@ export default Post;
222226
静的生成は以下のような様々なページに対して行うことができます。
223227

224228
- マーケティングのページ
225-
- ブログ記事
229+
- ブログ記事やポートフォリオ
226230
- e コマースの製品リスト
227231
- ヘルプやドキュメント
228232

@@ -235,7 +239,7 @@ export default Post;
235239
このような場合には、以下の方法をとることができます。
236240

237241
- **クライアントサイドレンダリング**と静的生成を併用する: ページの一部のプリレンダリングを一旦飛ばし、クライアント側の JavaScript を使って残りを表示させます。
238-
このアプローチについてさらに知るためには、[データ取得のドキュメント](/docs/basic-features/data-fetching.md#fetching-data-on-the-client-side)をご覧ください。
242+
このアプローチについてさらに知るためには、[データ取得のドキュメント](/docs/basic-features/data-fetching/client-side.md)をご覧ください。
239243
- **サーバーサイドレンダリング**を用いる: Next.js がそれぞれのリクエストに対してプリレンダリングします。
240244
CDN によるキャッシュができないので表示が遅くなりますが、常に最新の情報が表示されます。このアプローチについてこれから説明します。
241245

@@ -270,7 +274,7 @@ export default Page;
270274

271275
見ての通り、`getServerSideProps``getStaticProps` とよく似ています。両者の違いは、`getServerSideProps`がビルド時ではなくリクエストの度に呼ばれることです。
272276

273-
`getServerSideProps`の動作についてさらに知りたい場合には、[データ取得のドキュメント](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering)をご覧ください。
277+
`getServerSideProps`の動作についてさらに知りたい場合には、[データ取得のドキュメント](/docs/basic-features/data-fetching/get-server-side-props.md)をご覧ください。
274278

275279
## まとめ
276280

@@ -287,7 +291,7 @@ Next.js のプリレンダリングの方法として、以下の 2 つについ
287291
以下のセクションを次に読むことをお勧めします。
288292

289293
<div class="card">
290-
<a href="/docs/basic-features/data-fetching.md">
294+
<a href="/docs/basic-features/data-fetching/overview.md">
291295
<b>データの取得:</b>
292296
<small>Next.jsのデータ取得について学びましょう。</small>
293297
</a>

0 commit comments

Comments
 (0)