Custom Configuration for Data Files 📊
We’re excited to announce custom configuration for data files.
A little over two months ago we made it possible to customize the sidebar for your content files (i.e. .md and .html). With today’s update we expand that capability to data files. You can now use the sidebar settings to import other file formats (e.g. .json, .toml, .yml) and choose how they are displayed.
All new sites will have this feature enabled by default. Existing Jekyll and Hugo sites are not automatically migrating until October 16th, 2018, giving you time to make adjustments, if necessary.
Here’s a quick walkthrough on how you can set up data file sections on your site.
You can allow Forestry to migrate Data files for you or choose to make this configuration yourself.
Automatic Migration of Data Files ⭐
This option is only available for a limited time
If you had Data Files and you haven’t made the migration until now, you’ll see a link in your Sidebar.
Click on the link and Start Migration. Once Forestry finishes loading you’ll see your new Data Files section in the Sidebar.
Opt-In To Data File Sections 🔘
Before we start you might have to manually opt-in to use the new data file sections. Please go to your site’s settings and select the General tab. At the bottom of the page you’ll find the Enable Data File Sections toggle. Make sure it is enabled.
Create a Heading Section 💡
Next you can select the Sidebar tab to add new sections. We first want to add a new heading to keep our data and content files separate. To do so click on Add Section, select Heading and give the section a Label. We chose “Data Files” for this example.
Add Your First Data Files Section 📊
Adding a data files section is very similar to adding a Heading Section. After clicking on Add Section you choose Type Directory. In the following you’ll have to fill out Label, Path and New File Extension. Use the match field if you only want to use a subset of files in the directory. To learn more about the individual fields visit our docs.
Organize Your Sections 🗂️
Forestry adds new sections to the top of the list. If that’s not the correct order for your site you can simply reorganize Headings and Sections via Drag-and-Drop.
If you’re using Data Files as a source for your Select Fields you might have to make a few additional changes. See our migration guide
That’s it! You can now add as many sections as you like and you can even put content and data files under the same heading (if that makes sense for your site).
We’re excited to hear from you. Let us know if you come across any bugs or have any improvement suggestions.
Caught a mistake or want to contribute to the blog? Edit this page on Github!