just-the-docs 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +51 -11
- data/README.md +2 -2
- data/_includes/components/breadcrumbs.html +43 -15
- data/_includes/components/children_nav.html +29 -5
- data/_includes/components/search_footer.html +3 -3
- data/_includes/components/search_header.html +1 -1
- data/_includes/components/sidebar.html +6 -4
- data/_includes/nav.html +40 -185
- data/_includes/sorted_pages.html +95 -0
- data/_includes/title.html +1 -1
- data/_layouts/default.html +11 -11
- data/_layouts/minimal.html +1 -27
- data/_sass/buttons.scss +10 -0
- data/assets/js/just-the-docs.js +5 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2e014cf4175106ebeb09ccea07485a29c68bcabf1e872597de8186124eaa8ad
|
4
|
+
data.tar.gz: f9db1c8af8f096bdaf01bee9506630d604ee0dd1e608eba46175fe9e1e81ed5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1056fccd52850acd49e67725274cb7d758f1a3f06665d12bb72f1a1575d538004c4128cb703450236c719a03432152d70cce0d4286f577b96843589d358f3586
|
7
|
+
data.tar.gz: 2964ceba1a9e51f7336672ac2a831be201fce6133f171b4accd0229cb57aebcfdde7199f8d8679184ca7ed54611b479783046ee99362f82a326e0e6b85609fb3
|
data/CHANGELOG.md
CHANGED
@@ -16,7 +16,7 @@ The project underwent a major maintenance shift in March 2022.
|
|
16
16
|
This website is built from the `HEAD` of the `main` branch of the theme repository.
|
17
17
|
|
18
18
|
{: .warning }
|
19
|
-
This website includes docs for some new features that are not available in `v0.5.
|
19
|
+
This website includes docs for some new features that are not available in `v0.5.2`!
|
20
20
|
|
21
21
|
Code changes to `main` that are *not* in the latest release:
|
22
22
|
|
@@ -26,6 +26,46 @@ Docs changes in `main` that are *not* in the latest release:
|
|
26
26
|
|
27
27
|
- N/A
|
28
28
|
|
29
|
+
## Release v0.5.2
|
30
|
+
|
31
|
+
Hi all, this is a minor patch release that mostly focuses on accessibility. Since we follow semantic versioning, this should be a smooth upgrade with no breaking changes.
|
32
|
+
|
33
|
+
In addition, the theme docs website has a new canonical URL: <https://just-the-docs.com>. We've also retroactively published the theme docs website for version `v0.3.3` at <https://v0-3-3-docs.just-the-docs.com/>. Thank you to our GitHub sponsors for funding our domain name!
|
34
|
+
|
35
|
+
### Using Release `v0.5.2`
|
36
|
+
|
37
|
+
Users who have not pinned the theme version will be **automatically upgraded to `v0.5.2` the next time they build their site**.
|
38
|
+
|
39
|
+
To use this release explicitly as a remote theme:
|
40
|
+
|
41
|
+
```yml
|
42
|
+
remote_theme: just-the-docs/just-the-docs@v0.5.2
|
43
|
+
```
|
44
|
+
|
45
|
+
To use this version explicitly as a gem-based theme, pin the version in your `Gemfile` and re-run `bundle install` or `bundle update just-the-docs`:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
gem "just-the-docs", "0.5.2"
|
49
|
+
```
|
50
|
+
|
51
|
+
To use and pin a previous version of the theme, replace the `0.5.2` with the desired release tag.
|
52
|
+
|
53
|
+
### Bugfixes
|
54
|
+
|
55
|
+
- Fixed: liquid variable leakage in navigation components by [@pdmosses] in [#1243]
|
56
|
+
- Fixed: ARIA roles and labels for search, header, logo, mobile menu button, and main content by [@joelhawksley] in [#1259]
|
57
|
+
- Fixed: ARIA labels for all anchors with `href="#"`; adds `aria-pressed` information for toggles by [@mattxwang] in [#1262]
|
58
|
+
|
59
|
+
### New Contributors
|
60
|
+
|
61
|
+
- [@joelhawksley] made their first contribution in [#1259]
|
62
|
+
|
63
|
+
[@joelhawksley]: https://github.com/joelhawksley
|
64
|
+
|
65
|
+
[#1243]: https://github.com/just-the-docs/just-the-docs/pull/1243
|
66
|
+
[#1259]: https://github.com/just-the-docs/just-the-docs/pull/1259
|
67
|
+
[#1262]: https://github.com/just-the-docs/just-the-docs/pull/1262
|
68
|
+
|
29
69
|
## Release v0.5.1
|
30
70
|
|
31
71
|
Hi all, this is a very small minor patch release that has two small behavioral bugfixes: fixing a regression introduced in `v0.5.0` on Safari versions `<16.4` (broken media query), and the copy code button providing incorrect feedback in insecure browser contexts. This should be a smooth upgrade with no breaking changes.
|
@@ -87,7 +127,7 @@ As always, we'd love your feedback. [Open an issue](https://github.com/just-the-
|
|
87
127
|
|
88
128
|
**Migration**: users with a custom `setup.scss` cannot rely on variables or functions defined in `color_scheme`. This reverts to the behaviour in `v0.4.1`. Users should instead move those variables or functions to the `color_scheme` files themselves.
|
89
129
|
|
90
|
-
For more, refer to the [migration guide](https://just-the-docs.
|
130
|
+
For more, refer to the [migration guide](https://just-the-docs.com/MIGRATION/).
|
91
131
|
|
92
132
|
### Using Release `v0.5.0`
|
93
133
|
|
@@ -127,7 +167,7 @@ To use and pin a previous version of the theme, replace the `0.5.0` with the des
|
|
127
167
|
|
128
168
|
Hello! We're back again with another small release. Like `v0.4.1`, this release is a [semver patch](https://semver.org/): it only includes bugfixes, and is fully backwards-compatible.
|
129
169
|
|
130
|
-
The big highlight of this theme is fixing our light scheme code highlighting contrast issues; this was one of our most-requested features! This change is fully backwards-compatible; users can [opt-in to our old highlighting theme](https://just-the-docs.
|
170
|
+
The big highlight of this theme is fixing our light scheme code highlighting contrast issues; this was one of our most-requested features! This change is fully backwards-compatible; users can [opt-in to our old highlighting theme](https://just-the-docs.com/docs/customization/#deprecated-legacy_light) by using `legacy_light` instead of `light`.
|
131
171
|
|
132
172
|
As always, we'd love your feedback. [Open an issue](https://github.com/just-the-docs/just-the-docs/issues) or [start a discussion](https://github.com/just-the-docs/just-the-docs/discussions) for bug reports, feature requests, and any other feedback. Thanks for continuing to use Just the Docs!
|
133
173
|
|
@@ -228,16 +268,16 @@ We're so excited to release Just the Docs `v0.4.0`. This release has been almost
|
|
228
268
|
`v0.4.0` contains many new features and bugfixes. We enumerate all of them in further sections in this changelog; however, we'd like to call out some of the most-requested changes:
|
229
269
|
|
230
270
|
- better support for dark theme: dark highlighting, search input color
|
231
|
-
- [callouts](https://just-the-docs.
|
232
|
-
- [configuring mermaid.js](https://just-the-docs.
|
233
|
-
- [copy code button](https://just-the-docs.
|
234
|
-
- [external navigation links](https://just-the-docs.
|
271
|
+
- [callouts](https://just-the-docs.com/docs/ui-components/callouts/), a new design component to highlight content
|
272
|
+
- [configuring mermaid.js](https://just-the-docs.com/docs/ui-components/code/#mermaid-diagram-code-blocks), a markdown-native diagram visualization library
|
273
|
+
- [copy code button](https://just-the-docs.com/docs/ui-components/code/#copy-button) for code snippets
|
274
|
+
- [external navigation links](https://just-the-docs.com/docs/navigation-structure/#external-navigation-links)
|
235
275
|
- major improvements to nav generation efficiency and robustness
|
236
276
|
- minor improvements to built-in accessibility (SVG icons, nav titles, skip to main content)
|
237
|
-
- [modularized site components](https://just-the-docs.
|
238
|
-
- [new custom includes](https://just-the-docs.
|
277
|
+
- [modularized site components](https://just-the-docs.com/docs/customization/#custom-layouts-and-includes) (advanced feature)
|
278
|
+
- [new custom includes](https://just-the-docs.com/docs/customization/#override-includes): table of contents heading, navigation panel footer, search placeholder, lunr search indices
|
239
279
|
- bugfixes involving WEBrick and Ruby 3, Liquid processing in CSS comments, nested task lists, relative URLs, scroll navigation, corrupted search data from rake, breadcrumbs, and more!
|
240
|
-
- more documentation for [custom includes](https://just-the-docs.
|
280
|
+
- more documentation for [custom includes](https://just-the-docs.com/docs/customization/#override-includes), this changelog, and the [migration guide](https://just-the-docs.com/MIGRATION/)
|
241
281
|
|
242
282
|
*After usage instructions and the roadmap, we enumerate all changes from `v0.3.3`.*
|
243
283
|
|
@@ -270,7 +310,7 @@ remote_theme: just-the-docs/just-the-docs@v0.3.3
|
|
270
310
|
|
271
311
|
### Migration Guide and Strategies
|
272
312
|
|
273
|
-
We've developed a new [migration guide](https://just-the-docs.
|
313
|
+
We've developed a new [migration guide](https://just-the-docs.com/MIGRATION/) for users to migrate from version `v0.3.3` to `v0.4.0`. It outlines major changes in project maintenance (e.g. new repository link, team) as well as breaking changes that may break your site (and potential solutions). We suggest that all users refer to the guide before manually upgrading their site.
|
274
314
|
|
275
315
|
**For the vast majority of users, we do not anticipate that this will be a breaking change.** The major touch points are surrounding new includes, navigation (ordering, pages, and collections), the favicon, and a shift to relative URLs. However, users who heavily customize the theme (primarily by overriding includes) will likely have to make minor changes.
|
276
316
|
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
<p align="center">
|
6
6
|
<h1 align="center">Just the Docs</h1>
|
7
7
|
<p align="center">A modern, highly customizable, and responsive Jekyll theme for documentation with built-in search.<br>Easily hosted on GitHub Pages with few dependencies.</p>
|
8
|
-
<p align="center"><strong><a href="https://just-the-docs.
|
8
|
+
<p align="center"><strong><a href="https://just-the-docs.com/">See it in action!</a></strong></p>
|
9
9
|
<br><br><br>
|
10
10
|
</p>
|
11
11
|
|
@@ -102,7 +102,7 @@ The theme is available as open source under the terms of the [MIT License](http:
|
|
102
102
|
|
103
103
|
[Jekyll]: https://jekyllrb.com
|
104
104
|
[Just the Docs Template]: https://just-the-docs.github.io/just-the-docs-template/
|
105
|
-
[Just the Docs]: https://just-the-docs.
|
105
|
+
[Just the Docs]: https://just-the-docs.com
|
106
106
|
[Just the Docs repo]: https://github.com/just-the-docs/just-the-docs
|
107
107
|
[GitHub Pages]: https://pages.github.com/
|
108
108
|
[Template README]: https://github.com/just-the-docs/just-the-docs-template/blob/main/README.md
|
@@ -1,15 +1,43 @@
|
|
1
|
-
{
|
2
|
-
{
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
{%- comment -%}
|
2
|
+
Include as: {%- include components/breadcrumbs.html -%}
|
3
|
+
Depends on: page, site.
|
4
|
+
Results in: HTML for the breadcrumbs component.
|
5
|
+
Overwrites:
|
6
|
+
pages_list, parent_page, grandparent_page.
|
7
|
+
{%- endcomment -%}
|
8
|
+
|
9
|
+
{%- if page.url != "/" and page.parent -%}
|
10
|
+
|
11
|
+
{%- assign pages_list = site[page.collection]
|
12
|
+
| default: site.html_pages
|
13
|
+
| where_exp: "item", "item.title != nil"
|
14
|
+
| where_exp: "item", "item.has_children != nil" -%}
|
15
|
+
|
16
|
+
{%- if page.grand_parent -%}
|
17
|
+
{%- assign parent_page = pages_list
|
18
|
+
| where: "title", page.parent
|
19
|
+
| where: "parent", page.grand_parent
|
20
|
+
| first -%}
|
21
|
+
{%- assign grandparent_page = pages_list
|
22
|
+
| where: "title", page.grand_parent
|
23
|
+
| first -%}
|
24
|
+
{%- else -%}
|
25
|
+
{%- assign parent_page = pages_list
|
26
|
+
| where: "title", page.parent
|
27
|
+
| where_exp: "item", "item.parent == nil"
|
28
|
+
| first -%}
|
29
|
+
{%- endif -%}
|
30
|
+
|
31
|
+
<nav aria-label="Breadcrumb" class="breadcrumb-nav">
|
32
|
+
<ol class="breadcrumb-nav-list">
|
33
|
+
{% if page.parent -%}
|
34
|
+
{%- if page.grand_parent %}
|
35
|
+
<li class="breadcrumb-nav-list-item"><a href="{{ grandparent_page.url | relative_url }}">{{ page.grand_parent }}</a></li>
|
36
|
+
{%- endif %}
|
37
|
+
<li class="breadcrumb-nav-list-item"><a href="{{ parent_page.url | relative_url }}">{{ page.parent }}</a></li>
|
38
|
+
{% endif -%}
|
39
|
+
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
|
40
|
+
</ol>
|
41
|
+
</nav>
|
42
|
+
|
43
|
+
{%- endif -%}
|
@@ -1,9 +1,33 @@
|
|
1
|
+
{%- comment -%}
|
2
|
+
Include as: {%- include components/children_nav.html -%}
|
3
|
+
Depends on: page, site.
|
4
|
+
Results in: HTML for the children-navigation component.
|
5
|
+
Includes:
|
6
|
+
sorted_pages.html
|
7
|
+
toc_heading_custom.html
|
8
|
+
Overwrites:
|
9
|
+
child_pages.
|
10
|
+
{%- endcomment -%}
|
11
|
+
|
12
|
+
{%- if page.has_children == true and page.has_toc != false -%}
|
13
|
+
{%- assign child_pages = site[page.collection]
|
14
|
+
| default: site.html_pages
|
15
|
+
| where: "parent", page.title
|
16
|
+
| where: "grand_parent", page.parent -%}
|
17
|
+
|
18
|
+
{%- include sorted_pages.html pages = child_pages -%}
|
19
|
+
|
20
|
+
{%- if page.child_nav_order == 'desc' or page.child_nav_order == 'reversed' -%}
|
21
|
+
{%- assign sorted_pages = sorted_pages | reverse -%}
|
22
|
+
{%- endif -%}
|
23
|
+
{%- endif -%}
|
24
|
+
|
1
25
|
<hr>
|
2
26
|
{% include toc_heading_custom.html %}
|
3
27
|
<ul>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
28
|
+
{% for child in sorted_pages %}
|
29
|
+
<li>
|
30
|
+
<a href="{{ child.url | relative_url }}">{{ child.title }}</a>{% if child.summary %} - {{ child.summary }}{% endif %}
|
31
|
+
</li>
|
32
|
+
{% endfor %}
|
9
33
|
</ul>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{% if site.search.button %}
|
2
|
-
<
|
3
|
-
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-search"></use></svg>
|
4
|
-
</
|
2
|
+
<button id="search-button" class="search-button btn-reset" aria-label="Focus on search">
|
3
|
+
<svg viewBox="0 0 24 24" class="icon" aria-hidden="true"><use xlink:href="#svg-search"></use></svg>
|
4
|
+
</button>
|
5
5
|
{% endif %}
|
6
6
|
|
7
7
|
<div class="search-overlay"></div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{% capture search_placeholder %}{% include search_placeholder_custom.html %}{% endcapture %}
|
2
2
|
|
3
|
-
<div class="search">
|
3
|
+
<div class="search" role="search">
|
4
4
|
<div class="search-input-wrap">
|
5
5
|
<input type="text" id="search-input" class="search-input" tabindex="0" placeholder="{{ search_placeholder | strip_html | strip }}" aria-label="{{ search_placeholder | strip_html| strip }}" autocomplete="off">
|
6
6
|
<label for="search-input" class="search-label"><svg viewBox="0 0 24 24" class="search-icon"><use xlink:href="#svg-search"></use></svg></label>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<div class="side-bar">
|
2
|
-
<div class="site-header">
|
2
|
+
<div class="site-header" role="banner">
|
3
3
|
<a href="{{ '/' | relative_url }}" class="site-title lh-tight">{% include title.html %}</a>
|
4
|
-
<
|
5
|
-
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-menu"></use></svg>
|
4
|
+
<button id="menu-button" class="site-button btn-reset" aria-label="Toggle menu" aria-pressed="false">
|
5
|
+
<svg viewBox="0 0 24 24" class="icon" aria-hidden="true"><use xlink:href="#svg-menu"></use></svg>
|
6
6
|
</a>
|
7
7
|
</div>
|
8
8
|
<nav aria-label="Main" id="site-nav" class="site-nav">
|
@@ -38,7 +38,9 @@
|
|
38
38
|
<ul class="nav-list nav-category-list">
|
39
39
|
<li class="nav-list-item{% if page.collection == collection_key %} active{% endif %}">
|
40
40
|
{%- if collection.size > 0 -%}
|
41
|
-
<
|
41
|
+
<button class="nav-list-expander btn-reset" aria-label="Toggle collection {{ collection_value.name }}" aria-pressed="{% if page.collection == collection_key %}true{% else %}false{% endif %}">
|
42
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg>
|
43
|
+
</button>
|
42
44
|
{%- endif -%}
|
43
45
|
<div class="nav-category">{{ collection_value.name }}</div>
|
44
46
|
{% include nav.html pages=collection key=collection_key %}
|
data/_includes/nav.html
CHANGED
@@ -1,160 +1,54 @@
|
|
1
1
|
{%- comment -%}
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
values, and strings lexicographically. The case-sensitivity of string sorting
|
11
|
-
is determined by the configuration setting of `nav_sort`. Pages with no `title`
|
12
|
-
value are excluded from the navigation.
|
13
|
-
|
14
|
-
Note: Numbers used as `title` or `nav_order` values should not be in quotes,
|
15
|
-
unless you intend them to be lexicographically ordered. Numbers are written
|
16
|
-
without spaces or thousands-separators. Negative numbers are preceded by `-`.
|
17
|
-
Floats are written with the integral and fractional parts separated by `.`.
|
18
|
-
(Bounds on the magnitude and precision are presumably the same as in Liquid.)
|
2
|
+
Include as: {%- include nav.html pages = pages key = key -%}
|
3
|
+
Depends on: include.pages, include.key, page, site.
|
4
|
+
Results in: HTML for the navigation panel.
|
5
|
+
Includes:
|
6
|
+
sorted_pages.html
|
7
|
+
Overwrites:
|
8
|
+
nav_pages, first_level_pages, second_level_pages, third_level_pages,
|
9
|
+
node, children_list, child, grand_children_list, grand_child.
|
19
10
|
{%- endcomment -%}
|
20
11
|
|
21
|
-
{%- assign
|
22
|
-
|
23
|
-
|
24
|
-
{%- comment -%}
|
25
|
-
A page with `nav_exclude: true` does not appear in the main navigation.
|
26
|
-
If it has a `parent`, it may appear in the parent's table of contents.
|
27
|
-
If it specifies `has_children: true`, it should appear in the breadcrumbs
|
28
|
-
of the child pages, but its order in relation to other pages is irrelevant.
|
29
|
-
Pages that never appear can be removed from the pages that need to be sorted.
|
30
|
-
This optimisation can be significant on a site with many pages.
|
31
|
-
|
32
|
-
In Jekyll 4, the pages to be sorted can be filtered by:
|
33
|
-
|
34
|
-
{%- assign title_pages = title_pages
|
35
|
-
| where_exp: "item", "item.nav_exclude != true or item.parent != nil" -%}
|
36
|
-
|
37
|
-
That filter is not allowed in Jekyll 3. The following iterative code gives the
|
38
|
-
same effect, but it is activated only when it will filter more than 50% of the
|
39
|
-
pages.
|
40
|
-
{%- endcomment -%}
|
12
|
+
{%- assign nav_pages = include.pages
|
13
|
+
| where_exp: "item", "item.title != nil"
|
14
|
+
| where_exp: "item", "item.nav_exclude != true" -%}
|
41
15
|
|
42
|
-
{%-
|
43
|
-
{%- assign unsorted_pages = title_pages
|
44
|
-
| where_exp: "item", "item.parent == nil"
|
45
|
-
| where_exp: "item", "item.nav_exclude == true" -%}
|
46
|
-
{%- assign title_pages_size = title_pages.size -%}
|
47
|
-
{%- assign unsorted_pages_percent = unsorted_pages.size
|
48
|
-
| times: 100 | divided_by: title_pages_size -%}
|
49
|
-
{%- if unsorted_pages_percent > 50 -%}
|
50
|
-
{%- assign sorted_pages = "" | split: "" -%}
|
51
|
-
{%- for item in title_pages -%}
|
52
|
-
{%- if item.nav_exclude != true or item.parent -%}
|
53
|
-
{%- assign sorted_pages = sorted_pages | push: item -%}
|
54
|
-
{%- endif -%}
|
55
|
-
{%- endfor -%}
|
56
|
-
{%- assign title_pages = sorted_pages -%}
|
57
|
-
{%- endif -%}
|
58
|
-
{%- endunless -%}
|
16
|
+
{%- include sorted_pages.html pages = nav_pages -%}
|
59
17
|
|
60
|
-
{%- assign
|
61
|
-
|
62
|
-
{%- assign
|
63
|
-
|
18
|
+
{%- assign first_level_pages = sorted_pages
|
19
|
+
| where_exp: "item", "item.parent == nil" -%}
|
20
|
+
{%- assign second_level_pages = sorted_pages
|
21
|
+
| where_exp: "item", "item.parent != nil"
|
22
|
+
| where_exp: "item", "item.grand_parent == nil" -%}
|
23
|
+
{%- assign third_level_pages = sorted_pages
|
24
|
+
| where_exp: "item", "item.grand_parent != nil" -%}
|
64
25
|
|
65
26
|
{%- comment -%}
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
The first character of the result of `jsonify` is `"` only for strings.
|
70
|
-
Grouping by a single character also ensures the number of groups is small.
|
71
|
-
{%- endcomment -%}
|
72
|
-
|
73
|
-
{%- assign nav_number_pages = "" | split: "" -%}
|
74
|
-
{%- assign nav_string_pages = "" | split: "" -%}
|
75
|
-
{%- assign nav_order_groups = nav_order_pages
|
76
|
-
| group_by_exp: "item", "item.nav_order | jsonify | slice: 0" -%}
|
77
|
-
{%- for group in nav_order_groups -%}
|
78
|
-
{%- if group.name == '"' -%}
|
79
|
-
{%- assign nav_string_pages = group.items -%}
|
80
|
-
{%- else -%}
|
81
|
-
{%- assign nav_number_pages = nav_number_pages | concat: group.items -%}
|
82
|
-
{%- endif -%}
|
83
|
-
{%- endfor -%}
|
84
|
-
|
85
|
-
{%- unless nav_number_pages == empty -%}
|
86
|
-
{%- assign nav_number_pages = nav_number_pages | sort: "nav_order" -%}
|
87
|
-
{%- endunless -%}
|
88
|
-
|
89
|
-
{%- unless nav_string_pages == empty -%}
|
90
|
-
{%- if site.nav_sort == 'case_insensitive' -%}
|
91
|
-
{%- assign nav_string_pages = nav_string_pages | sort_natural: "nav_order" -%}
|
92
|
-
{%- else -%}
|
93
|
-
{%- assign nav_string_pages = nav_string_pages | sort: "nav_order" -%}
|
94
|
-
{%- endif -%}
|
95
|
-
{%- endunless -%}
|
96
|
-
|
97
|
-
{%- assign title_number_pages = "" | split: "" -%}
|
98
|
-
{%- assign title_string_pages = "" | split: "" -%}
|
99
|
-
{%- assign title_order_groups = title_order_pages
|
100
|
-
| group_by_exp: "item", "item.title | jsonify | slice: 0" -%}
|
101
|
-
{%- for group in title_order_groups -%}
|
102
|
-
{%- if group.name == '"' -%}
|
103
|
-
{%- assign title_string_pages = group.items -%}
|
104
|
-
{%- else -%}
|
105
|
-
{%- assign title_number_pages = title_number_pages | concat: group.items -%}
|
106
|
-
{%- endif -%}
|
107
|
-
{%- endfor -%}
|
108
|
-
|
109
|
-
{%- unless title_number_pages == empty -%}
|
110
|
-
{%- assign title_number_pages = title_number_pages | sort: "title" -%}
|
111
|
-
{%- endunless -%}
|
112
|
-
|
113
|
-
{%- unless title_string_pages == empty -%}
|
114
|
-
{%- if site.nav_sort == 'case_insensitive' -%}
|
115
|
-
{%- assign title_string_pages = title_string_pages | sort_natural: "title" -%}
|
116
|
-
{%- else -%}
|
117
|
-
{%- assign title_string_pages = title_string_pages | sort: "title" -%}
|
118
|
-
{%- endif -%}
|
119
|
-
{%- endunless -%}
|
120
|
-
|
121
|
-
{%- assign pages_list = nav_number_pages | concat: nav_string_pages
|
122
|
-
| concat: title_number_pages | concat: title_string_pages -%}
|
27
|
+
The order of sibling pages in `sorted_pages` determines the order of display of
|
28
|
+
links to them in lists of navigation links.
|
123
29
|
|
124
|
-
{%- assign first_level_pages = pages_list
|
125
|
-
| where_exp: "item", "item.parent == nil" -%}
|
126
|
-
{%- assign second_level_pages = pages_list
|
127
|
-
| where_exp: "item", "item.parent != nil"
|
128
|
-
| where_exp: "item", "item.grand_parent == nil" -%}
|
129
|
-
{%- assign third_level_pages = pages_list
|
130
|
-
| where_exp: "item", "item.grand_parent != nil" -%}
|
131
|
-
|
132
|
-
{%- comment -%}
|
133
|
-
The order of sibling pages in `pages_list` determines the order of display of
|
134
|
-
links to them in lists of navigation links and in auto-generated TOCs.
|
135
|
-
|
136
30
|
Note that Liquid evaluates conditions from right to left (and it does not allow
|
137
31
|
the use of parentheses). Some conditions are not so easy to express clearly...
|
138
|
-
|
32
|
+
|
139
33
|
For example, consider the following condition:
|
140
|
-
|
141
|
-
C: page.collection = = include.key and
|
142
|
-
page.url = = node.url or
|
143
|
-
page.grand_parent = = node.title or
|
144
|
-
page.parent = = node.title and
|
34
|
+
|
35
|
+
C: page.collection = = include.key and
|
36
|
+
page.url = = node.url or
|
37
|
+
page.grand_parent = = node.title or
|
38
|
+
page.parent = = node.title and
|
145
39
|
page.grand_parent = = nil
|
146
|
-
|
40
|
+
|
147
41
|
Here, `node` is a first-level page. The last part of the condition
|
148
42
|
-- namely: `page.parent = = node.title and page.grand_parent = = nil` --
|
149
43
|
is evaluated first; it holds if and only if `page` is a child of `node`.
|
150
|
-
|
151
|
-
The condition `page.grand_parent = = node.title or ...` holds when
|
44
|
+
|
45
|
+
The condition `page.grand_parent = = node.title or ...` holds when
|
152
46
|
`page` is a grandchild of node, OR `...` holds.
|
153
|
-
|
154
|
-
The condition `page.url = = node.url or ...` holds when
|
47
|
+
|
48
|
+
The condition `page.url = = node.url or ...` holds when
|
155
49
|
`page` is `node`, OR `...` holds.
|
156
|
-
|
157
|
-
The condition C: `page.collection = = include.key and ...` holds when we are
|
50
|
+
|
51
|
+
The condition C: `page.collection = = include.key and ...` holds when we are
|
158
52
|
generating the nav links for a collection that includes `page`, AND `...` holds.
|
159
53
|
{%- endcomment -%}
|
160
54
|
|
@@ -163,9 +57,9 @@
|
|
163
57
|
{%- unless node.nav_exclude -%}
|
164
58
|
<li class="nav-list-item{% if page.collection == include.key and page.url == node.url or page.grand_parent == node.title or page.parent == node.title and page.grand_parent == nil %} active{% endif %}">
|
165
59
|
{%- if node.has_children -%}
|
166
|
-
|
167
|
-
|
168
|
-
|
60
|
+
<button class="nav-list-expander btn-reset" aria-label="toggle items in {{ node.title }} category" aria-pressed="{% if page.collection == include.key and page.url == node.url or page.grand_parent == node.title or page.parent == node.title and page.grand_parent == nil %}true{% else %}false{% endif %}">
|
61
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg>
|
62
|
+
</button>
|
169
63
|
{%- endif -%}
|
170
64
|
<a href="{{ node.url | relative_url }}" class="nav-list-link{% if page.url == node.url %} active{% endif %}">{{ node.title }}</a>
|
171
65
|
{%- if node.has_children -%}
|
@@ -179,9 +73,9 @@
|
|
179
73
|
{%- unless child.nav_exclude -%}
|
180
74
|
<li class="nav-list-item {% if page.url == child.url or page.parent == child.title %} active{% endif %}">
|
181
75
|
{%- if child.has_children -%}
|
182
|
-
<
|
183
|
-
<svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg>
|
184
|
-
</
|
76
|
+
<button class="nav-list-expander btn-reset" aria-label="toggle items in {{ child.title }} category" aria-pressed="{% if page.url == child.url or page.parent == child.title %}true{% else %}false{% endif %}">
|
77
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg>
|
78
|
+
</button>
|
185
79
|
{%- endif -%}
|
186
80
|
<a href="{{ child.url | relative_url }}" class="nav-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
|
187
81
|
{%- if child.has_children -%}
|
@@ -210,42 +104,3 @@
|
|
210
104
|
{%- endunless -%}
|
211
105
|
{%- endfor -%}
|
212
106
|
</ul>
|
213
|
-
|
214
|
-
{%- comment -%}
|
215
|
-
`page.collection` is the name of the Jekyll collection that contains the page,
|
216
|
-
if any, and otherwise nil. Similarly for `include.key`.
|
217
|
-
|
218
|
-
If the current page is in the collection (if any) whose navigation is currently
|
219
|
-
being generated, the following code sets `first_level_url` to the URL used in
|
220
|
-
the page's top-level breadcrumb (if any), and `second_level_url` to that used
|
221
|
-
in the page's second-level breadcrumb (if any).
|
222
|
-
|
223
|
-
For pages with children, the code also sets `toc_list` to the list of child pages,
|
224
|
-
reversing the order if needed.
|
225
|
-
{%- endcomment -%}
|
226
|
-
|
227
|
-
{%- if page.collection == include.key -%}
|
228
|
-
{%- for node in first_level_pages -%}
|
229
|
-
{%- if page.grand_parent == node.title or page.parent == node.title and page.grand_parent == nil -%}
|
230
|
-
{%- assign first_level_url = node.url | relative_url -%}
|
231
|
-
{%- endif -%}
|
232
|
-
{%- if node.has_children -%}
|
233
|
-
{%- assign children_list = second_level_pages | where: "parent", node.title -%}
|
234
|
-
{%- for child in children_list -%}
|
235
|
-
{%- if child.has_children -%}
|
236
|
-
{%- if page.url == child.url or page.parent == child.title and page.grand_parent == child.parent -%}
|
237
|
-
{%- assign second_level_url = child.url | relative_url -%}
|
238
|
-
{%- endif -%}
|
239
|
-
{%- endif -%}
|
240
|
-
{%- endfor -%}
|
241
|
-
{%- endif -%}
|
242
|
-
{%- endfor -%}
|
243
|
-
{%- if page.has_children == true and page.has_toc != false -%}
|
244
|
-
{%- assign toc_list = pages_list
|
245
|
-
| where: "parent", page.title
|
246
|
-
| where_exp: "item", "item.grand_parent == page.parent" -%}
|
247
|
-
{%- if page.child_nav_order == 'desc' or page.child_nav_order == 'reversed' -%}
|
248
|
-
{%- assign toc_list = toc_list | reverse -%}
|
249
|
-
{%- endif -%}
|
250
|
-
{%- endif -%}
|
251
|
-
{%- endif -%}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
{%- comment -%}
|
2
|
+
Include as: {%- include sorted_pages.html pages = pages -%}
|
3
|
+
Depends on: include.pages.
|
4
|
+
Assigns to: sorted_pages.
|
5
|
+
Overwrites:
|
6
|
+
nav_order_pages, title_order_pages,
|
7
|
+
nav_number_pages, nav_string_pages, nav_order_groups, group,
|
8
|
+
title_number_pages, title_string_pages, title_order_groups.
|
9
|
+
{%- endcomment -%}
|
10
|
+
|
11
|
+
{%- comment -%}
|
12
|
+
The `nav_order` values of pages affect the order in which they are shown in
|
13
|
+
the navigation panel and in the automatically generated tables of contents.
|
14
|
+
Sibling pages with the same `nav_order` value may be shown in any order.
|
15
|
+
Sibling pages with no `nav_order` value are shown after all pages that have
|
16
|
+
explicit `nav_order` values, ordered by their `title` values.
|
17
|
+
|
18
|
+
The `nav_order` and `title` values can be numbers or strings. To avoid build
|
19
|
+
failures, we sort numbers and strings separately. We sort numbers by their
|
20
|
+
values, and strings lexicographically. The case-sensitivity of string sorting
|
21
|
+
is determined by the configuration setting of `nav_sort`. Pages with no `title`
|
22
|
+
value are excluded from the navigation.
|
23
|
+
|
24
|
+
Note: Numbers used as `title` or `nav_order` values should not be in quotes,
|
25
|
+
unless you intend them to be lexicographically ordered. Numbers are written
|
26
|
+
without spaces or thousands-separators. Negative numbers are preceded by `-`.
|
27
|
+
Floats are written with the integral and fractional parts separated by `.`.
|
28
|
+
(Bounds on the magnitude and precision are presumably the same as in Liquid.)
|
29
|
+
{%- endcomment -%}
|
30
|
+
|
31
|
+
{%- assign nav_order_pages = include.pages
|
32
|
+
| where_exp: "item", "item.nav_order != nil" -%}
|
33
|
+
{%- assign title_order_pages = include.pages
|
34
|
+
| where_exp: "item", "item.nav_order == nil" -%}
|
35
|
+
|
36
|
+
{%- comment -%}
|
37
|
+
Divide the arrays of `nav_order_pages` and `title_order_pages` according to
|
38
|
+
the type of value.
|
39
|
+
|
40
|
+
The first character of the result of `jsonify` is `"` only for strings.
|
41
|
+
Grouping by a single character also ensures the number of groups is small.
|
42
|
+
{%- endcomment -%}
|
43
|
+
|
44
|
+
{%- assign nav_number_pages = "" | split: "" -%}
|
45
|
+
{%- assign nav_string_pages = "" | split: "" -%}
|
46
|
+
{%- assign nav_order_groups = nav_order_pages
|
47
|
+
| group_by_exp: "item", "item.nav_order | jsonify | slice: 0" -%}
|
48
|
+
{%- for group in nav_order_groups -%}
|
49
|
+
{%- if group.name == '"' -%}
|
50
|
+
{%- assign nav_string_pages = group.items -%}
|
51
|
+
{%- else -%}
|
52
|
+
{%- assign nav_number_pages = nav_number_pages | concat: group.items -%}
|
53
|
+
{%- endif -%}
|
54
|
+
{%- endfor -%}
|
55
|
+
|
56
|
+
{%- unless nav_number_pages == empty -%}
|
57
|
+
{%- assign nav_number_pages = nav_number_pages | sort: "nav_order" -%}
|
58
|
+
{%- endunless -%}
|
59
|
+
|
60
|
+
{%- unless nav_string_pages == empty -%}
|
61
|
+
{%- if site.nav_sort == 'case_insensitive' -%}
|
62
|
+
{%- assign nav_string_pages = nav_string_pages | sort_natural: "nav_order" -%}
|
63
|
+
{%- else -%}
|
64
|
+
{%- assign nav_string_pages = nav_string_pages | sort: "nav_order" -%}
|
65
|
+
{%- endif -%}
|
66
|
+
{%- endunless -%}
|
67
|
+
|
68
|
+
{%- assign title_number_pages = "" | split: "" -%}
|
69
|
+
{%- assign title_string_pages = "" | split: "" -%}
|
70
|
+
{%- assign title_order_groups = title_order_pages
|
71
|
+
| group_by_exp: "item", "item.title | jsonify | slice: 0" -%}
|
72
|
+
{%- for group in title_order_groups -%}
|
73
|
+
{%- if group.name == '"' -%}
|
74
|
+
{%- assign title_string_pages = group.items -%}
|
75
|
+
{%- else -%}
|
76
|
+
{%- assign title_number_pages = title_number_pages | concat: group.items -%}
|
77
|
+
{%- endif -%}
|
78
|
+
{%- endfor -%}
|
79
|
+
|
80
|
+
{%- unless title_number_pages == empty -%}
|
81
|
+
{%- assign title_number_pages = title_number_pages | sort: "title" -%}
|
82
|
+
{%- endunless -%}
|
83
|
+
|
84
|
+
{%- unless title_string_pages == empty -%}
|
85
|
+
{%- if site.nav_sort == 'case_insensitive' -%}
|
86
|
+
{%- assign title_string_pages = title_string_pages | sort_natural: "title" -%}
|
87
|
+
{%- else -%}
|
88
|
+
{%- assign title_string_pages = title_string_pages | sort: "title" -%}
|
89
|
+
{%- endif -%}
|
90
|
+
{%- endunless -%}
|
91
|
+
|
92
|
+
{%- assign sorted_pages = nav_number_pages
|
93
|
+
| concat: nav_string_pages
|
94
|
+
| concat: title_number_pages
|
95
|
+
| concat: title_string_pages -%}
|
data/_includes/title.html
CHANGED
data/_layouts/default.html
CHANGED
@@ -14,19 +14,19 @@ layout: table_wrappers
|
|
14
14
|
{% include components/header.html %}
|
15
15
|
<div id="main-content-wrap" class="main-content-wrap">
|
16
16
|
{% include components/breadcrumbs.html %}
|
17
|
-
<div id="main-content" class="main-content"
|
18
|
-
|
19
|
-
{%
|
20
|
-
|
21
|
-
{
|
22
|
-
|
23
|
-
|
24
|
-
{% if page.has_children == true and page.has_toc != false %}
|
25
|
-
{% include components/children_nav.html toc_list=toc_list %}
|
26
|
-
{% endif %}
|
17
|
+
<div id="main-content" class="main-content">
|
18
|
+
<main>
|
19
|
+
{% if site.heading_anchors != false %}
|
20
|
+
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
|
21
|
+
{% else %}
|
22
|
+
{{ content }}
|
23
|
+
{% endif %}
|
27
24
|
|
25
|
+
{% if page.has_children == true and page.has_toc != false %}
|
26
|
+
{% include components/children_nav.html %}
|
27
|
+
{% endif %}
|
28
|
+
</main>
|
28
29
|
{% include components/footer.html %}
|
29
|
-
|
30
30
|
</div>
|
31
31
|
</div>
|
32
32
|
{% if site.search_enabled != false %}
|
data/_layouts/minimal.html
CHANGED
@@ -9,32 +9,6 @@ layout: table_wrappers
|
|
9
9
|
<body>
|
10
10
|
<a class="skip-to-main" href="#main-content">Skip to main content</a>
|
11
11
|
{% include icons/icons.html %}
|
12
|
-
{% comment %}
|
13
|
-
This is a bandaid fix to properly render breadcrumbs; as of now, there is some variable leakage between the sidebar component (which computes parents, grandparents) and the breadcrumbs component. We plan to remove this in a future release to deduplicate code.
|
14
|
-
|
15
|
-
For more context, see https://github.com/just-the-docs/just-the-docs/pull/1058#discussion_r1057014053
|
16
|
-
{% endcomment %}
|
17
|
-
{% capture nav %}
|
18
|
-
{% assign pages_top_size = site.html_pages
|
19
|
-
| where_exp:"item", "item.title != nil"
|
20
|
-
| where_exp:"item", "item.parent == nil"
|
21
|
-
| where_exp:"item", "item.nav_exclude != true"
|
22
|
-
| size %}
|
23
|
-
{% if pages_top_size > 0 %}
|
24
|
-
{% include nav.html pages=site.html_pages key=nil %}
|
25
|
-
{% endif %}
|
26
|
-
{% if site.just_the_docs.collections %}
|
27
|
-
{% assign collections_size = site.just_the_docs.collections | size %}
|
28
|
-
{% for collection_entry in site.just_the_docs.collections %}
|
29
|
-
{% assign collection_key = collection_entry[0] %}
|
30
|
-
{% assign collection_value = collection_entry[1] %}
|
31
|
-
{% assign collection = site[collection_key] %}
|
32
|
-
{% if collection_value.nav_exclude != true %}
|
33
|
-
{% include nav.html pages=collection key=collection_key %}
|
34
|
-
{% endif %}
|
35
|
-
{% endfor %}
|
36
|
-
{% endif %}
|
37
|
-
{% endcapture %}
|
38
12
|
<div id="main-content-wrap" class="main-content-wrap" id="top">
|
39
13
|
{% include components/breadcrumbs.html %}
|
40
14
|
<div id="main-content" class="main-content" role="main">
|
@@ -45,7 +19,7 @@ layout: table_wrappers
|
|
45
19
|
{% endif %}
|
46
20
|
|
47
21
|
{% if page.has_children == true and page.has_toc != false %}
|
48
|
-
{% include components/children_nav.html
|
22
|
+
{% include components/children_nav.html %}
|
49
23
|
{% endif %}
|
50
24
|
|
51
25
|
{% include components/footer.html %}
|
data/_sass/buttons.scss
CHANGED
data/assets/js/just-the-docs.js
CHANGED
@@ -31,7 +31,7 @@ function initNav() {
|
|
31
31
|
}
|
32
32
|
if (target) {
|
33
33
|
e.preventDefault();
|
34
|
-
target.parentNode.classList.toggle('active');
|
34
|
+
target.ariaPressed = target.parentNode.classList.toggle('active');
|
35
35
|
}
|
36
36
|
});
|
37
37
|
|
@@ -45,9 +45,11 @@ function initNav() {
|
|
45
45
|
if (menuButton.classList.toggle('nav-open')) {
|
46
46
|
siteNav.classList.add('nav-open');
|
47
47
|
mainHeader.classList.add('nav-open');
|
48
|
+
menuButton.ariaPressed = true;
|
48
49
|
} else {
|
49
50
|
siteNav.classList.remove('nav-open');
|
50
51
|
mainHeader.classList.remove('nav-open');
|
52
|
+
menuButton.ariaPressed = false;
|
51
53
|
}
|
52
54
|
});
|
53
55
|
|
@@ -491,8 +493,8 @@ jtd.onReady(function(){
|
|
491
493
|
if (!window.isSecureContext) {
|
492
494
|
console.log('Window does not have a secure context, therefore code clipboard copy functionality will not be available. For more details see https://web.dev/async-clipboard/#security-and-permissions');
|
493
495
|
return;
|
494
|
-
}
|
495
|
-
|
496
|
+
}
|
497
|
+
|
496
498
|
var codeBlocks = document.querySelectorAll('div.highlighter-rouge, div.listingblock > div.content, figure.highlight');
|
497
499
|
|
498
500
|
// note: the SVG svg-copied and svg-copy is only loaded as a Jekyll include if site.enable_copy_code_button is true; see _includes/icons/icons.html
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: just-the-docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Marsceill
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- _includes/nav.html
|
113
113
|
- _includes/nav_footer_custom.html
|
114
114
|
- _includes/search_placeholder_custom.html
|
115
|
+
- _includes/sorted_pages.html
|
115
116
|
- _includes/title.html
|
116
117
|
- _includes/toc_heading_custom.html
|
117
118
|
- _includes/vendor/anchor_headings.html
|
@@ -175,7 +176,7 @@ licenses:
|
|
175
176
|
metadata:
|
176
177
|
bug_tracker_uri: https://github.com/just-the-docs/just-the-docs/issues
|
177
178
|
changelog_uri: https://github.com/just-the-docs/just-the-docs/blob/main/CHANGELOG.md
|
178
|
-
documentation_uri: https://just-the-docs.
|
179
|
+
documentation_uri: https://just-the-docs.com/
|
179
180
|
source_code_uri: https://github.com/just-the-docs/just-the-docs
|
180
181
|
post_install_message:
|
181
182
|
rdoc_options: []
|