Background
For blog posts, if the UseDateInPostUrl option of SiteManifest is set to true, it can be easily places in order by date. However, for pages, there's no way for ordering rule except the alphabetical one.
In addition to that, some pages are closely related to each other so that they can be grouped together.
For example, let's say there are three pages like "Quickstart", "Setup" and "Themes". Both "Quickstart" and "Setup" are related, therefore they can be grouped as "Getting Started". However, logically the "Setup" page should come first before "Quickstart", but it's not currently possible when ordering pages because there's no way to set up the order explicitly. And the "Themes" page is not relevant to those two pages. Therefore, it should not be located under the same "Getting Started" section but should be placed in its own section.
Another finding on each page is that, if the front matter provides page lins for "prev" and "next", it would be much easier for readers to follow through the page with regards to page navigation.
For example, let's say there are three pages like "GitHub Pages", "Netlify" and "Azure" under the same "Publish" group. Each page describes how to publish ScissorHands.NET app to the designated platform. It's natural for the readers on the "GitHub Pages" page to see the next page of "Netlify", for the readers on the "Netlify" page to see the prev page of "GitHub Pages" and the next page of "Azure", and for the readers on the "Azure" page to see the prev page of "Netlify". If the front matter provides prev and next attributes, then these navigation would be much easier.
Describe the Feature
- Introduce the
section attribute to group pages in the front matter (ContentMetadata) so that pages having the same section value should be grouped together. The section should be nested by setting the section value to upper-section/lower-section.
- Introduce the
prev and next attributes in the front matter (ContentMetadata) so that the pages can display the previous page and the next page dynamically.
Here's the example of the front matter for "GitHub Pages"
---
title: GitHub Pages
slug: /docs/publish/github-pages
section: Publish
next:
title: Netlify
link: /docs/publish/netlify
icon: right-arrow
---
Here's the example of the front matter for "Netlify"
---
title: Netlify
slug: /docs/publish/netlify
section: Publish
prev:
title: GitHub Pages
link: /docs/publish/github-pages
icon: left-arrow
next:
title: Azure
link: /docs/publish/azure
icon: right-arrow
---
And here's the example of the front matter for "Azure"
---
title: Azure
slug: /docs/publish/azure
section: Publish
prev:
title: Netlify
link: /docs/publish/netlify
icon: left-arrow
---
In addition to that, in the contents/pages directory, there should be pages.json file that defines the sections and pages order and hierarchy like:
Alternatives Considered
No response
Screenshots
No response
Additional Context
No response
Background
For blog posts, if the
UseDateInPostUrloption ofSiteManifestis set totrue, it can be easily places in order by date. However, for pages, there's no way for ordering rule except the alphabetical one.In addition to that, some pages are closely related to each other so that they can be grouped together.
For example, let's say there are three pages like "Quickstart", "Setup" and "Themes". Both "Quickstart" and "Setup" are related, therefore they can be grouped as "Getting Started". However, logically the "Setup" page should come first before "Quickstart", but it's not currently possible when ordering pages because there's no way to set up the order explicitly. And the "Themes" page is not relevant to those two pages. Therefore, it should not be located under the same "Getting Started" section but should be placed in its own section.
Another finding on each page is that, if the front matter provides page lins for "prev" and "next", it would be much easier for readers to follow through the page with regards to page navigation.
For example, let's say there are three pages like "GitHub Pages", "Netlify" and "Azure" under the same "Publish" group. Each page describes how to publish ScissorHands.NET app to the designated platform. It's natural for the readers on the "GitHub Pages" page to see the next page of "Netlify", for the readers on the "Netlify" page to see the prev page of "GitHub Pages" and the next page of "Azure", and for the readers on the "Azure" page to see the prev page of "Netlify". If the front matter provides
prevandnextattributes, then these navigation would be much easier.Describe the Feature
sectionattribute to group pages in the front matter (ContentMetadata) so that pages having the samesectionvalue should be grouped together. The section should be nested by setting thesectionvalue toupper-section/lower-section.prevandnextattributes in the front matter (ContentMetadata) so that the pages can display the previous page and the next page dynamically.Here's the example of the front matter for "GitHub Pages"
Here's the example of the front matter for "Netlify"
And here's the example of the front matter for "Azure"
In addition to that, in the
contents/pagesdirectory, there should bepages.jsonfile that defines the sections and pages order and hierarchy like:Alternatives Considered
No response
Screenshots
No response
Additional Context
No response