Skip to content

Commit 840fd0f

Browse files
committed
Readme upd
1 parent da44b9b commit 840fd0f

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Static demo blog. Deployed on [Vercel](https://vercel.com).
2020
- hamburger menu for mobile layout
2121
- "Load More" pagination
2222
- SEO-friendly article list initially fetched on server-side (paginated - client-side)
23-
- progressive images
23+
- progressive responsive images
2424
- categories
25-
- like\share\tweet buttons, comment section
25+
- Disqus comment section
2626

2727
## How did I do...
2828

@@ -47,9 +47,9 @@ Static demo blog. Deployed on [Vercel](https://vercel.com).
4747
<br>
4848
<ol>
4949
<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>
5151
<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>
5353
<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>
5454
<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>
5555
<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).
6060
## What did I use to make this demo:
6161

6262
- [Create Next App](https://nextjs.org/docs/getting-started#setup)
63-
- [styled-components](https://github.com/styled-components/styled-components) (examples: [global style](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/_app.js#L77), [usual style](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/_app.js#L153))
63+
- [styled-components](https://github.com/styled-components/styled-components) (examples: [global style](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/_app.js#L77), [usual style](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/_app.js#L152))
6464
- [Material-UI](https://github.com/mui-org/material-ui) ([Autocomplete example](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/header/SearchBar.js#L72))
6565
- [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))
66-
- [react-markdown](https://github.com/rexxars/react-markdown) ([example](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/article/Markdown.js#L26))
66+
- [react-markdown](https://github.com/rexxars/react-markdown) ([example](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/article/Markdown.js#L29))
6767
- [Showdown](https://github.com/showdownjs/showdown) ([example](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/search/SearchResult.js#L15))
6868
- [SWR](https://github.com/vercel/swr) (examples: [client-side](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/search.js#L14), [server-side](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/pages/categories/%5Bid%5D.js#L32))
69-
- Facebook [Like\Share Buttons](https://developers.facebook.com/docs/plugins/like-button) ([example](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/article/SocialButtons.js#L13)) and [Comments](https://developers.facebook.com/docs/plugins/comments) ([example](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/article/Comments.js))
70-
- Twitter [Tweet Button](https://developer.twitter.com/en/docs/twitter-for-websites/tweet-button/overview) ([example](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/article/SocialButtons.js#L22))
69+
- [disqus-react](https://github.com/disqus/disqus-react) (examples: [comments](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/article/Comments.js#L7), [comment count](https://github.com/AlexTechNoir/Next.js-Strapi-Blog/blob/master/components/ListItem.js#L48))
7170

7271
## Notes:
7372

7473
- 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

Comments
 (0)