Customize Your Sidebar and Limit Front Matter Templates to Sections

Another week full of new features! While the marketing team launched the Blocks theme uBuild for Jekyll and Hugo, the development team kept working on new product features.

Making the sidebar configurable was really high up on your wish list and this week we made it happen. Some of you also wanted to limit access to Front Matter Templates to specific content sections. You can do that now, too.

Letโ€™s look at a few examples and feel free to open up your code editor and follow along.

All of your sidebar configurations are organized in your settings.yml under sections/collections depending on whether you use Hugo or Jekyll. So let’s go ahead and open that file.


Hide Sections ๐Ÿ™ˆ

Some sections of a site are not important for content editing purposes, so they shouldn’t add clutter to your content manager!

You can now decide which sections are visible by using our hidden tag. Also, your content sections will appear in the exact order you specify them under sections/collections.

https://res.cloudinary.com/forestry-demo/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/07/remove-content-type.gif

For Jekyll:

collections:
- path: _posts
  hidden: true

For Hugo:

sections:
- path: content/posts
  hidden: true

Switch Labels ๐Ÿท๏ธ

Sometimes your directory names might not be ideal outside a development environment. Thatโ€™s why you can now choose to rename the labels of your content sections without changing the name of the directory itself.

https://res.cloudinary.com/forestry-demo/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/07/switch-label.gif

For Jekyll:

collections:
- path: _posts
  label: Blog

For Hugo:

sections:
- path: content/posts
  label: Blog

Assign Front Matter Templates to Sections ๐Ÿ‘ˆ๐Ÿ‘†๐Ÿ‘‰

Until now every time you created new content you would have to choose from a long list of Front Matter Templates. That wasn’t ideal and bogged content editors down.

Now you can assign one or more Front Matter Templates to a specific content section and only expose them for that section. You can even provide them in an order you specify.

https://res.cloudinary.com/forestry-demo/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/07/create-posts.gif

For Jekyll:

collections:
- path: _posts
  templates:
  - post
  - article

For Hugo:

sections:
- path: content/posts
  templates:
  - post
  - article

If you only add one template to a section, that template will be pre-selected and we won’t show the dropdown anymore.


Restrict Adding More Content to a Section

You can also prevent content to be added to a section altogether.

https://res.cloudinary.com/forestry-demo/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/07/content-all-none.gif

For Jekyll:

collections:
- path: _posts
  create: none

For Hugo:

sections:
- path: content/posts
  create: none

Read more on these updates in our docs ๐Ÿ“–

You can also check out our previous update ๐Ÿ˜