npm start - Start development server on http://localhost:8000.
Generate production build:
npm run build
Generate a production build of the site and serve it locally on http://localhost:9000. Use this when doing a final review:
npm run serve
Blog posts live in
../blogposts directory. The following frontmatter is required for a blog post:
--- title: Example blog post author: Your Name publishDate: yyyy-mm-ddT00:00-07:00 tags: [ blog ] slug: url-pathname-to-your-blog-post heroImage: path or url to image file published: boolean ---
Blog posts are visible on if published is set to
Blog post images
Blog post images (both hero and inline) belong in the
/website/static/blog/ directory, and the path to the image in your post is
Images should be sized and compressed appropriately to optimize the file size without noticeably degrading the image quality. ImageOptim is a good (and free) image compresion tool.
Previewing blog post drafts
If you want to preview a blog post as it would appear on our site, set
true, and run
npm serve to view your blog post locally.
Gatsby builds our site into the
/public folder, which is the directory that gets pushed to the
gh-pages branch and gets deployed.
All website pages are in
/pages. Adding a TypeScript file under
/pageswill create a page at a route equivalent to the filename (ex:
gatsby-configcontains all the gatsby plugins that are used in the site.
gatsby-nodehandles all logic for generating blog and content pages.
html.tsxwraps the entire Gatsby body. This generally does not need to be changed other than to add global elements to the site
/layoutshold layouts that wrap all page components.
/layouts/index.tsxis the default layout. You can specify the layout to use for generated pages in
/componentsholds reusabel React components.
/staticholds all static assets (images, gifs, scripts). These get moved into
/publicat build time. Because these are moved into
/public, when calling these static items (for example, in blog posts or other js files), the import path will be at the root (ex:
/static/blog-images/FileTree.gifis loaded by calling