Configure the CMS
You setup your site with Forestry and now you’re ready to configure your CMS. This doc will go over:
- Setting up the content sections that appear in the CMS sidebar
- Setting up correct paths for images and other media
- Enabling and configuring your site’s preview
- Configuring your content model (the fields used on each page, post, etc)
Setting up Sidebar Content Sections
You are able to configure content sections to control what content editors have access to in the CMS. To do this, go to Settings > Sidebar. Here, you will be able to add and edit the content sections that appear in the CMS sidebar.

For details on how to set up the sidebar, take a look at our sidebar configuration guide.
Setting up Image Paths
When your team uploads images and other media, you want to ensure they’re going to the right directory. Set this up by going to Settings > Media.
You should see the following settings which are described below.
Upload Directory
The folder within your repo to store the uploaded media. If this is set to a directory that doesn’t exist, Forestry will create that directory.
Public Path
The path that will prepend media files uploaded from Front Matter fields. For example, if this value was set to /uploads
Forestry would write out the following image value.
---
title: My new post
date: 2020-06-11 12:00:00 -0400
image: /uploads/image.jpg
---
Front Matter Path
This usually has the same value as the Public Path
, but in some cases you may need these paths to be different.
Media Settings examples
With Hugo, all static assets belong in your /static
directory which then get outputted in the root of your built site.
Gatsby will store your assets in static
folder.
Eleventy is very flexible and do no respond to a single convention, you often see projects store images in a /src/images/
folder.
Jekyll supports static assets in your project root. Many gem-based themes store images in /assets/images
.
Upload Directory | Front Matter File Path | Body File Path | |
---|---|---|---|
Hugo | /static/uploads | /uploads | /uploads |
Gatsby | /static/images | /images | /images |
Eleventy | /src/images | /images | /images |
Jekyll | /assets/images | /assets/images | /assets/images |
Variables
Each of these settings supports the following variables at upload time:
:year:
: the current year, formattedYYYY
:month:
: the current month, formattedMM
:day:
: the current day, formattedDD
When these variables are used in the Uploads Folder setting, Forestry will create the necessary folders if they don’t exist when a file is uploaded.
For this (Hugo) site, we organize media like so:
upload_dir: "static/uploads"
public_path: "/uploads"
file_template: ":year:/:month:/:filename:"
For more information on media settings visit the Media Library doc.
Configuring Previews
While editing content in the CMS, users can preview their unsaved changes in an ephemeral copy of your full website. In order to do this, you will need to tell Forestry how to build your site by configuring the preview environment.
Content Modeling
In this section, we will configure your content model. This determines which fields are displayed for your pages, posts, etc.
When you sync a new site with Forestry, all data found in the Front Matter for your pages will be displayed as UI fields.
However, if you want to configure how these fields are displayed for your editors and which fields should appear for new pieces of content, you’ll need to set up a Front Matter Template (FMT).
This is where we’ll create a UI that’s tailored to our Front Matter data.
Create template from an existing page
If you just want to add fields that match an existing piece of content, navigate to that page and click the settings dropdown. From there, you can choose “Create Template” which will create a Front Matter Template based on that page’s front matter data.If the Front Matter for your blog posts looks like this:
---
title: My new post
date: 2020-06-11 12:00:00 -0400
image: /uploads/image.jpg
---
You’ll want to create a template called Posts and add the following fields:
This will generate the following user interface for the front matter template:
Click the settings icon to configure each field
Here are our title text field settings:
Some of the options available are:
- Setting a human-readable label
- Setting the name of the
key
to be written out to your Front Matter - Adding help text
- Making some fields hidden from editors
- Setting a default value
- Mark a field as required
- Many more options depending on the field type
Default Values
To set default values for your fields, just edit the field value right in the Template editing interface and save your changes.Disable the Body Editor
If you do not need a WYSIWYG editor for this content type, edit the template settings and select Fields
Applying a Template to a Page
To apply an FMT to an individual page, navigate to the page you want to apply the FMT to and click Settings > Change Template
Select your newly created template and save your changes.
Congrats! Now you should have fields set up for your different content types. For more information on Front Matter Templates, read the full doc here
Configuration Files
You probably noticed Forestry committed a .forestry
folder to your repository. This stores all of your site configuration (FMTs, image settings, etc). If you prefer working in a text file, you can set all of your site’s configuration by editing these files.
Caught a mistake or want to contribute to the docs? Edit this page on Github!