src/pages
become pages automatically with paths based on their file name. For example src/pages/index.js
is mapped to yoursite.com
and src/pages/about.js
becomes yoursite.com/about/
. Every .js
or .jsx
file in the pages directory must resolve to either a string or react component, otherwise your build will fail.src/templates/post.js
is an example of a page component. It queries GraphQL for markdown data and then renders the page using this data.src/html.js
is responsible for everything other than where Gatsby lives in the <body />
.<head>
metadata and general structure of the document and add external links.html.js
file will suffice. If you need more control over server rendering, then it’s valuable to have an html.js
.