Open navClose nav


Snippets in Forestry are pre-defined chunks of text that can be inserted into your content. You can put anything in a snippet that you might normally insert into your content, but they are especially useful in conjunction with shortcodes in Hugo or certain Liquid tags in Jekyll.

Creating Snippets

To create a snippet, add a .snippet file to the .forestry/snippets directory in your repository. This file should contain the content that you wish to be inserted when your snippet is applied in the editor. You can also embed Markdown in your snippets.


The website has a Hugo shortcode for adding helpful tips to our blog posts and documentation. To make inserting these easier, we have added a Tip Snippet for inserting that shortcode. Here is the snippet:


{{% tip %}} Tip Body {{% /tip %}}
At this time, there is no specific convention for identifying which parts of your snippet can be customized when the snippet is applied inside the editor. We recommend simply using descriptive placeholders, such as “Tip Body” in the example above.

Our Markdown editor does not support Markdown tables yet. So you might want to provide a Markdown table starter to help your editors.

A simple .forestry/snippets/table.snippet file:

### Table title

| Header | Header | Header  |
| ------ | ------ | ------- |
| Cell   | Cell   | Cell   |
| Cell   | Cell   | Cell   |
| Cell   | Cell   | Cell   |

Using Snippets

You can access the list of available snippets by clicking the { } snippet icon in the editor toolbar.,dpr_auto,f_auto,q_80,w_640/

Clicking on a snippet in the list will insert its contents into your document at the cursor position.

Last updated on July 20, 2018