Content Structure


No articles match the selected filter.

Directory Structure

When you create a Presidium site using the CLI init command, Presidium creates the directory structure for the selected template.

Sections and articles are arranged using the weight key in the front matter of each file, and to specify section level title and ordering you may use the _index.md file inside the directory containing a section.

The following is an example of how you can order and organize files and directories:

    .
    ├── article-1.md // Specify weight 1 here in front matter
    ├── Directory-2
    │   ├── article-2.1.md // Specify weight 1 here in front matter
    │   ├── article-2.2.md // Specify weight 2 here in front matter
    │   ├── _index.md // Specify weight 2 here in front matter, this will set `Directory-2` as the second item in the parent section
    ├── article-3.md // Specify weight 3 here in front matter
    ├── article-4.md // Specify weight 4 here in front matter
    └── _index.md // Specify weight 1 here in front matter

Please note that for Directory-2/_index.md file we specify weight as 2, as in this case, this weight determines the ordering for the entire section with respect of its siblings (article-1.md, article-2.md, article-3.md, article-4.md)

Using File Path Sorting

Add sortByFilePath: true under params: in the project’s config.yml to enable sorting by filepath. This will allow you to prefix your filenames and directories (not _index.md files) with a number instead of having to use weight in the front matter, for example, 01-article.md. The entry in the config file should resemble the example below:

params:
    sortByFilePath: true

Note: The main sections (for example, Reference and Overview) still have their weights set in the config.yml.


© Copyright 2022 SPAN Digital

Generated on Oct 24, 2022