Combination (#578)

This PR combines (and resolves conflicts between) #448, #463, #466, #494, #495, #496, #498, and #572. 

The main aim is to facilitate use of several of the implemented features _together_, when using the fork as a remote theme. It should also simplify merging the included PRs into a future release.

The branch [combination-rec-nav](https://github.com/pdmosses/just-the-docs/tree/combination-rec-nav) adds [multi-level navigation](https://github.com/pmarsceill/just-the-docs/pull/462) and (NEW:) [sibling links](https://github.com/pmarsceill/just-the-docs/pull/394) to the branch used for this PR. It includes updated [documentation for the navigation structure](https://pdmosses.github.io/just-the-docs/docs/navigation-structure/), and reorganised and extended [navigation tests](https://pdmosses.github.io/just-the-docs/tests/navigation/). The documentation and the tests can be browsed at the (temporary) [website published from the combination-rec-nav branch](https://pdmosses.github.io/just-the-docs/).

_Caveat:_ The changes to v0.3.3 in this PR and #462 have not yet been reviewed or approved, and may need updating before merging into a release of the theme. If you use a branch from a PR as a remote theme, there is a risk of such updates affecting your website. Moreover, these branches are likely to be deleted after they have been merged. To avoid  such problems, you could copy the branch that you want to use to your own fork of the theme.

Co-authored-by: Matt Wang <matt@matthewwang.me>
This commit is contained in:
Peter Mosses
2022-07-04 21:15:10 +02:00
committed by GitHub
parent 2b4f399336
commit 70b34f01f7
96 changed files with 1137 additions and 1451 deletions

View File

@@ -5,7 +5,6 @@ nav_order: 5
---
# Navigation Structure
{: .no_toc }
<details open markdown="block">
@@ -13,7 +12,7 @@ nav_order: 5
Table of contents
</summary>
{: .text-delta }
1. TOC
- TOC
{:toc}
</details>
@@ -32,7 +31,6 @@ By default, all pages will appear as top level pages in the main nav unless a pa
To specify a page order, you can use the `nav_order` parameter in your pages' YAML front matter.
#### Example
{: .no_toc }
```yaml
@@ -59,7 +57,6 @@ By default, all Capital letters come before all lowercase letters; you can add `
For specific pages that you do not wish to include in the main navigation, e.g. a 404 page or a landing page, use the `nav_exclude: true` parameter in the YAML front matter for that page.
#### Example
{: .no_toc }
```yaml
@@ -113,7 +110,6 @@ On the parent pages, add this YAML front matter parameter:
- `has_children: true` (tells us that this is a parent page)
#### Example
{: .no_toc }
```yaml
@@ -135,7 +131,6 @@ Here we're setting up the UI Components landing page that is available at `/docs
On child pages, simply set the `parent:` YAML front matter to whatever the parent's page title is and set a nav order (this number is now scoped within the section).
#### Example
{: .no_toc }
```yaml
@@ -155,7 +150,6 @@ The Buttons page appears as a child of UI Components and appears second in the U
By default, all pages with children will automatically append a Table of Contents which lists the child pages after the parent page's content. To disable this auto Table of Contents, set `has_toc: false` in the parent page's YAML front matter.
#### Example
{: .no_toc }
```yaml
@@ -179,7 +173,6 @@ Child pages can also have children (grandchildren). This is achieved by using a
1. Add the `parent` and `grand_parent` attribute to the grandchild
#### Example
{: .no_toc }
```yaml
@@ -227,7 +220,6 @@ This would create the following navigation structure:
To add auxiliary links to your site (in the upper right on all pages), add it to the `aux_links` [configuration option]({{ site.baseurl }}{% link docs/configuration.md %}#aux-links) in your site's `_config.yml` file.
#### Example
{: .no_toc }
```yaml
@@ -244,16 +236,13 @@ aux_links:
To generate a Table of Contents on your docs pages, you can use the `{:toc}` method from Kramdown, immediately after an `<ol>` in Markdown. This will automatically generate an ordered list of anchor links to various sections of the page based on headings and heading levels. There may be occasions where you're using a heading and you don't want it to show up in the TOC, so to skip a particular heading use the `{: .no_toc }` CSS class.
#### Example
{: .no_toc }
```markdown
# Navigation Structure
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
1. TOC