mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-12 21:03:32 -06:00
Fix liquid variable leakage in navigation components (#1243)
* Refactor nav, breadcrumbs, children_nav Fix #1118 Improve the modularity of building the nav-panel, breadcrumbs, and children-nav by making them independent. This also significantly simplifies the Liquid code. * Fix order of breadcrumbs * Update breadcrumbs.html Revert inclusion of single breadcrumb for top-level pages. * Update breadcrumbs.html * Update children_nav.html Revert to the previous layout in the HTML, to allow the use of `diff` to check the built site. * Update minimal.html Remove the previously required workaround involving `nav.html`. * Add docs pages about layouts The aim of the initial version of these docs pages is to illustrate the difference between the default and minimal layouts. * Update CHANGELOG.md
This commit is contained in:
40
docs/layout/layout.md
Normal file
40
docs/layout/layout.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: Layout
|
||||
layout: default
|
||||
nav_order: 4.5
|
||||
has_children: true
|
||||
---
|
||||
|
||||
# Layout
|
||||
|
||||
You specify the layout for a page in its [front matter]. Just the Docs has a `default` layout with a sidebar, used for almost all pages in the theme docs, and a `minimal` layout that omits the sidebar.
|
||||
{: .fs-6 .fw-300 }
|
||||
|
||||
## The layout concept
|
||||
|
||||
See the [Jekyll docs page about layouts] for an explanation of the general idea of layouts and how to specify them.
|
||||
|
||||
You can use [Jekyll's front matter defaults] to specify the same layout for many pages.
|
||||
|
||||
## The `default` layout
|
||||
|
||||
This page uses the default layout.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
## The `minimal` layout
|
||||
|
||||
A child and grandchild page of this page use the minimal layout. This differs from the default layout by omitting the sidebar -- and thereby also the navigation panel. To navigate between pages with the minimal layout, you can use the breadcrumbs and the tables of contents.
|
||||
|
||||
## Other layouts
|
||||
|
||||
Just the Docs has further layouts: `about`, `home`, `page`, and `post`. Currently, they are all based on the `default` layout. See the [Jekyll docs about inheritance] for how to customize them.
|
||||
|
||||
[front matter]: https://jekyllrb.com/docs/front-matter/ "Jekyll docs about front matter"
|
||||
[Jekyll docs page about layouts]: https://jekyllrb.com/docs/layouts/ "Jekyll docs about layouts"
|
||||
[Jekyll's front matter defaults]: https://jekyllrb.com/docs/configuration/front-matter-defaults/ "Jekyll docs about front matter defaults"
|
||||
[Jekyll docs about inheritance]: https://jekyllrb.com/docs/layouts/#inheritance "Jekyll docs about inheritance"
|
8
docs/layout/minimal/default-child.md
Normal file
8
docs/layout/minimal/default-child.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: Default layout child page
|
||||
layout: default
|
||||
parent: A minimal layout page
|
||||
grand_parent: Layout
|
||||
---
|
||||
|
||||
This is a child page that uses the same minimal layout as its parent page.
|
8
docs/layout/minimal/minimal-child.md
Normal file
8
docs/layout/minimal/minimal-child.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: Minimal layout child page
|
||||
layout: minimal
|
||||
parent: A minimal layout page
|
||||
grand_parent: Layout
|
||||
---
|
||||
|
||||
This is a child page that uses the same minimal layout as its parent page.
|
12
docs/layout/minimal/minimal.md
Normal file
12
docs/layout/minimal/minimal.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: A minimal layout page
|
||||
layout: minimal
|
||||
parent: Layout
|
||||
has_children: true
|
||||
---
|
||||
|
||||
# A minimal layout page
|
||||
|
||||
This page illustrates the built-in layout `minimal`.
|
||||
|
||||
One of its child pages also uses the minimal layout; the other child pages uses the default layout.
|
Reference in New Issue
Block a user