-
-
Notifications
You must be signed in to change notification settings - Fork 32
feat: add sub-section support for pages #2321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
8e3c786
28702da
5c4cbbd
afdaec0
6e5dcbd
2d394df
48174c6
8308c11
25c51e5
361b72e
36694c9
4f931bb
9831754
90bcab8
0aac27b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -196,6 +196,19 @@ All rules are detailed below, for each page type, in the priority order. | |||||||||
| 6. `list.<format>.twig` | ||||||||||
| 7. `_default/list.<format>.twig` | ||||||||||
|
|
||||||||||
| #### Sub-section lookup | ||||||||||
|
|
||||||||||
| For a sub-section (e.g. `blog/tutorials`), the layout lookup also includes the parent section layouts: | ||||||||||
|
|
||||||||||
| 1. `<section>/<subsection>/index.<format>.twig` | ||||||||||
| 2. `<section>/<subsection>/list.<format>.twig` | ||||||||||
| 3. `section/<section>/<subsection>.<format>.twig` | ||||||||||
| 4. `<section>/list.<format>.twig` _(parent section)_ | ||||||||||
| 5. `section/<section>.<format>.twig` _(parent section)_ | ||||||||||
| 6. `_default/section.<format>.twig` | ||||||||||
| 7. `list.<format>.twig` | ||||||||||
| 8. `_default/list.<format>.twig` | ||||||||||
|
|
||||||||||
| ### Type _vocabulary_ | ||||||||||
|
|
||||||||||
| 1. `taxonomy/<plural>.<format>.twig` | ||||||||||
|
|
@@ -355,6 +368,8 @@ The `page` variable contains built-in variables of a page **and** those set in t | |||||||||
| | `page.filepath` | File system path. | `Blog/Post 1.md` | | ||||||||||
| | `page.type` | `homepage`, `page`, `section`, `vocabulary` or `term`. | `page` | | ||||||||||
| | `page.pages` | Collection of all sub pages. | _Collection_ | | ||||||||||
| | `page.subsections` | Collection of child sub-sections (sections only). | _Collection_ | | ||||||||||
| | `page.parent` | Parent section (sub-sections only). | _Page_ | | ||||||||||
|
Comment on lines
+371
to
+372
|
||||||||||
| | `page.subsections` | Collection of child sub-sections (sections only). | _Collection_ | | |
| | `page.parent` | Parent section (sub-sections only). | _Page_ | | |
| | `subsections(page)` | Collection of child sub-sections (sections only). | _Collection_ | | |
| | `parent_section(page)`| Parent section (sub-sections only). | _Page_ | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addition of a "Release" section in the README does not appear to be related to the sub-sections feature. While it's useful documentation, it should ideally be in a separate PR focused on improving release documentation, not bundled with the sub-sections feature PR.