Closed fgomez828 closed 3 years ago
Switched approaches to mostly watch (instead of do) the code-along and write up implementation details that aren't obvious and aren't currently in our internal documentation:
Module 2: Gatsby Basics
Module 3: CSS in Gatsby
src/styles/global.css
file, but a few other things it might be useful to make note of / provide context for:
gatsby-browser.js
is what Wes Bos recommends for global styles. I'd be curious to do more research about the pros & cons of this approach vs what we've been doingnormalize.css
might be worth exploring also, particularly as a way to shorten the amount of time we test browser compatibility for styling.Will continue with Module 4: Headless CMS next investment time
Module 5: GraphQL
gatsby-config.js
allows us to pull data from a headless CMS or a directory of final data from an ETL pipeline into GraphQL. It also allows us to add site metadata and make use of plugins. Here are the docs on gatsby-config.js
.Module 6: Puttin' in work
gatsby-img
<Img>
component, include fluid
or static
property (fluid makes the image responsive
) and alt
property. Module 7: Making Gatsby Dynamic
gatsby-node.js
file using sourceNodes()
method to tell Gatsby to get data and turn it into nodesModule 8: Pages & Filtering
totalCount
in your graphql query for the data you want to paginatetotalCount
/ total per page + 1 if remainder)async
function to paginate data in gatsby-node.js
; in this method, query for data to be paginated & create each page with the appropriate number of query results using actions.createPageskip = <number of query results to skip on this page>
, currentPage = <the page number>
, and pageSize = <number of results on this page>
context
will be available to your graphql query for the paginated page; also use graphql's limit
filtercomponents/Pagination.js
and import your queryModule 9: Custom Pages + SEO
<Helmet>
tagModule 10: Order form, custom hooks, & state management
Modules 11 - 13:
Opening up this issue for us as an org to drop knowledge nuggets we glean from Wes Bos's "Master Gatsby" course (login here). We can then add the most helpful pieces into our documentation about React / Gatsby.