Skip to content

Commit

Permalink
Docs: Allow unlimited multi-level navigation (just-the-docs#1440)
Browse files Browse the repository at this point in the history
* Remove `jekyll-default-layout` plugin

* Move docs/navigation-structure to docs/navigation

* Fix uses of line-nos in md files

* Update CHANGELOG.md

---------

Co-authored-by: Matt Wang <[email protected]>
  • Loading branch information
pdmosses and mattxwang authored Aug 20, 2024
1 parent a4e4e31 commit dd0b814
Show file tree
Hide file tree
Showing 45 changed files with 638 additions and 405 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ Code changes to `main` that are *not* in the latest release:

Docs changes made since the latest release:

- N/A
- Added: Allow unlimited multi-level navigation by [@pdmosses] in [#1440]

[#1431]: https://github.com/just-the-docs/just-the-docs/pull/1431
[#1440]: https://github.com/just-the-docs/just-the-docs/pull/1440

## Release v0.9.0

Expand Down
4 changes: 2 additions & 2 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This document contains instructions on how to migrate and upgrade Just the Docs
> and pull the changes of a new release to your clone,
> you may need to resolve merge conflicts.
[CHANGELOG]: {{ site.baseurl }}{% link CHANGELOG.md %}
[CHANGELOG]: {% link CHANGELOG.md %}

## v0.6.x - v0.7.0

Expand Down Expand Up @@ -373,7 +373,7 @@ For changes since v0.3.3, the log usually references the merged PR that made the

#### Configuration

- Mermaid support: first-class support for [Mermaid](https://mermaid.js.org/) - a JavaScript-based diagram and charting tool supported by GitHub - has been added to the theme. **This feature is opt-in.** See the new doc subsections in [Configuration]({% link docs/configuration.md %}#mermaid-diagrams) and [Code]({% link docs/ui-components/code.md %}#mermaid-diagram-code-blocks) for more.
- Mermaid support: first-class support for [Mermaid](https://mermaid.js.org/) - a JavaScript-based diagram and charting tool supported by GitHub - has been added to the theme. **This feature is opt-in.** See the new doc subsections in [Configuration]({% link docs/configuration.md %}#mermaid-diagrams) and [Code]({% link docs/ui-components/code/index.md %}#mermaid-diagram-code-blocks) for more.
- Multiple Google Analytics tags are now supported. PR: [#1029]

#### Customization
Expand Down
8 changes: 8 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ repository: just-the-docs/just-the-docs # for github-metadata

permalink: pretty

defaults:
-
scope:
path: "docs" # an empty string here means all files in the project
type: "pages"
values:
layout: "default"

exclude:
# from https://github.com/jekyll/jekyll/blob/master/lib/site_template/_config.yml:
- .sass-cache/
Expand Down
5 changes: 2 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: default
title: Configuration
nav_order: 2
---
Expand Down Expand Up @@ -87,7 +86,7 @@ mermaid:

Provide a `path` instead of a `version` key to load the mermaid library from a local file.

See [the Code documentation]({% link docs/ui-components/code.md %}#mermaid-diagram-code-blocks) for more configuration options and information.
See [the Code documentation]({% link docs/ui-components/code/index.md %}#mermaid-diagram-code-blocks) for more configuration options and information.

## Aux links

Expand Down Expand Up @@ -126,7 +125,7 @@ New (v0.4.0)
{: .label .label-green }

External links can be added to the navigation through the `nav_external_links` option.
See [Navigation Structure]({% link docs/navigation-structure.md %}#external-navigation-links) for more details.
See [Navigation Structure]({% link docs/navigation/main/external.md %}) for more details.

## Footer content

Expand Down
3 changes: 1 addition & 2 deletions docs/customization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: default
title: Customization
nav_order: 6
---
Expand Down Expand Up @@ -178,7 +177,7 @@ New (v0.4.0)

`_includes/toc_heading_custom.html`

If the page has any child pages, and `has_toc` is not set to `false`, this content appears as a heading above the [auto-generating list of child pages]({% link docs/navigation-structure.md %}#auto-generating-table-of-contents) after the page's content.
If the page has any child pages, and `has_toc` is not set to `false`, this content appears as a heading above the [auto-generating list of child pages]({% link docs/navigation/children.md %}) after the page's content.

#### Example
{: .no_toc }
Expand Down
1 change: 0 additions & 1 deletion docs/index-test.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: default
title: Markdown kitchen sink
nav_order: 99
---
Expand Down
7 changes: 3 additions & 4 deletions docs/layout/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: Layout
layout: default
nav_order: 4.5
has_children: true
---

# Layout
Expand All @@ -18,11 +17,11 @@ You can use [Jekyll's front matter defaults] to specify the same layout for many

## The `default` layout

This page uses the default layout.
This page uses the default layout. This site configures `layout: default` as a [front matter default](https://jekyllrb.com/docs/configuration/front-matter-defaults/) value for all pages in the `docs` directory.

It is a *responsive* layout: on medium and larger width displays, it displays a sidebar, including a navigation panel; on smaller width displays, the sidebar is automatically hidden under a button.
The default layout of Just the Docs is a *responsive* layout: on medium and larger width displays, it displays a sidebar, including a navigation panel; on smaller width displays, the sidebar is automatically hidden under a button.

Each child (and grandchild) page of a top-level page has so-called *breadcrumbs*: links to its parent (and grandparent) pages. It shows the breadcrumbs above the main content of the page.
All pages except top-level pages automatically have a list of so-called *breadcrumbs*: links to their parent pages and any higher-level ancestors. They show the breadcrumbs above the main content of the page.

Each page that has child pages generally has a list of links to those pages (you can suppress it by `has_toc: false` in the front matter). It shows the list as a *table of contents* below the main content.

Expand Down
1 change: 0 additions & 1 deletion docs/layout/minimal/minimal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: A minimal layout page
layout: minimal
parent: Layout
has_children: true
---

# A minimal layout page
Expand Down
Loading

0 comments on commit dd0b814

Please sign in to comment.