sitemap | ||
---|---|---|
|
In Forestry, the front matter of the articles determine their place in the menu. That means you can manipulate an article's location in the menu system by editing their front matter.
In the Front matter
of Forestry, you can create new front matter templates. Create a menu front matter template this way:
- Click
Add template
in the top right corner. - Add a template name (for example, new-menu-item)
- Add a
Field Group
on the right. When its settings appear, entermenu
as the label. The same will be entered automatically as the name. - In the green box on the left, click the
>
sign. - On the right, select
Field Group
again. - Enter
new-menu-item
as the label. The same will be entered automatically as the name. - In the green box on the left, click the
>
sign. - On the right, select
Text field
. - Enter
weight
as the label. The same will be entered automatically as the name. - Click
Create template
.
That's it, you are done! Alternatively, you can go to any article that has front matter applied to it, click ...
then click Create template
- Forestry will create the same template, you just need to change the relevant labels AND names - the names won't be automatically updated with the labels in this case!
Creating a new menu item in Forestry is slightly complicated. Unfortunately, we have to directly edit a .yml files in the GitHub repository.
-
Enter the data folder and open and edit
menus.yml
. -
Under main, enter the title of your new menu item, its identifier and weight.
Example:
main: - title: New menu item identifier: new-menu-item weight: 14
The weight specifies the menu item's position relative to the other menu items - enter any value you want, later you can easily change this in Forestry.
-
Add an article that has a front matter menu entry corresponding to the identifier of the menu item. It can be an empty dummy article. You can do this in Forestry by creating a new front matter template and applying that to a dummy article (see Using a front matter template) or in GitHub, manually.
Example:
title: Dummy article menu: new-menu-item: weight: 1
-
Go to Forestry and you should see your new menu item in the Menus section.
Once you have an article ready, you want to place it in the menu system so that it is visible on DevCenter. The article has to be in one of the directories on the sidebar!
There are two options:
- adding the article to a menu in the
Menus
section (recommended in most cases) - giving the article a front matter template (recommended if you are creating a new main menu item)
- Enter the
Menus
section. - Click the menu you wish to place the article in (for example, iOS Code Signing).
- Click
Add link
. - Change it to
Internal
. - From the dropdown menu, select the article.
- Enter its title as the name of the article.
- Click
Done
. - Click
Save
in the top right corner.
- Open the sidebar section where the article is located and click on the article.
- Click the
...
sign on the top right corner. - Select
Change template
. - Choose the front matter template of the menu where you wish to place the article (for example, ios-code-signing).