Last active
August 29, 2015 14:16
-
-
Save sskylar/33eba32f124634e92368 to your computer and use it in GitHub Desktop.
Long page in Siteleaf with multiple content sections and sub-sections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>{{title}}</h1> | |
{{body}} | |
{% for section in pages %} | |
<h2 id="{{section.slug}}">{{section.title}}</h2> | |
{{section.body}} | |
{% for subsection in section.pages %} | |
<h3 id="{{subsection.slug}}">{{subsection.title}}</h3> | |
{{subsection.body}} | |
{% endfor %} | |
{% endfor %} |
Is there any way to call a specific section name? Calling sections around markup for a specific section loops that section as many times as a section appears.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this, break your sub/sections into individual pages:
This makes it easy to drag and reorder your content, plus each sub/section gets its own set of metadata and assets to use.
Using
id="{{section.slug}}"
also allows you to use anchor links (e.g.#your-slug
) to help with navigation.If you would like to have sub/sections non-accessible by permalink, you can also add the following code to redirect
/parent/section
to/parent/#section
: