You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,9 @@ Static demo blog. Deployed on [Vercel](https://vercel.com).
20
20
- hamburger menu for mobile layout
21
21
- "Load More" pagination
22
22
- SEO-friendly article list initially fetched on server-side (paginated - client-side)
23
-
- progressive images
23
+
- progressive responsive images
24
24
- categories
25
-
-like\share\tweet buttons, comment section
25
+
-Disqus comment section
26
26
27
27
## How did I do...
28
28
@@ -47,9 +47,9 @@ Static demo blog. Deployed on [Vercel](https://vercel.com).
47
47
<br>
48
48
<ol>
49
49
<li>Featured articles <a href="https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/index.js#L18">are fetched</a> on server-side as usual for SEO.</li>
50
-
<li>We <a href="https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/index.js#L26">fetch</a> paginated data on client-side with <a href="https://swr.vercel.app/docs/pagination">useSWRInfinite</a>.</li>
50
+
<li>We <a href="https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/index.js#L26">fetch</a> paginated data on client-side with <a href="https://swr.vercel.app/docs/pagination#useswrinfinite">useSWRInfinite</a>.</li>
51
51
<li>We use "size" and "setSize" parameters to change page index.</li>
52
-
<li>But instead of page index Strapi's API has <a href="https://strapi.io/documentation/v3.x/content-api/parameters.html#start">Start param</a> pointing at index from which data should be fetched and <a href="https://strapi.io/documentation/v3.x/content-api/parameters.html#limit">Limit param</a>.</li>
52
+
<li>But instead of page index Strapi's API has <a href="https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/content-api.html#start">Start param</a> pointing at index from which data should be fetched and <a href="https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/content-api.html#limit">Limit param</a>.</li>
53
53
<li>In getKey function <a href="https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/index.js#L12">"pageIndex" parameter</a> is the "size" parameter. It always starts with 0.</li>
54
54
<li>We set <a href="https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/index.js#L14">limit param to 1 (fetch 1 article), start param - to "pageIndex + 7"</a> (because first 7 artciles are already fetched on server-side).</li>
55
55
<li>On every time user clicks "Load More" button, we <a href="https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/index.js#L77">increase</a> size param to amount of times we need to fetch 1 artcile in one click (here we need 4, which depends on desktop layout).</li>
@@ -60,16 +60,14 @@ Static demo blog. Deployed on [Vercel](https://vercel.com).
60
60
## What did I use to make this demo:
61
61
62
62
-[Create Next App](https://nextjs.org/docs/getting-started#setup)
-[React Font Awesome](https://github.com/FortAwesome/react-fontawesome) ([example](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/header/UsualMenu.js#L75))
- at first load there is FOUC from Material-UI. MUI has [recommendations for server rendering](https://material-ui.com/guides/server-rendering/) and [example for Next.js](https://github.com/mui-org/material-ui/tree/master/examples/nextjs), however this measures doesn't work for everyone. There is fix, but it [works only in dev mode](https://github.com/vercel/next.js/issues/13058#issuecomment-666948357). Upd: as a temp fix, use [this](https://github.com/vercel/next.js/issues/13058#issuecomment-763746324).
75
-
- Facebook comment counters may be loaded slow (I guess it depends on Facebook)
0 commit comments