When content grows, the need to categorize it grows as well. The theme can categorize pages in the sidebar and can also list pages that belong to the same section.
A section is a collection of pages with the same type; see Page mechanics. Add pages to an overview by tagging them with a type, for example type: Example_pages, in the page metadata. If you do not want to list pages by type, you can list them manually with the custom parameter and comma-separated page_id values. The type attribute is case-sensitive, and spaces should be replaced with underscores.
Use the
type_imgattribute to specify a section/type icon as seen in the General page 2 tile.
Section tiles with information
Use this snippet:
{% include section-navigation-tiles.html type="Example_pages" supported_by=true search=true except="index.md" %}
This renders as:
Parameters
supported_by: Turn on filtering by supporter (trueorfalse).affiliations: Deprecated alias forsupported_by; it will be removed in ETT v8.0.0.type: Pagetypeto list. Use this when you want to show all pages in a section. Use eithertypeorcustom.search: Enable search in the tiles (trueorfalse).except: Comma-separated list of source file names to hide from the generated tiles, including the file extension. For example:index.md, TEMPLATE_general_page.md. Use file names, not page titles orpage_idvalues.col: Set the number of section cards per row. Default:2.sort: Disable section tile sorting by addingfalse. Default:true.custom: Comma-separated list ofpage_idvalues if you only want to show specific pages. Use eithercustomortype.
Section tiles with custom page order
Use this snippet:
{% include section-navigation-tiles.html custom="gp3, gp2" sort=false %}
This renders as:
Section tiles simple
Use this snippet:
{% include section-navigation-tiles-simple.html type="Example_pages" %}
This renders as:
Parameters
type: Pagetypeto list. Use this when you want to show all pages in a section. Use eithertypeorcustom.custom: Comma-separated list ofpage_idvalues if you only want to show specific pages. Use eithercustomortype.except: Comma-separated list of source file names to hide from the generated tiles, including the file extension. For example:index.md, TEMPLATE_general_page.md. Use file names, not page titles orpage_idvalues.col: Set the number of section cards per row. Default:2.sort: Disable section tile sorting by addingfalse. Default:true.
Simple tiles with custom page order
Use this snippet:
{% include section-navigation-tiles-simple.html custom="gp3, gp2" sort=false %}
This renders as:
A more clever way of tagging pages with a certain type
You can also set these key-value pairs for multiple pages at once in _config.yml, as described in the Jekyll documentation on front matter defaults.
Example
defaults:
-
scope:
path: "pages/data_life_cycle"
values:
type: Data_life_cycle
This will give all markdown files in the pages/data_life_cycle subdirectory the Data_life_cycle type. This will be displayed as “Data life cycle”.