- Notifications
You must be signed in to change notification settings - Fork17
A simple starter blog built with Gatsby & Forestry
License
kendallstrautman/brevifolia-gatsby-forestry
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Brevifolia is minimalist blog starter to get you going usingForestry withGatsby. Check out the demohere
This blog is statically generated by Gatsby, a rendered combination of react components and markdown files. It is preconfigured to work with Forestry as a way to manage your content. Forestry makes changes by editing markdown or data files, uploading media to the correct directory and committing these updates to your repo directly.
The styles were coded & designed by yours truly, usingscss withcss modules (which areinherently support by gatsby) and thebem naming convetion. The font used isWork Sans.
In your terminal, navigate to where you would like this blog to live, then run
gatsby new [SITE_DIRECTORY_NAME] https://github.com/kendallstrautman/brevifolia-gatsby-forestrycd [SITE_DIRECTORY_NAME]yarn devIn your terminal, navigate to where you would like this blog to live, then run
#clone the repogit clone git@github.com:kendallstrautman/brevifolia-gatsby-forestry.git#navigate to the directorycd brevifolia-gatsby-forestry#install dependencies & run dev server with yarnyarn installyarn dev#or with npmnpm installnpm run dev
A new browser window should open with the dev server running or you can navigate to localhost:8000
With Gatsby offering a plugin-rich ecosystem, there are a few key plugins that make this project possible.
- Gatsby-image optimizes image loading and provides the correct file paths for output.
- Gatsby-transformer-remark gives us access to and transforms the markdown files, using alsogatsby-remark-images,gatsby-remark-normalize-paths, &gatsby-remark-relative-images to make sure the content in the markdown works properly.
- Gatsby-transformer-yaml allows us to use the data in .yaml files, feel free to addgatsby-transformer-json if you prefer that format for data files.
- Gatsby-plugin-sass lets us write styles using scss or sass.
- Gatsby-plugin-react-helmet extends the well-known react-helmet, allowing you to adjust content in the ‘head’ of your components.
- Site-level configuration is stored in
config.jsonso it can be exposed to Forestry. This file is loaded in thegatsby-config.jsto configure Gatsby and all it to be accessible via siteMetaData in your graphql queries. - Access any of Gatsby'sbrowser api's via the
gatsby-browser.js, or load global styles etc. - Add and access plugin options or siteMetaData via
gatsby-config.js - Access Gatsby'snode api's via
gatsby-node.js. This is where the creation of new blog pages or nodes is handled. - Edit styles via
src/styles/... content/contains all your markdown blog posts, images & data files (e.g. authors list, info page data).src/pagesis a very important and required directory for Gatsby. This is where all your pages for the site live.- Blog posts are built from a template that can be accessed at
src/templates. - The pages & template are comprised of components from
src/components.
The.forestry directory contains all the settings information and frontmatter configuration to allow Forestry to setup the sidebar structure and editing capacity for this blog. After importing this blog into forestry, you canaccess and edit all of the content via the sidebar.
You can add new blog posts,data files, or entire pages and sections to fit your needs. You can alsocustomize how media is handled, by configurating gitLFS, Cloudinary, S3, or Netlify Large Media.
You can set up aremote admin for content editors to log in directly to yoururl.com/admin to make content updates.
Theinstant preview method spins up the Gatsby development server for a long-lived preview that can quickly respond to content updates. When using instant previews, your preview command should be the develop command. The development server spawned by this command should be available over port 8080, and bind to 0.0.0.0. The forestry:preview command in this project's package.json will spin up a Gatsby dev server compatible with Forestry's instant previews.
Netlify is a great way to easily deploy sites. There's no special setup you need to do with Forestry to deploy with Netlify. When Forestry makes commits to your repo, Netlify will auto-trigger a rebuild / deploy when new commits are made.
About
A simple starter blog built with Gatsby & Forestry
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.