Setup Your Site
This doc will walk you through:
- Setting up your site repository with Forestry
- Making your first commit by publishing some changes
Import Site from Repo
If you don’t have a static site, you can pick one of our starters
Select your Static Site Generator
Before choosing your repository, Forestry would like to know which static site generator is used to build your site. Forestry supports many static site generators and can provide default settings for Jekyll, Hugo, VuePress, or Gatsby. As Forestry is able to edit any content stored in Markdown, YAML and JSON, you can use it with all kinds of SSG: Eleventy, Gridsome, Hexo, Next, Nuxt, etc.
In the case of Hugo, you must also specify which version you use.
Select your Git Provider
Forestry works by synchronizing content changes with a Git repository. In order to import your site, access to your Git provider is required. There are currently four Git providers supported by Forestry: GitHub, GitLab, Bitbucket, and Azure DevOps.
Choose a Repository and Branch
Once the authorization is complete, you will be taken to the next screen where you can choose the repository you wish to import.
GitHub Repository Permissions
In order to watch for changes from GitHub, Forestry needs to be able to create a webhook for your repository. Because of this, you must have admin level permissions for any repository you wish to import. Repositories which you do not have admin access to will be visible in the dropdown, but cannot be selected.
If you use GitHub, you will see a button at the top of the modal with a lock. By default, Forestry only requests access to your public repositories. Click this button if you want to grant access to Forestry to import your private repositories. You will only have to do this once.
Config pathIf you are using Hugo or Jekyll, Forestry will look in the root of your repository for a configuration file. This will be a file named
config.tomlin Hugo, and
_config.ymlin Jekyll. If this file cannot be located, Forestry will prompt you to enter the path to this file. Enter the path from the root of your project to the directory containing this file. If you use config-based folders in Hugo, then add an empty
config.tomlfile at root to bypass the check 😊 .
For example, if you have a repository containing a Hugo site in a subfolder named
config.tomlfile will be located at
hugo/config.toml. When you import your site into Forestry, it will prompt you to enter the config path, and you should enter
hugoin this field.
Once you have chosen your repository and the config file for your site has been found, click the Import Site button. After a few moments you will be redirected into the Forestry CMS while the site finishes importing. Depending on the size of your site, the import process can take a few minutes. Stretch your legs, grab a glass of water, and it will be done before you know it.
Go into a post or page, edit some text and you will see “Unsaved Changes” at the top of your document.
Click preview to view your changes in a new tab.
Having Trouble Previewing your Site?Not all site work with previews out of the box. To learn more about how to configure previews for your site, visit the preview documentation
Make your first commit
Click the publish button to save changes and make a Git commit.
The page should become up-to-date with your repository again.
Go to your Git repo and look at your commit history. You should see your updates from Forestry there. Committing has never been easier!
Caught a mistake or want to contribute to the docs? Edit this page on Github!