Compare commits

..

42 Commits

Author SHA1 Message Date
Matt Wang
facad4c85a 0.9.0 2024-08-12 12:23:52 -07:00
Matt Wang
3974fb87e2 Prep: 0.9.0 2024-08-12 12:21:46 -07:00
Matt Wang
060bb31a78 Apply Stylelint to vendor/ code, fix errors (#1508)
Changes are in three categories:

- whitespace
- devendoring prefixes for properties that have entered the CSS spec - reasonable to autofix
- removing a duplicate `monospace` in `monospace, monospace` `font-family` decl in normalize.scss - not autofix
2024-08-12 12:10:00 -07:00
Matt Wang
4862864318 Bump stylelint to v16, SCSS config to v13 (#1507)
Seems like this major update isn't caught by dependabot. Should be a straightforward upgrade!

Separately, going to plan on removing files from our `ignoreFiles` -- in particular, auditing our vendor files (which have some issues).
2024-08-12 11:34:37 -07:00
Bob van de Vijver
9aa1eeac3c Fix Sass mixed declarations (#1495)
As requested (https://github.com/just-the-docs/just-the-docs/issues/1493#issuecomment-2227203330), a PR to resolve the Sass deprecations. Seems to solve all deprecations I am seeing, and I am not seeing any weird changes in the resulting CSS file.

Closes #1493.

<details>
<summary>Git diff of generated CSS file</summary>


```patch
diff --git a/just-the-docs-default.css b/just-the-docs-default.css.new
index fe42b2d..50a103b 100644
--- a/just-the-docs-default.css
+++ b/just-the-docs-default.css.new
@@ -591,9 +591,11 @@ template {
 }

 html {
-  font-size: 0.875rem !important;
   scroll-behavior: smooth;
 }
+html {
+  font-size: 0.875rem !important;
+}
 @media (min-width: 31.25rem) {
   html {
     font-size: 1rem !important;
@@ -715,25 +717,50 @@ blockquote {
     min-width: 16.5rem;
   }
 }
-
 @media (min-width: 50rem) {
-  .main {
-    position: relative;
-    max-width: 50rem;
+  .side-bar + .main {
     margin-left: 15.5rem;
   }
 }
 @media (min-width: 66.5rem) {
-  .main {
+  .side-bar + .main {
     margin-left: max(16.5rem, (100% - 66.5rem) / 2 + 16.5rem);
   }
 }
+.side-bar + .main .main-header {
+  display: none;
+  background-color: #f5f6fa;
+}
+@media (min-width: 50rem) {
+  .side-bar + .main .main-header {
+    display: flex;
+    background-color: #fff;
+  }
+}
+.side-bar + .main .main-header.nav-open {
+  display: block;
+}
+@media (min-width: 50rem) {
+  .side-bar + .main .main-header.nav-open {
+    display: flex;
+  }
+}
+
+.main {
+  margin: auto;
+}
+@media (min-width: 50rem) {
+  .main {
+    position: relative;
+    max-width: 50rem;
+  }
+}

 .main-content-wrap {
-  padding-right: 1rem;
-  padding-left: 1rem;
   padding-top: 1rem;
   padding-bottom: 1rem;
+  padding-right: 1rem;
+  padding-left: 1rem;
 }
 @media (min-width: 50rem) {
   .main-content-wrap {
@@ -750,24 +777,13 @@ blockquote {

 .main-header {
   z-index: 0;
-  display: none;
-  background-color: #f5f6fa;
+  border-bottom: 1px solid #eeebee;
 }
 @media (min-width: 50rem) {
   .main-header {
     display: flex;
     justify-content: space-between;
     height: 3.75rem;
-    background-color: #fff;
-    border-bottom: 1px solid #eeebee;
-  }
-}
-.main-header.nav-open {
-  display: block;
-}
-@media (min-width: 50rem) {
-  .main-header.nav-open {
-    display: flex;
   }
 }

@@ -814,8 +830,6 @@ blockquote {
 }

 .site-title {
-  padding-right: 1rem;
-  padding-left: 1rem;
   flex-grow: 1;
   display: flex;
   height: 100%;
@@ -823,7 +837,8 @@ blockquote {
   padding-top: 0.75rem;
   padding-bottom: 0.75rem;
   color: #27262b;
-  font-size: 1.125rem !important;
+  padding-right: 1rem;
+  padding-left: 1rem;
 }
 @media (min-width: 50rem) {
   .site-title {
@@ -831,6 +846,9 @@ blockquote {
     padding-left: 2rem;
   }
 }
+.site-title {
+  font-size: 1.125rem !important;
+}
 @media (min-width: 31.25rem) {
   .site-title {
     font-size: 1.5rem !important;
@@ -877,15 +895,14 @@ body {
 }

 .site-footer {
-  padding-right: 1rem;
-  padding-left: 1rem;
   position: absolute;
   bottom: 0;
   left: 0;
   padding-top: 1rem;
   padding-bottom: 1rem;
   color: #959396;
-  font-size: 0.6875rem !important;
+  padding-right: 1rem;
+  padding-left: 1rem;
 }
 @media (min-width: 50rem) {
   .site-footer {
@@ -893,6 +910,9 @@ body {
     padding-left: 2rem;
   }
 }
+.site-footer {
+  font-size: 0.6875rem !important;
+}
 @media (min-width: 31.25rem) {
   .site-footer {
     font-size: 0.75rem !important;
@@ -948,6 +968,8 @@ body {
   color: #959396;
   content: counter(step-counter);
   counter-increment: step-counter;
+}
+.main-content ol > li::before {
   font-size: 0.75rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1150,10 +1172,12 @@ body {
   list-style: none;
 }
 .nav-list .nav-list-item {
-  font-size: 0.875rem !important;
   position: relative;
   margin: 0;
 }
+.nav-list .nav-list-item {
+  font-size: 0.875rem !important;
+}
 @media (min-width: 31.25rem) {
   .nav-list .nav-list-item {
     font-size: 1rem !important;
@@ -1246,6 +1270,8 @@ body {
   text-align: start;
   text-transform: uppercase;
   border-bottom: 1px solid #eeebee;
+}
+.nav-category {
   font-size: 0.6875rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1280,6 +1306,8 @@ body {
 .aux-nav {
   height: 100%;
   overflow-x: auto;
+}
+.aux-nav {
   font-size: 0.6875rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1320,6 +1348,8 @@ body {

 .breadcrumb-nav-list-item {
   display: table-cell;
+}
+.breadcrumb-nav-list-item {
   font-size: 0.6875rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1341,11 +1371,14 @@ body {
   content: "";
 }

+h1,
+.text-alpha {
+  font-weight: 300;
+}
 h1,
 .text-alpha {
   font-size: 2rem !important;
   line-height: 1.25;
-  font-weight: 300;
 }
 @media (min-width: 31.25rem) {
   h1,
@@ -1381,11 +1414,14 @@ h3,

 h4,
 .text-delta {
-  font-size: 0.6875rem !important;
   font-weight: 400;
   text-transform: uppercase;
   letter-spacing: 0.1em;
 }
+h4,
+.text-delta {
+  font-size: 0.6875rem !important;
+}
 @media (min-width: 31.25rem) {
   h4,
   .text-delta {
@@ -1454,9 +1490,12 @@ h6,
   text-transform: uppercase;
   vertical-align: middle;
   background-color: #2869e6;
-  font-size: 0.6875rem !important;
   border-radius: 12px;
 }
+.label:not(g),
+.label-blue:not(g) {
+  font-size: 0.6875rem !important;
+}
 @media (min-width: 31.25rem) {
   .label:not(g),
   .label-blue:not(g) {
@@ -1752,6 +1791,8 @@ h6,
   padding-left: 0;
   margin-bottom: 0.25rem;
   list-style: none;
+}
+.search-results-list {
   font-size: 0.875rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1804,6 +1845,8 @@ h6,
 }
 .search-result-doc.search-result-doc-parent {
   opacity: 0.5;
+}
+.search-result-doc.search-result-doc-parent {
   font-size: 0.75rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1844,6 +1887,8 @@ h6,
   color: #959396;
   text-overflow: ellipsis;
   white-space: nowrap;
+}
+.search-result-rel-url {
   font-size: 0.5625rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1862,6 +1907,8 @@ h6,
   word-wrap: break-word;
   border-left: 1px solid;
   border-left-color: #eeebee;
+}
+.search-result-previews {
   font-size: 0.6875rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1889,6 +1936,8 @@ h6,

 .search-no-result {
   padding: 0.5rem 0.75rem;
+}
+.search-no-result {
   font-size: 0.75rem !important;
 }
 @media (min-width: 31.25rem) {
@@ -1998,13 +2047,16 @@ table {

 th,
 td {
-  font-size: 0.75rem !important;
   min-width: 7.5rem;
   padding: 0.5rem 0.75rem;
   background-color: #fff;
   border-bottom: 1px solid rgba(238, 235, 238, 0.5);
   border-left: 1px solid #eeebee;
 }
+th,
+td {
+  font-size: 0.75rem !important;
+}
 @media (min-width: 31.25rem) {
   th,
   td {
@@ -2135,12 +2187,15 @@ figure.highlight :not(pre) > code {
 }
 .highlight .table-wrapper td,
 .highlight .table-wrapper pre {
-  font-size: 0.6875rem !important;
   min-width: 0;
   padding: 0;
   background-color: #f5f6fa;
   border: 0;
 }
+.highlight .table-wrapper td,
+.highlight .table-wrapper pre {
+  font-size: 0.6875rem !important;
+}
 @media (min-width: 31.25rem) {
   .highlight .table-wrapper td,
   .highlight .table-wrapper pre {
```
</details>
2024-08-12 11:34:20 -07:00
dependabot[bot]
3a7066ce70 Bump rexml from 3.2.8 to 3.3.3 (#1504)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.8 to 3.3.3.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.8...v3.3.3)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 17:05:21 -07:00
dependabot[bot]
f3b947d64d Bump prettier from 3.3.2 to 3.3.3 (#1494)
Bumps [prettier](https://github.com/prettier/prettier) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.2...3.3.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 19:43:34 -07:00
dependabot[bot]
da4be68cfc Bump prettier from 3.2.5 to 3.3.2 (#1482)
Bumps [prettier](https://github.com/prettier/prettier) from 3.2.5 to 3.3.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.2.5...3.3.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 11:28:16 -07:00
dependabot[bot]
6242d32e21 Bump rexml from 3.2.6 to 3.2.8 (#1476)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.6 to 3.2.8.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.6...v3.2.8)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-30 15:18:22 -07:00
Matt Wang
2dd535c2da Fix: protect search-data.json file from front matter default for layout (#1468)
Fixes #1466. Prior art: #1447. Otherwise self-explanatory.

To test:

1. First, clone [template repository](https://github.com/just-the-docs/just-the-docs-template/tree/main). Observe that search works.
2. Next, add a default layout to all files
```yml
defaults:
  - scope:
      path: ""
    values:
      layout: "default"
```
3. Observe that search no longer works.
4. Apply this patch
5. Observe that search works again!
2024-05-15 17:06:27 -07:00
dependabot[bot]
1b79df8ebb Bump nokogiri from 1.16.4 to 1.16.5 (#1474)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.4 to 1.16.5.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.4...v1.16.5)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Wang <matt@matthewwang.me>
2024-05-15 16:55:43 -07:00
dependabot[bot]
644287cf6b Bump html-proofer from 5.0.8 to 5.0.9 (#1472)
Bumps [html-proofer](https://github.com/gjtorikian/html-proofer) from 5.0.8 to 5.0.9.
- [Release notes](https://github.com/gjtorikian/html-proofer/releases)
- [Changelog](https://github.com/gjtorikian/html-proofer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gjtorikian/html-proofer/compare/v5.0.8...v5.0.9)

---
updated-dependencies:
- dependency-name: html-proofer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 16:46:15 -07:00
Matt Wang
dd4613e8b1 Fix broken link to apidock.com (#1475)
(and, makes the link text more accessible)

Previous link: https://apidock.com/ruby/DateTime/strftime
2024-05-15 16:45:30 -07:00
Kevin Lin
a251382b7a Add nav_enabled variables for more customizable and feature-complete minimal layouts (#1441)
* Add nav_enabled variables for site/layout/page-level control

* _sass: Add a space around `+` operator

* assets: Do not compile based on site.nav_enabled

* _config.yml: nav_enabled can be selectively enabled

* CHANGELOG.md: Add nav_enabled feature and docs

* docs: Prefer em dash in describing minimal layout

* docs: Add section on Selectively hiding or showing the sidebar

* _layouts: Display sidebar based on variable importance

* docs: Update documentation on the minimal layout

* docs: Document site.nav_enabled configuration variable

---------

Co-authored-by: Matt Wang <matt@matthewwang.me>
2024-04-22 15:07:29 -07:00
Matt Wang
063a130ffd Update preferred Ruby version to 3.3, update deps (#1460)
This PR essentially updates the "default" Ruby version to 3.3. In the process, it:

- fixes a bug with the linux platform for `sass-embedded`
- regenerates the `Gemfile.lock` with Bundler 2.5.9
- adds Ruby 3.3 to the testing matrix & updates our deployment actions to use Ruby 3.3
- removes Ruby 3.0 from the testing matrix, as it is now end of life

This PR is motivated by https://github.com/just-the-docs/just-the-docs-template/pull/45, where I discovered that depending on the bundler/RubyGems version, the platform resolution for platformed gems can fail.
2024-04-17 16:59:47 -07:00
dependabot[bot]
df78a847b2 Bump rake from 13.2.0 to 13.2.1 (#1453)
Bumps [rake](https://github.com/ruby/rake) from 13.2.0 to 13.2.1.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v13.2.0...v13.2.1)

---
updated-dependencies:
- dependency-name: rake
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-05 14:35:10 -07:00
dependabot[bot]
5110bf71d7 Bump rake from 13.1.0 to 13.2.0 (#1449)
Bumps [rake](https://github.com/ruby/rake) from 13.1.0 to 13.2.0.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v13.1.0...v13.2.0)

---
updated-dependencies:
- dependency-name: rake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 10:27:40 -07:00
Matt Wang
e92afffb9c 0.8.2 2024-04-01 11:26:23 -07:00
Matt Wang
e434f916ce Prep 0.8.2 2024-04-01 11:25:25 -07:00
Peter Mosses
328893dd30 Fix: Protect theme JS file from front matter default for layout (#1447)
Fix #1445

Front matter defaults with unrestricted `scope` (`path: ""`) can affect theme code files. [Jekyll](https://jekyllrb.com/docs/front-matter/#predefined-global-variables) supports using `null` to "produce a file without using a layout file".

This PR adds `layout: null` to `just-the-docs.js`, to avoid this file being affected by the following front matter defaults:

```yaml
defaults:
  -
    scope:
      path: ""
    values:
      layout: "default"
```
2024-04-01 19:59:07 +02:00
Matt Wang
7de5f7abe5 0.8.1 2024-03-06 14:53:10 -08:00
Matt Wang
930a0e0c36 Prep 0.8.1 2024-03-06 14:50:44 -08:00
Jos Ahrens
880f4dc8b0 Build docs site using strict mode and strict_filters (#1435)
Ref: https://github.com/just-the-docs/just-the-docs/pull/1434#issuecomment-1981666074
2024-03-06 14:48:00 -08:00
Jos Ahrens
15a0b6e91b Fix Liquid filter typo in breadcrumb component (strip instead of trim) (#1434)
We are running into an issue upgrading from 0.7 to 0.8, suggesting that `trim` is not a method.

```
1.963   Liquid Exception: Liquid error (/usr/gem/gems/just-the-docs-0.8.0/_includes/components/breadcrumbs.html line 59): undefined filter trim included in /_layouts/default.html
1.968 /usr/gem/gems/liquid-4.0.4/lib/liquid/strainer.rb:58:in `invoke': Liquid error (/usr/gem/gems/just-the-docs-0.8.0/_includes/components/breadcrumbs.html line 59): undefined filter trim included  (Liquid::UndefinedFilter)
```
Looking at the liquid docs, we're probably looking for `strip` and not `trim`

https://shopify.github.io/liquid/filters/strip/

https://github.com/Shopify/liquid/blob/main/History.md#300--2014-11-12, I don't see a trim so it may have been an extension? This does work normally on just-the-docs itself running from scratch, so it might also be a bug in our application (or combination of different versions in plugins).
2024-03-06 14:39:45 -08:00
Matthew Wang
5357ffad22 0.8.0 2024-02-22 22:07:18 -08:00
Matthew Wang
6fc71c108b Prep 0.8.0 2024-02-22 22:05:07 -08:00
Peter Mosses
820d256bcd Quicker build (#1397)
This PR uses the cached site-nav to determine the position of each page in the navigation hierarchy. [Profiling](https://just-the-docs.github.io/just-the-docs-tests/tests/profiles/index/) shows that it significantly reduces the v0.7.0 build time for larger sites – especially with Jekyll 3. The improvement is due mainly to the elimination of loops and filters that depended on the entire site. 

For example:

- [endoflife.date](https://just-the-docs.github.io/just-the-docs-tests/tests/profiles/endoflife.date/index/) drops from 32s to 11s
- [machinetranslate.org](https://just-the-docs.github.io/just-the-docs-tests/tests/profiles/machinetranslate.org/index/) drops from 267s to ~~73s~~ 56s

### Testing

[Just the Docs Tests](https://just-the-docs.github.io/just-the-docs-tests/) is currently built using this PR branch. With JS disabled, the highlighting and unfolding of the navigation panel should be as with v0.7.0.

A diff of the tests site built with this PR branch compared to v0.7.0 should report no significant changes. For more rigorous testing, diffs of variants of the tests site should also be inspected.
2024-02-22 21:56:52 -08:00
dependabot[bot]
b8f6f2b75c Bump prettier from 3.2.2 to 3.2.5 (#1424)
Bumps [prettier](https://github.com/prettier/prettier) from 3.2.2 to 3.2.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.2.2...3.2.5)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-21 16:00:19 -08:00
Roman KC
01719a8752 Add configurable keyboard shortcut to focus search input (#1411)
Adds a keyboard shortcut to use Ctrl/Cmd and a configurable key to focus the search input. The key is configurable with `search.focus_shortcut_key`; enables it on the core docs site with `'k'` (default on many sites).

---------
Co-authored-by: Matt Wang <mxw@cs.washington.edu>
2024-02-21 20:43:45 +00:00
dependabot[bot]
52b4b444d0 Bump nokogiri from 1.15.4 to 1.16.2 (#1425)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.15.4 to 1.16.2.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.15.4...v1.16.2)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 02:21:58 -08:00
Peter Mosses
742281635f Fix navigation when .html omitted (#1374)
* Prefer exact match of pathname
* Update CHANGELOG.md
2024-01-25 18:02:39 +01:00
dependabot[bot]
e96bf6ae3d Bump prettier from 3.1.1 to 3.2.2 (#1415)
Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.1...3.2.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 14:05:09 -08:00
Matt Wang
da38718d7a Fix incorrect positioning of clickable area for navigation links on Safari (#1403)
Closes #1392.

Unfortunately, this PR has not actually diagnosed the root problem with the `scrollBy` calculation/method and Safari. However, by using the [`scrollIntoView`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) function (which essentially does what the calculation was meant to do), this problem is "magically" solved! As a side effect, I think this makes the code easier to maintain (I myself was thinking: why is there a magic `3` multiplier?). 

~~I will point out that this does change *how much is scrolled*; following the spec for the method, the sidebar is now scrolled so that the active navigation link is top-aligned with the scroll container (which in this case, is the navigation sidebar's "cutoff"). I personally am fine with this change, but happy to fiddle around (e.g. we could vertically align to the `center` via [`scrollIntoViewOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView#parameters), though I'm not sure if this causes compatability problems).~~

I will point out that this does change *how much is scrolled*; we are now using the `center` option to `scrollBy`, which centers the target link. As Peter has commented in the PR thread, this seems to be the best compromise for maintaining the spirit of the previous calculation.

### testing

Peter did a great job writing a reproducible bug report in #1392. To test this, 

1. first, follow the instructions verbatim on `main`. observe that the bug appears on Safari on macOS, but not Firefox and Chrome
2. then, apply this change (e.g. check out the branch)
3. next, replay the instructions - observing that
    1. the bug is fixed on Safari
    2. there is no change to the behaviour on Firefox and Chrome (other than the "start" of the scroll")

### compatability

On [Can I use](https://caniuse.com/scrollintoview), `scrollIntoView` has 98.15% adoption (the only "major" holdout being Opera Mini); and, the partial support from IE is about an option that we don't use. So, I'm pretty confident that we should be able to roll out this change without our users being locked out by a new-ish method.
2024-01-01 14:19:24 -08:00
dependabot[bot]
0352428017 Bump jekyll-github-metadata from 2.16.0 to 2.16.1 (#1407)
Bumps [jekyll-github-metadata](https://github.com/jekyll/github-metadata) from 2.16.0 to 2.16.1.
- [Release notes](https://github.com/jekyll/github-metadata/releases)
- [Changelog](https://github.com/jekyll/github-metadata/blob/main/History.markdown)
- [Commits](https://github.com/jekyll/github-metadata/compare/v2.16.0...v2.16.1)

---
updated-dependencies:
- dependency-name: jekyll-github-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-29 15:09:56 -08:00
dependabot[bot]
69583cb94c Bump jekyll from 4.3.2 to 4.3.3 (#1406)
Bumps [jekyll](https://github.com/jekyll/jekyll) from 4.3.2 to 4.3.3.
- [Release notes](https://github.com/jekyll/jekyll/releases)
- [Changelog](https://github.com/jekyll/jekyll/blob/master/History.markdown)
- [Commits](https://github.com/jekyll/jekyll/compare/v4.3.2...v4.3.3)

---
updated-dependencies:
- dependency-name: jekyll
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-28 14:24:01 -08:00
Matthew
b12ed38e7b Update CHANGELOG 2023-12-18 10:00:50 -08:00
Mitch Nemirovsky
8f0bcd6875 Add documentation to "Navigation Structure" on collections and grouping pages (#1390)
Added link and short blurb about document collections to the navigation structure page, for quicker reference and suggestion during reading documentation.

Allows easier reference when trying to create page groups / categories without using a blank Parent page. Avoids automatically folded Parent page when Child pages are the necessary ones.
2023-12-18 09:58:09 -08:00
dependabot[bot]
d8a23a0b26 Bump prettier from 3.1.0 to 3.1.1 (#1402)
Bumps [prettier](https://github.com/prettier/prettier) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.0...3.1.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 23:03:43 -08:00
Matt Wang
fd689b47e0 docs: fix misleading docs on code with line numbers (#1349)
Closes #1306.

Co-authored-by: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
2023-11-15 11:45:14 -08:00
dependabot[bot]
4e7f8345b4 Bump prettier from 3.0.3 to 3.1.0 (#1393)
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 10:23:11 -08:00
dependabot[bot]
a9a336f1b0 Bump stylelint-config-standard-scss from 11.0.0 to 11.1.0 (#1386)
Bumps [stylelint-config-standard-scss](https://github.com/stylelint-scss/stylelint-config-standard-scss) from 11.0.0 to 11.1.0.
- [Release notes](https://github.com/stylelint-scss/stylelint-config-standard-scss/releases)
- [Changelog](https://github.com/stylelint-scss/stylelint-config-standard-scss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint-scss/stylelint-config-standard-scss/compare/v11.0.0...v11.1.0)

---
updated-dependencies:
- dependency-name: stylelint-config-standard-scss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-03 16:00:56 -07:00
dependabot[bot]
1c27df3de6 Bump rake from 13.0.6 to 13.1.0 (#1385)
Bumps [rake](https://github.com/ruby/rake) from 13.0.6 to 13.1.0.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v13.0.6...v13.1.0)

---
updated-dependencies:
- dependency-name: rake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 22:41:07 -07:00
37 changed files with 1460 additions and 1701 deletions

View File

@@ -16,7 +16,7 @@ jobs:
matrix: matrix:
jekyll-version: [3.9, 4.3] jekyll-version: [3.9, 4.3]
os: [ ubuntu-latest, macos-latest, windows-latest ] os: [ ubuntu-latest, macos-latest, windows-latest ]
ruby-version: ["3.0", "3.1", "3.2"] ruby-version: ["3.1", "3.2", "3.3"]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@@ -34,7 +34,7 @@ jobs:
- name: Setup Ruby - name: Setup Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: "3.2" ruby-version: "3.3"
bundler-cache: true # runs 'bundle install' and caches installed gems automatically bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages - name: Setup Pages

View File

@@ -10,10 +10,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Ruby 3.2 - name: Setup Ruby 3.3
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: "3.2" ruby-version: "3.3"
- name: Publish to GPR - name: Publish to GPR
run: | run: |

View File

@@ -19,6 +19,141 @@ Code changes to `main` that are *not* in the latest release:
- N/A - N/A
Docs changes made since the latest release:
- N/A
## Release v0.9.0
Hi folks! This minor release adds a `nav_enabled` set of variables to enable/disable the navigation at a site, layout, and page level --- and uses that to add search and auxilary links to the `minimal` layout. In addition, it fixes `search-data.json` corruption with default layouts and some minor CSS/SCSS issues.
This release should be a straightforward upgrade for all users of Just the Docs. Thank you for your continued support!
### Using Release `v0.9.0`
Users who have not pinned the theme version will be **automatically upgraded to `v0.8.0` the next time they build their site**.
To use this release explicitly as a remote theme:
```yml
remote_theme: just-the-docs/just-the-docs@v0.9.0
```
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`:
```ruby
gem "just-the-docs", "0.9.0"
```
To use and pin a previous version of the theme, replace the `0.9.0` with the desired release tag.
### New Features
- Added: `nav_enabled` site, layout, and page-level variable to selectively show or hide the side/mobile menu by [@kevinlin1] in [#1441]
- Added: site-wide search bar and auxiliary links to the `minimal` layout by [@kevinlin1] in [#1441]
### Bugfixes
- Fixed: protect `search-data.json` file from front matter default for layout by [@mattxwang] in [#1468]
- Fixed: Sass mixed declarations by [@bobvandevijver] in [#1495]
- Fixed: redundant `monospace` in `pre`, `code`, `kbd`, `samp` reset by [@mattxwang] in [#1508]
### Documentation
- Docs: Explained the `nav_enabled` variables as an alternative to using the minimal layout [@kevinlin1] in [#1441].
### New Contributors
- [@bobvandevijver] made their first contribution in [#1495]
[@bobvandevijver]: https://github.com/bobvandevijver
[#1441]: https://github.com/just-the-docs/just-the-docs/pull/1441
[#1468]: https://github.com/just-the-docs/just-the-docs/pull/1468
[#1495]: https://github.com/just-the-docs/just-the-docs/pull/1495
[#1508]: https://github.com/just-the-docs/just-the-docs/pull/1508
## Release v0.8.2
Hi everyone! This patch release fixes a bug where a default layout with unrestricted `scope` (`path: ""`) breaks JavaScript functionality. Users who do not use a default layout with unrestricted `scope` should not be affected. This should be a straightforward upgrade for all users. Thank you to [@pdmosses] for triaging and fixing the bug!
### Bugfixes
- Fixed: Protect theme JS file from front matter default for layout by [@pdmosses] in [#1447]
[#1447]: https://github.com/just-the-docs/just-the-docs/pull/1447
## Release v0.8.1
Hi folks! This patch release fixes a bug introduced in `0.8.0` that affects users who build their sites in strict mode. It is a straightforward upgrade that should require no manual migration changes. Thank you to [@Zarthus] for quickly catching and fixing this bug!
### Bugfixes
- Fixed: Liquid filter typo in breadcrumb component (`strip` instead of `trim`) by [@Zarthus] in [#1434]
### Documentation
- Build docs site using strict mode and `strict_filters` by [@Zarthus] in [#1435]
### New Contributors
- [@Zarthus] made their first contribution in [#1434]
[@Zarthus]: https://github.com/Zarthus
[#1434]: https://github.com/just-the-docs/just-the-docs/pull/1434
[#1435]: https://github.com/just-the-docs/just-the-docs/pull/1435
## Release v0.8.0
Hi folks! This first minor release of 2024 has a short number of changes: a large improvement of build times for large sites, a new keyboard shortcut to focus the search bar, and sidebar navigation bugfixes for "pretty" URLs (with `.html` omitted) and the clickable area on Safari. This release has no explicit breaking changes and should be a straightforward upgrade for most (if not all) users.
### Using Release `v0.8.0`
Users who have not pinned the theme version will be **automatically upgraded to `v0.8.0` the next time they build their site**.
To use this release explicitly as a remote theme:
```yml
remote_theme: just-the-docs/just-the-docs@v0.8.0
```
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`:
```ruby
gem "just-the-docs", "0.8.0"
```
To use and pin a previous version of the theme, replace the `0.8.0` with the desired release tag.
### New Features
- Added: configurable keyboard shortcut to focus search input by [@kcromanpl-bajra] in [#1411]
### Bugfixes
- Fixed: quicker build by [@pdmosses] in [#1397]
- Fixed: incorrect navigation when `.html` omitted from URL by [@pdmosses] in [#1374]
- Fixed: incorrect positioning of clickable area for navigation links on Safari by [@mattxwang] in [#1403]
### Documentation
- Add documentation to "Navigation Structure" on grouping pages with collections by [@mitchnemirov] in [#1390]
### New Contributors
- [@mitchnemirov] made their first contribution in [#1390]
- [@kcromanpl-bajra] made their first contribution in [#1411]
[@mitchnemirov]: https://github.com/mitchnemirov
[@kcromanpl-bajra]: https://github.com/kcromanpl-bajra
[#1374]: https://github.com/just-the-docs/just-the-docs/pull/1374
[#1390]: https://github.com/just-the-docs/just-the-docs/pull/1390
[#1397]: https://github.com/just-the-docs/just-the-docs/pull/1397
[#1403]: https://github.com/just-the-docs/just-the-docs/pull/1403
[#1411]: https://github.com/just-the-docs/just-the-docs/pull/1411
## Release v0.7.0 ## Release v0.7.0
Hi folks! This is a minor release that adds a new configuration option for opening external links in a new tab and provides many bugfixes (in both correctness and performance) for Just the Docs users with large sites. We anticipate that for most users, this is a straightforward upgrade. However, it introduces some potentially-breaking *internal* changes to undocumented features of the theme. Hi folks! This is a minor release that adds a new configuration option for opening external links in a new tab and provides many bugfixes (in both correctness and performance) for Just the Docs users with large sites. We anticipate that for most users, this is a straightforward upgrade. However, it introduces some potentially-breaking *internal* changes to undocumented features of the theme.

View File

@@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
just-the-docs (0.7.0) just-the-docs (0.9.0)
jekyll (>= 3.8.5) jekyll (>= 3.8.5)
jekyll-include-cache jekyll-include-cache
jekyll-seo-tag (>= 2.0) jekyll-seo-tag (>= 2.0)
@@ -11,37 +11,43 @@ GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
Ascii85 (1.1.0) Ascii85 (1.1.0)
addressable (2.8.4) addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0) public_suffix (>= 2.0.2, < 6.0)
afm (0.2.2) afm (0.2.2)
async (2.6.3) async (2.11.0)
console (~> 1.10) console (~> 1.25, >= 1.25.2)
fiber-annotation fiber-annotation
io-event (~> 1.1) io-event (~> 1.5, >= 1.5.1)
timers (~> 4.1) timers (~> 4.1)
bigdecimal (3.1.8)
colorator (1.1.0) colorator (1.1.0)
concurrent-ruby (1.2.2) concurrent-ruby (1.2.3)
console (1.23.2) console (1.25.2)
fiber-annotation fiber-annotation
fiber-local fiber-local (~> 1.1)
json
em-websocket (0.5.3) em-websocket (0.5.3)
eventmachine (>= 0.12.9) eventmachine (>= 0.12.9)
http_parser.rb (~> 0) http_parser.rb (~> 0)
ethon (0.16.0) ethon (0.16.0)
ffi (>= 1.15.0) ffi (>= 1.15.0)
eventmachine (1.2.7) eventmachine (1.2.7)
faraday (2.7.10) faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.1) faraday-net_http (>= 2.0, < 3.2)
ruby2_keywords (>= 0.0.4) faraday-net_http (3.1.0)
faraday-net_http (3.0.2) net-http
ffi (1.15.5) ffi (1.16.3)
fiber-annotation (0.2.0) fiber-annotation (0.2.0)
fiber-local (1.0.0) fiber-local (1.1.0)
fiber-storage
fiber-storage (0.1.0)
forwardable-extended (2.6.0) forwardable-extended (2.6.0)
google-protobuf (3.23.4-arm64-darwin) google-protobuf (4.26.1-arm64-darwin)
google-protobuf (3.23.4-x86_64-linux) rake (>= 13)
google-protobuf (4.26.1-x86_64-linux)
rake (>= 13)
hashery (2.1.2) hashery (2.1.2)
html-proofer (5.0.8) html-proofer (5.0.9)
addressable (~> 2.3) addressable (~> 2.3)
async (~> 2.1) async (~> 2.1)
nokogiri (~> 1.13) nokogiri (~> 1.13)
@@ -51,10 +57,10 @@ GEM
yell (~> 2.0) yell (~> 2.0)
zeitwerk (~> 2.5) zeitwerk (~> 2.5)
http_parser.rb (0.8.0) http_parser.rb (0.8.0)
i18n (1.14.1) i18n (1.14.4)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
io-event (1.2.3) io-event (1.5.1)
jekyll (4.3.2) jekyll (4.3.3)
addressable (~> 2.4) addressable (~> 2.4)
colorator (~> 1.0) colorator (~> 1.0)
em-websocket (~> 0.5) em-websocket (~> 0.5)
@@ -70,7 +76,7 @@ GEM
safe_yaml (~> 1.0) safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0) terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7) webrick (~> 1.7)
jekyll-github-metadata (2.16.0) jekyll-github-metadata (2.16.1)
jekyll (>= 3.4, < 5.0) jekyll (>= 3.4, < 5.0)
octokit (>= 4, < 7, != 4.4.0) octokit (>= 4, < 7, != 4.4.0)
jekyll-include-cache (0.2.1) jekyll-include-cache (0.2.1)
@@ -81,63 +87,69 @@ GEM
jekyll (>= 3.8, < 5.0) jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1) jekyll-watch (2.2.1)
listen (~> 3.0) listen (~> 3.0)
json (2.7.2)
kramdown (2.4.0) kramdown (2.4.0)
rexml rexml
kramdown-parser-gfm (1.1.0) kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0) kramdown (~> 2.0)
liquid (4.0.4) liquid (4.0.4)
listen (3.8.0) listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0) mercenary (0.4.0)
nokogiri (1.15.4-arm64-darwin) net-http (0.4.1)
uri
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux) nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4) racc (~> 1.4)
octokit (6.1.1) octokit (6.1.1)
faraday (>= 1, < 3) faraday (>= 1, < 3)
sawyer (~> 0.9) sawyer (~> 0.9)
pathutil (0.16.2) pathutil (0.16.2)
forwardable-extended (~> 2.6) forwardable-extended (~> 2.6)
pdf-reader (2.11.0) pdf-reader (2.12.0)
Ascii85 (~> 1.0) Ascii85 (~> 1.0)
afm (~> 0.2.1) afm (~> 0.2.1)
hashery (~> 2.0) hashery (~> 2.0)
ruby-rc4 ruby-rc4
ttfunk ttfunk
public_suffix (5.0.3) public_suffix (5.0.5)
racc (1.7.1) racc (1.7.3)
rainbow (3.1.1) rainbow (3.1.1)
rake (13.0.6) rake (13.2.1)
rb-fsevent (0.11.2) rb-fsevent (0.11.2)
rb-inotify (0.10.1) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
rexml (3.2.6) rexml (3.3.3)
rouge (4.1.2) strscan
rouge (4.2.1)
ruby-rc4 (0.1.5) ruby-rc4 (0.1.5)
ruby2_keywords (0.0.5)
safe_yaml (1.0.5) safe_yaml (1.0.5)
sass-embedded (1.64.1-arm64-darwin) sass-embedded (1.75.0-arm64-darwin)
google-protobuf (~> 3.23) google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.64.1-x86_64-linux-gnu) sass-embedded (1.75.0-x86_64-linux-gnu)
google-protobuf (~> 3.23) google-protobuf (>= 3.25, < 5.0)
sawyer (0.9.2) sawyer (0.9.2)
addressable (>= 2.3.5) addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3) faraday (>= 0.17.3, < 3)
strscan (3.1.0)
terminal-table (3.0.2) terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3) unicode-display_width (>= 1.1.1, < 3)
timers (4.3.5) timers (4.3.5)
ttfunk (1.7.0) ttfunk (1.8.0)
typhoeus (1.4.0) bigdecimal (~> 3.1)
typhoeus (1.4.1)
ethon (>= 0.9.0) ethon (>= 0.9.0)
unicode-display_width (2.4.2) unicode-display_width (2.5.0)
uri (0.13.0)
webrick (1.8.1) webrick (1.8.1)
yell (2.2.2) yell (2.2.2)
zeitwerk (2.6.11) zeitwerk (2.6.13)
PLATFORMS PLATFORMS
arm64-darwin arm64-darwin
x86_64-linux x86_64-linux-gnu
DEPENDENCIES DEPENDENCIES
bundler (>= 2.3.5) bundler (>= 2.3.5)
@@ -147,4 +159,4 @@ DEPENDENCIES
just-the-docs! just-the-docs!
BUNDLED WITH BUNDLED WITH
2.4.13 2.5.9

View File

@@ -78,6 +78,8 @@ search:
# Enable or disable the search button that appears in the bottom right corner of every page # Enable or disable the search button that appears in the bottom right corner of every page
# Supports true or false (default) # Supports true or false (default)
button: false button: false
# Focus the search input by pressing `ctrl + focus_shortcut_key` (or `cmd + focus_shortcut_key` on macOS)
focus_shortcut_key: 'k'
# For copy button on code # For copy button on code
enable_copy_code_button: true enable_copy_code_button: true
@@ -107,6 +109,10 @@ aux_links:
# Makes Aux links open in a new tab. Default is false # Makes Aux links open in a new tab. Default is false
aux_links_new_tab: false aux_links_new_tab: false
# Enable or disable the side/mobile menu globally
# Nav menu can also be selectively enabled or disabled using page variables or the minimal layout
nav_enabled: true
# Sort order for navigation links # Sort order for navigation links
# nav_sort: case_insensitive # default, equivalent to nil # nav_sort: case_insensitive # default, equivalent to nil
nav_sort: case_sensitive # Capital letters sorted before lowercase nav_sort: case_sensitive # Capital letters sorted before lowercase
@@ -116,6 +122,10 @@ nav_external_links:
- title: Just the Docs on GitHub - title: Just the Docs on GitHub
url: https://github.com/just-the-docs/just-the-docs url: https://github.com/just-the-docs/just-the-docs
liquid:
error_mode: strict
strict_filters: true
# Footer content # Footer content
# appears at the bottom of every page's main content # appears at the bottom of every page's main content

View File

@@ -8,6 +8,89 @@
{%- if page.url != "/" and page.parent -%} {%- if page.url != "/" and page.parent -%}
{%- capture nav_list_link -%}
<a href="{{ page.url | relative_url }}" class="nav-list-link">
{%- endcapture -%}
{%- capture site_nav -%}
{%- include_cached components/site_nav.html -%}
{%- endcapture -%}
{%- if site_nav contains nav_list_link -%}
{%- capture nav_list_simple -%}
<ul class="nav-list">
{%- endcapture -%}
{%- capture nav_list_link_class %} class="nav-list-link">
{%- endcapture -%}
{%- capture nav_category -%}
<div class="nav-category">
{%- endcapture -%}
{%- assign nav_anchor_splits =
site_nav | split: nav_list_link |
first | split: nav_category |
last | split: "</a>" -%}
{%- comment -%}
The ordinary pages (if any) and the collections pages (if any) are separated by
occurrences of nav_category.
Any ancestor nav-links of the page are contained in the last group of pages,
immediately preceding nav-lists. After splitting at "</a>", the anchor that
was split is a potential ancestor link when the following split starts with
a nav-list.
The array nav_breadcrumbs is the stack of current potential ancestors of the
current page. A split that contains one or more "</ul>"s requires that number
of potential ancestors to be popped from the stack.
The number of occurrences of a string in nav_split_next is computed by removing
them all, then dividing the resulting size difference by the length of the string.
{%- endcomment %}
{%- assign nav_breadcrumbs = "" | split: "" -%}
{%- for nav_split in nav_anchor_splits -%}
{%- unless forloop.last -%}
{%- assign nav_split_next = nav_anchor_splits[forloop.index] | strip -%}
{%- assign nav_split_test =
nav_split_next | remove_first: nav_list_simple | prepend: nav_list_simple -%}
{%- if nav_split_test == nav_split_next -%}
{%- assign nav_breadcrumb_link =
nav_split | split: "<a " | last | prepend: "<a " |
replace: nav_list_link_class, ">" | append: "</a>" -%}
{%- assign nav_breadcrumbs = nav_breadcrumbs | push: nav_breadcrumb_link -%}
{%- endif -%}
{%- if nav_split_next contains "</ul>" -%}
{%- assign nav_list_end_less = nav_split_next | remove: "</ul>" -%}
{%- assign nav_list_end_count =
nav_split_next.size | minus: nav_list_end_less.size | divided_by: 5 -%}
{% for nav_end_index in (1..nav_list_end_count) %}
{%- assign nav_breadcrumbs = nav_breadcrumbs | pop -%}
{%- endfor -%}
{%- endif -%}
{%- endunless -%}
{%- endfor -%}
{%- assign nav_parent_link = nav_breadcrumbs[-1] -%}
{%- assign nav_grandparent_link = nav_breadcrumbs[-2] -%}
{%- else -%}
{%- comment -%}
Pages whose links are excluded from the main navigation may still have
breadcrumbs. Determining them appears to require inspecting the front matter
of all the pages in the same group. For sites with 100s of pages, this is too
inefficient in Jekyll 3 (also when the for-loop is replaced by where-filters).
{%- endcomment -%}
{%- assign pages_list = site[page.collection] | default: site.html_pages -%} {%- assign pages_list = site[page.collection] | default: site.html_pages -%}
{%- assign parent_page = nil -%} {%- assign parent_page = nil -%}
@@ -36,14 +119,24 @@
{%- endfor -%} {%- endfor -%}
{%- capture nav_parent_link -%}
<a href="{{ parent_page.url | relative_url }}">{{ page.parent }}</a>
{%- endcapture -%}
{%- if page.grand_parent %}
{%- capture nav_grandparent_link -%}
<a href="{{ grandparent_page.url | relative_url }}">{{ page.grand_parent }}</a>
{%- endcapture -%}
{%- endif -%}
{%- endif -%}
<nav aria-label="Breadcrumb" class="breadcrumb-nav"> <nav aria-label="Breadcrumb" class="breadcrumb-nav">
<ol class="breadcrumb-nav-list"> <ol class="breadcrumb-nav-list">
{% if page.parent -%} {%- if nav_grandparent_link %}
{%- if page.grand_parent %} <li class="breadcrumb-nav-list-item">{{ nav_grandparent_link }}</li>
<li class="breadcrumb-nav-list-item"><a href="{{ grandparent_page.url | relative_url }}">{{ page.grand_parent }}</a></li>
{%- endif %} {%- endif %}
<li class="breadcrumb-nav-list-item"><a href="{{ parent_page.url | relative_url }}">{{ page.parent }}</a></li> <li class="breadcrumb-nav-list-item">{{ nav_parent_link }}</li>
{% endif -%}
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li> <li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
</ol> </ol>
</nav> </nav>

View File

@@ -1,19 +1,17 @@
{%- comment -%} {%- comment -%}
Include as: {%- include css/activation.scss.liquid -%} Include as: {%- include css/activation.scss.liquid -%}
Depends on: page, site. Depends on: page.
Results in: page-dependent (non-nested) CSS rules for inclusion in a head style element, Results in: page-dependent CSS rules for inclusion in a style element,
which needs to be suppressed when JS is enabled. which needs to be disabled when JS is enabled.
Includes: Includes: components/site_nav.html.
sorted_pages.html.
Overwrites: Overwrites:
activation_no_nav_link, activation_pages, activation_pages_top_size, activation_page, activation_title, activation_no_nav_link, nav_list_link, site_nav,
activation_first_level, activation_second_level, activation_third_level, nav_list, nav_list_end, nav_list_item, nav_category_list,
activation_first_level_reversed, activation_second_level_reversed, nav_list_link_prefix, nav_splits, nav_split, nav_levels,
activation_first_level_index, activation_second_level_index, activation_third_level_index, nav_list_less, nav_list_count, nav_end_less, nav_end_count,
activation_index, activation_collection_prefix, activation_other_collection_prefix. nav_index, nav_slice_size,
activation_collection_prefix, activation_other_collection_prefix.
Should not be cached, because it depends on page. Should not be cached, because it depends on page.
(For a site with only top-level pages, the rendering of this file is always empty.
This property could be detected, and used to reduce the build time for such sites.)
{%- endcomment -%} {%- endcomment -%}
{%- comment -%} {%- comment -%}
@@ -37,89 +35,163 @@
{%- endif %} {%- endif %}
{% endcapture -%} {% endcapture -%}
{%- if page.title == nil or page.nav_exclude == true -%} {%- capture nav_list_link -%}
<a href="{{ page.url | relative_url }}" class="nav-list-link">
{%- endcapture -%}
{{ activation_no_nav_link }} {%- capture site_nav -%}
{%- include_cached components/site_nav.html -%}
{%- endcapture -%}
{%- else -%} {%- if site_nav contains nav_list_link -%}
{%- assign activation_pages = site[page.collection] {%- capture nav_list -%}
| default: site.html_pages <ul class="nav-list
| where_exp: "item", "item.title != nil" {%- endcapture -%}
| where_exp: "item", "item.nav_exclude != true" -%}
{%- assign activation_first_level_index = nil -%} {%- assign nav_list_end = "</ul>" -%}
{%- assign activation_second_level_index = nil -%}
{%- assign activation_third_level_index = nil -%} {%- capture nav_list_item -%}
{%- assign activation_first_level_reversed = nil -%} <li class="nav-list-item
{%- assign activation_second_level_reversed = nil -%} {%- endcapture -%}
{%- capture nav_category_list -%}
<ul class="nav-list nav-category-list">
{%- endcapture -%}
{%- assign nav_list_link_prefix =
site_nav | split: nav_list_link | first | append: nav_list_link -%}
{%- assign nav_splits =
nav_list_link_prefix | split: nav_list_item | pop -%}
{%- assign nav_levels = "" | split: "" | push: 1 -%}
{%- comment -%}
The pattern of occurrences of list and list-item tags in the site_nav string
is included in the language defined by the following context-free grammar:
site_nav = PAGES? EXTERNALS? COLLECTION*
PAGES = nav_list (nav_list_item PAGES?)+ nav_list_end
EXTERNALS = nav_list nav_list_item+ nav_list_end
COLLECTION = nav_list (nav_list_item PAGES?)* nav_list_end
| nav_category_list
nav_list_item nav_list (nav_list_item PAGES?)* nav_list_end
nav_list_end
To determine the path in the site_nav to the nav_list_link for the current page,
the prefix of nav_list_link in site_nav is split at each nav_list_item to give
an array of nav_splits.
In site_nav, occurrences of nav_list must be separated by at least one
nav_list_item or nav_list_end. Moreover, when a nav_list_end is followed by a
nav_list without an intervening nav_list_item, that nav_list must start either
a list of external links or a collection. And when a nav_list is followed by a
nav_list_end without an intervening nav_list_item, they form an empty collection.
nav_levels is the path determined by the previously inspected nav_splits.
How many times nav_list and nav_list_end occur in the current nav_split
determines how to update the path.
A nav_split can contain any number of empty non-foldable collections.
The path element produced by the outer nav_list of a foldable collection is
irrelevant; it is set to zero and subsequently removed.
The number of occurrences of a string in a nav_split is computed by removing
them all, then dividing the resulting size difference by the length of the string.
Case analysis on (nav_list_count, nav_list_end_count):
- when (0, 0), the nav_split was between two nav_list_items at the same level;
- when (0, N+1), all the nav_list_ends in the nav_split are in PAGES or in one
COLLECTION;
- when (M+1, 0), M must be 0 (because two nav_lists in the same nav_split must
be separated by at least one nav_list_end);
- when (M+1, N+1), the nav_split must contain either:
- the end of PAGES followed by the start of EXTERNALS, or
- the end of PAGES followed by the start of a COLLECTION, or
- the end of EXTERNALS followed by the start of a COLLECTION, or
- the end of one COLLECTION followed by the start of another, or
- (in the first nav_split) one or more empty non-foldable COLLECTIONS
followed by the start of a COLLECTION.
In general, nav_levels[0] here needs to be incremented by nav_list_count.
However, a nav_split that contains the end of an empty foldable collection
followed by the just the start of a collection has two occurrences of nav_list,
and the increment needs to be one less; similarly when the first nav_split
starts with an empty non-foldable collection.
{%- endcomment %}
{%- for nav_split in nav_splits -%}
{%- assign nav_list_less = nav_split | remove: nav_list -%}
{%- assign nav_list_count =
nav_split.size | minus: nav_list_less.size |
divided_by: nav_list.size -%}
{%- assign nav_list_end_less = nav_split | remove: nav_list_end -%}
{%- assign nav_list_end_count =
nav_split.size | minus: nav_list_end_less.size |
divided_by: nav_list_end.size -%}
{%- if nav_list_count == 0 and nav_list_end_count == 0 -%}
{%- assign nav_index = nav_levels[-1] | plus: 1 -%}
{%- assign nav_levels = nav_levels | pop | push: nav_index -%}
{%- elsif nav_list_count == 0 and nav_list_end_count >= 1 -%}
{%- assign nav_slice_size = nav_levels.size | minus: nav_list_end_count -%}
{%- assign nav_levels = nav_levels | slice: 0, nav_slice_size -%}
{%- assign nav_index = nav_levels[-1] | plus: 1 -%}
{%- assign nav_levels = nav_levels | pop | push: nav_index -%}
{%- elsif nav_list_count == 1 and nav_list_end_count == 0 -%}
{%- if nav_split contains nav_category_list -%}
{%- assign nav_levels = nav_levels | push: 0 -%}
{%- else -%}
{%- assign nav_levels = nav_levels | push: 1 -%}
{%- endif -%}
{%- elsif nav_list_count >= 1 and nav_list_end_count >= 1 -%}
{%- assign nav_index = nav_levels[0] | plus: nav_list_count -%}
{%- if nav_levels[-1] == 0 or forloop.first -%}
{%- assign nav_index = nav_index | minus: 1 -%}
{%- endif -%}
{%- assign nav_levels = nav_levels | slice: 0, 0 | push: nav_index -%}
{%- if nav_split contains nav_category_list -%}
{%- assign nav_levels = nav_levels | push: 0 -%}
{%- else -%}
{%- assign nav_levels = nav_levels | push: 1 -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- assign nav_levels = nav_levels | where_exp: "item", "item >= 1" -%}
{%- endif -%}
{%- comment -%} {%- comment -%}
The generated CSS depends on the position of the current page in each level in The generated CSS depends on the position of the current page in each level in
the navigation. the navigation.
{%- endcomment -%} {%- endcomment -%}
{%- assign activation_title = page.grand_parent | default: page.parent | default: page.title -%} {%- if nav_levels[1] == nil -%}
{%- assign activation_first_level = activation_pages
| where_exp: "item", "item.parent == nil" -%}
{%- include sorted_pages.html pages = activation_first_level -%}
{%- for activation_page in sorted_pages -%}
{%- if activation_page.title == activation_title -%}
{%- assign activation_first_level_index = forloop.index -%}
{%- assign activation_first_level_reversed = activation_page.child_nav_order -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- if activation_first_level_index == nil -%}
{{ activation_no_nav_link }} {{ activation_no_nav_link }}
{%- else -%} {%- else -%}
{%- if page.grand_parent -%} {%- if nav_levels[2] == nil and nav_levels[3] -%}
{%- assign activation_title = page.parent -%}
{%- assign activation_second_level = activation_pages
| where_exp: "item", "item.grand_parent == nil"
| where_exp: "item", "item.parent == page.grand_parent" -%}
{%- elsif page.parent -%}
{%- assign activation_title = page.title -%}
{%- assign activation_second_level = activation_pages
| where_exp: "item", "item.grand_parent == nil"
| where_exp: "item", "item.parent == page.parent" -%}
{%- endif -%}
{%- if page.parent -%}
{%- include sorted_pages.html pages = activation_second_level -%}
{%- for activation_page in sorted_pages -%}
{%- if activation_page.title == activation_title -%}
{%- assign activation_second_level_index = forloop.index -%}
{%- assign activation_second_level_reversed = activation_page.child_nav_order -%}
{%- if activation_first_level_reversed -%}
{%- assign activation_second_level_index = sorted_pages | size | plus: 1 | minus: activation_second_level_index -%}
{%- endif -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if page.grand_parent -%}
{%- assign activation_third_level = activation_pages
| where_exp: "item", "item.parent == page.parent"
| where_exp: "item", "item.grand_parent == page.grand_parent" -%}
{%- include sorted_pages.html pages = activation_third_level -%}
{%- assign activation_third_level = sorted_pages -%}
{%- for activation_page in sorted_pages -%}
{%- if activation_page.title == page.title -%}
{%- assign activation_third_level_index = forloop.index -%}
{%- if activation_second_level_reversed -%}
{%- assign activation_third_level_index = sorted_pages | size | plus: 1 | minus: activation_third_level_index -%}
{%- endif -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if activation_second_level_index == nil and activation_third_level_index -%}
{{ activation_no_nav_link }} {{ activation_no_nav_link }}
@@ -158,34 +230,14 @@
{%- else -%} {%- else -%}
{%- for activation_collection in site.just_the_docs.collections -%}
{%- if activation_collection[0] == page.collection -%}
{%- assign activation_index = forloop.index -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- assign activation_pages_top_size = site.html_pages
| where_exp:"item", "item.title != nil"
| where_exp:"item", "item.parent == nil"
| where_exp:"item", "item.nav_exclude != true"
| size -%}
{%- if activation_pages_top_size > 0 -%}
{%- assign activation_index = activation_index | plus: 1 -%}
{%- endif -%}
{%- if site.nav_external_links -%}
{%- assign activation_index = activation_index | plus: 1 -%}
{%- endif -%}
{%- capture activation_collection_prefix -%} {%- capture activation_collection_prefix -%}
.site-nav > ul:nth-of-type({{ activation_index }}) .site-nav > ul:nth-of-type({{ nav_levels[0] }})
{%- if site.just_the_docs.collections[page.collection].nav_fold %} > li > ul {%- if site.just_the_docs.collections[page.collection].nav_fold %} > li > ul
{%- endif -%} {%- endif -%}
{%- endcapture -%} {%- endcapture -%}
{%- capture activation_other_collection_prefix -%} {%- capture activation_other_collection_prefix -%}
.site-nav > ul:not(:nth-of-type({{ activation_index }})) .site-nav > ul:not(:nth-of-type({{ nav_levels[0] }}))
{%- endcapture -%} {%- endcapture -%}
{%- endif -%} {%- endif -%}
@@ -197,25 +249,25 @@
and children of the current page. and children of the current page.
{%- endcomment %} {%- endcomment %}
{% if activation_third_level_index -%} {% if nav_levels[3] -%}
{{ activation_collection_prefix }} > li > a, {{ activation_collection_prefix }} > li > a,
{{ activation_collection_prefix }} > li > ul > li > a, {{ activation_collection_prefix }} > li > ul > li > a,
{{ activation_collection_prefix }} > li > ul > li > ul > li:not(:nth-child({{ activation_third_level_index }})) > a { {{ activation_collection_prefix }} > li > ul > li > ul > li:not(:nth-child({{ nav_levels[3] }})) > a {
background-image: none; background-image: none;
} }
{%- elsif activation_second_level_index -%} {%- elsif nav_levels[2] -%}
{{ activation_collection_prefix }} > li > a, {{ activation_collection_prefix }} > li > a,
{{ activation_collection_prefix }} > li > ul > li:not(:nth-child({{ activation_second_level_index }})) > a, {{ activation_collection_prefix }} > li > ul > li:not(:nth-child({{ nav_levels[2] }})) > a,
{{ activation_collection_prefix }} > li > ul > li > ul > li > a { {{ activation_collection_prefix }} > li > ul > li > ul > li > a {
background-image: none; background-image: none;
} }
{%- else -%} {%- else -%}
{{ activation_collection_prefix }} > li:not(:nth-child({{ activation_first_level_index }})) > a, {{ activation_collection_prefix }} > li:not(:nth-child({{ nav_levels[1] }})) > a,
{{ activation_collection_prefix }} > li > ul > li > a, {{ activation_collection_prefix }} > li > ul > li > a,
{{ activation_collection_prefix }} > li > ul > li > ul > li > a { {{ activation_collection_prefix }} > li > ul > li > ul > li > a {
background-image: none; background-image: none;
@@ -236,9 +288,9 @@
The following rule styles the link to the current page. The following rule styles the link to the current page.
{%- endcomment %} {%- endcomment %}
{{ activation_collection_prefix }} > li:nth-child({{ activation_first_level_index }}) {{ activation_collection_prefix }} > li:nth-child({{ nav_levels[1] }})
{%- if activation_second_level_index %} > ul > li:nth-child({{ activation_second_level_index }}) {%- if nav_levels[2] %} > ul > li:nth-child({{ nav_levels[2] }})
{%- if activation_third_level_index %} > ul > li:nth-child({{ activation_third_level_index }}) {%- if nav_levels[3] %} > ul > li:nth-child({{ nav_levels[3] }})
{%- endif -%} {%- endif -%}
{%- endif %} > a { {%- endif %} > a {
font-weight: 600; font-weight: 600;
@@ -259,9 +311,9 @@
{%- if site.just_the_docs.collections %} {%- if site.just_the_docs.collections %}
.site-nav > ul.nav-category-list > li > button svg, .site-nav > ul.nav-category-list > li > button svg,
{% endif -%} {% endif -%}
{{ activation_collection_prefix }} > li:nth-child({{ activation_first_level_index }}) > button svg {{ activation_collection_prefix }} > li:nth-child({{ nav_levels[1] }}) > button svg
{%- if activation_second_level_index -%}, {%- if nav_levels[2] -%},
{{ activation_collection_prefix }} > li:nth-child({{ activation_first_level_index }}) > ul > li:nth-child({{ activation_second_level_index }}) > button svg {{ activation_collection_prefix }} > li:nth-child({{ nav_levels[1] }}) > ul > li:nth-child({{ nav_levels[2] }}) > button svg
{%- endif %} { {%- endif %} {
transform: rotate(-90deg); transform: rotate(-90deg);
} }
@@ -269,13 +321,12 @@
{%- if site.just_the_docs.collections %} {%- if site.just_the_docs.collections %}
.site-nav > ul.nav-category-list > li.nav-list-item > ul.nav-list, .site-nav > ul.nav-category-list > li.nav-list-item > ul.nav-list,
{% endif -%} {% endif -%}
{{ activation_collection_prefix }} > li.nav-list-item:nth-child({{ activation_first_level_index }}) > ul.nav-list {{ activation_collection_prefix }} > li.nav-list-item:nth-child({{ nav_levels[1] }}) > ul.nav-list
{%- if activation_second_level_index %}, {%- if nav_levels[2] %},
{{ activation_collection_prefix }} > li.nav-list-item:nth-child({{ activation_first_level_index }}) > ul.nav-list > li.nav-list-item:nth-child({{ activation_second_level_index }}) > ul.nav-list {{ activation_collection_prefix }} > li.nav-list-item:nth-child({{ nav_levels[1] }}) > ul.nav-list > li.nav-list-item:nth-child({{ nav_levels[2] }}) > ul.nav-list
{%- endif %} { {%- endif %} {
display: block; display: block;
} }
{%- endif -%} {%- endif -%}
{%- endif -%} {%- endif -%}
{%- endif -%}

View File

@@ -7,11 +7,6 @@ $logo: "{{ site.logo | relative_url }}";
{% unless include.color_scheme == "light" %} {% unless include.color_scheme == "light" %}
@import "./color_schemes/{{ include.color_scheme }}"; @import "./color_schemes/{{ include.color_scheme }}";
{% endunless %} {% endunless %}
{% if site.custom_schemes %}
{% for scheme in site.custom_schemes %}
@import "./custom_schemes/{{scheme}}";
{% endfor %}
{% endif %}
@import "./modules"; @import "./modules";
{% include css/callouts.scss.liquid color_scheme = include.color_scheme %} {% include css/callouts.scss.liquid color_scheme = include.color_scheme %}
{% include css/custom.scss.liquid %} {% include css/custom.scss.liquid %}

View File

@@ -1,18 +1,26 @@
{%- comment -%} {%- comment -%}
This file can be used to fix the HTML produced by Jekyll for highlighted This file was previously used to "fix" the HTML produced by Jekyll for
code with line numbers. highlighted code with line numbers. While it often resolves layout issues
from the missing HTML tags, it still generates invalid HTML (by placing
a `<table>` element within a `<code>` block). As such, we no longer
recommend using this workaround. For more information, see the
"Code snippets with line numbers" docs page:
https://just-the-docs.com/docs/ui-components/code/line-numbers/
(or, docs/ui-components/line-nos.md/)
It works with `{% highlight some_language linenos %}...{% endhighlight %}` The next portion of this file, including the comments and the workaround,
and with the Kramdown option to add line numbers to fenced code. are preserved for backwards comptability.
ACKNOWLEDGEMENTS
The implementation was derived from the workaround provided by The implementation was derived from the workaround provided by
Dmitry Hrabrov (DeXP) at Dmitry Hrabrov (DeXP) at
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901 https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
EXPLANATION EXPLANATION (OLD)
The HTML produced by Rouge highlighting with lie numbers is of the form The HTML produced by Rouge highlighting with line numbers is of the form
`code table`. Jekyll (<= 4.1.1) always wraps the highlighted HTML `code table`. Jekyll always wraps the highlighted HTML
with `pre`. This wrapping is not only unnecessary, but also transforms with `pre`. This wrapping is not only unnecessary, but also transforms
the conforming HTML produced by Rouge to non-conforming HTML, which the conforming HTML produced by Rouge to non-conforming HTML, which
results in HTML validation error reports. results in HTML validation error reports.

View File

@@ -9,7 +9,13 @@ layout: table_wrappers
<body> <body>
<a class="skip-to-main" href="#main-content">Skip to main content</a> <a class="skip-to-main" href="#main-content">Skip to main content</a>
{% include icons/icons.html %} {% include icons/icons.html %}
{% if page.nav_enabled == true %}
{% include components/sidebar.html %} {% include components/sidebar.html %}
{% elsif layout.nav_enabled == true and page.nav_enabled == nil %}
{% include components/sidebar.html %}
{% elsif site.nav_enabled != false and layout.nav_enabled == nil and page.nav_enabled == nil %}
{% include components/sidebar.html %}
{% endif %}
<div class="main" id="top"> <div class="main" id="top">
{% include components/header.html %} {% include components/header.html %}
<div class="main-content-wrap"> <div class="main-content-wrap">

View File

@@ -1,34 +1,6 @@
--- ---
layout: table_wrappers layout: default
nav_enabled: false
--- ---
<!DOCTYPE html> {{ content }}
<html lang="{{ site.lang | default: 'en-US' }}">
{% include head.html %}
<body>
<a class="skip-to-main" href="#main-content">Skip to main content</a>
{% include icons/icons.html %}
<div class="main-content-wrap" id="top">
{% include components/breadcrumbs.html %}
<div id="main-content" class="main-content" role="main">
{% if site.heading_anchors != false %}
{% 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%\"" %}
{% else %}
{{ content }}
{% endif %}
{% if page.has_children == true and page.has_toc != false %}
{% include components/children_nav.html %}
{% endif %}
{% include components/footer.html %}
</div>
</div>
{% if site.mermaid %}
{% include components/mermaid.html %}
{% endif %}
</body>
</html>

View File

@@ -10,9 +10,9 @@
} }
html { html {
@include fs-4;
scroll-behavior: smooth; scroll-behavior: smooth;
@include fs-4;
} }
body { body {

View File

@@ -142,10 +142,10 @@ div.highlighter-rouge {
// for AsciiDoc. we also need to fix the margins for its parent container. // for AsciiDoc. we also need to fix the margins for its parent container.
div.listingblock { div.listingblock {
@include scroll-and-spacing("div.content", "div.content > pre");
margin-top: 0; margin-top: 0;
margin-bottom: $sp-3; margin-bottom: $sp-3;
@include scroll-and-spacing("div.content", "div.content > pre");
} }
// {% highlight LANG %}...{% endhighlight %}, // {% highlight LANG %}...{% endhighlight %},
@@ -176,12 +176,12 @@ figure.highlight {
td, td,
pre { pre {
@include fs-2;
min-width: 0; min-width: 0;
padding: 0; padding: 0;
background-color: $code-background-color; background-color: $code-background-color;
border: 0; border: 0;
@include fs-2;
} }
td.gl { td.gl {

View File

@@ -14,9 +14,9 @@
text-transform: uppercase; text-transform: uppercase;
vertical-align: middle; vertical-align: middle;
background-color: $blue-100; background-color: $blue-100;
@include fs-2;
border-radius: 12px; border-radius: 12px;
@include fs-2;
} }
.label-green:not(g) { .label-green:not(g) {

View File

@@ -19,12 +19,9 @@
width: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width}); width: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width});
min-width: $nav-width; min-width: $nav-width;
} }
}
.main { & + .main {
@include mq(md) { @include mq(md) {
position: relative;
max-width: $content-width;
margin-left: $nav-width-md; margin-left: $nav-width-md;
} }
@@ -37,14 +34,42 @@
); );
// stylelint-enable function-name-case // stylelint-enable function-name-case
} }
.main-header {
display: none;
background-color: $sidebar-color;
@include mq(md) {
display: flex;
background-color: $body-background-color;
}
&.nav-open {
display: block;
@include mq(md) {
display: flex;
}
}
}
}
}
.main {
margin: auto;
@include mq(md) {
position: relative;
max-width: $content-width;
}
} }
.main-content-wrap { .main-content-wrap {
@include container;
padding-top: $gutter-spacing-sm; padding-top: $gutter-spacing-sm;
padding-bottom: $gutter-spacing-sm; padding-bottom: $gutter-spacing-sm;
@include container;
@include mq(md) { @include mq(md) {
padding-top: $gutter-spacing; padding-top: $gutter-spacing;
padding-bottom: $gutter-spacing; padding-bottom: $gutter-spacing;
@@ -53,23 +78,12 @@
.main-header { .main-header {
z-index: 0; z-index: 0;
display: none; border-bottom: $border $border-color;
background-color: $sidebar-color;
@include mq(md) { @include mq(md) {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: $header-height; height: $header-height;
background-color: $body-background-color;
border-bottom: $border $border-color;
}
&.nav-open {
display: block;
@include mq(md) {
display: flex;
}
} }
} }
@@ -112,8 +126,6 @@
} }
.site-title { .site-title {
@include container;
flex-grow: 1; flex-grow: 1;
display: flex; display: flex;
height: 100%; height: 100%;
@@ -121,6 +133,9 @@
padding-top: $sp-3; padding-top: $sp-3;
padding-bottom: $sp-3; padding-bottom: $sp-3;
color: $body-heading-color; color: $body-heading-color;
@include container;
@include fs-6; @include fs-6;
@include mq(md) { @include mq(md) {
@@ -186,14 +201,15 @@ body {
// stylelint-enable selector-max-type // stylelint-enable selector-max-type
.site-footer { .site-footer {
@include container;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
padding-top: $sp-4; padding-top: $sp-4;
padding-bottom: $sp-4; padding-bottom: $sp-4;
color: $grey-dk-000; color: $grey-dk-000;
@include container;
@include fs-2; @include fs-2;
@include mq(md) { @include mq(md) {

View File

@@ -8,11 +8,11 @@
list-style: none; list-style: none;
.nav-list-item { .nav-list-item {
@include fs-4;
position: relative; position: relative;
margin: 0; margin: 0;
@include fs-4;
@include mq(md) { @include mq(md) {
@include fs-3; @include fs-3;
} }

View File

@@ -1,5 +1,7 @@
@mixin fs-1 { @mixin fs-1 {
& {
font-size: $font-size-1 !important; font-size: $font-size-1 !important;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-1-sm !important; font-size: $font-size-1-sm !important;
@@ -7,7 +9,9 @@
} }
@mixin fs-2 { @mixin fs-2 {
& {
font-size: $font-size-2 !important; font-size: $font-size-2 !important;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-3 !important; font-size: $font-size-3 !important;
@@ -15,7 +19,9 @@
} }
@mixin fs-3 { @mixin fs-3 {
& {
font-size: $font-size-3 !important; font-size: $font-size-3 !important;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-4 !important; font-size: $font-size-4 !important;
@@ -23,7 +29,9 @@
} }
@mixin fs-4 { @mixin fs-4 {
& {
font-size: $font-size-4 !important; font-size: $font-size-4 !important;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-5 !important; font-size: $font-size-5 !important;
@@ -31,7 +39,9 @@
} }
@mixin fs-5 { @mixin fs-5 {
& {
font-size: $font-size-5 !important; font-size: $font-size-5 !important;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-6 !important; font-size: $font-size-6 !important;
@@ -39,7 +49,9 @@
} }
@mixin fs-6 { @mixin fs-6 {
& {
font-size: $font-size-6 !important; font-size: $font-size-6 !important;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-7 !important; font-size: $font-size-7 !important;
@@ -48,8 +60,10 @@
} }
@mixin fs-7 { @mixin fs-7 {
& {
font-size: $font-size-7 !important; font-size: $font-size-7 !important;
line-height: $body-heading-line-height; line-height: $body-heading-line-height;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-8 !important; font-size: $font-size-8 !important;
@@ -57,8 +71,10 @@
} }
@mixin fs-8 { @mixin fs-8 {
& {
font-size: $font-size-8 !important; font-size: $font-size-8 !important;
line-height: $body-heading-line-height; line-height: $body-heading-line-height;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-9 !important; font-size: $font-size-9 !important;
@@ -66,8 +82,10 @@
} }
@mixin fs-9 { @mixin fs-9 {
& {
font-size: $font-size-9 !important; font-size: $font-size-9 !important;
line-height: $body-heading-line-height; line-height: $body-heading-line-height;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-10 !important; font-size: $font-size-10 !important;
@@ -75,8 +93,10 @@
} }
@mixin fs-10 { @mixin fs-10 {
& {
font-size: $font-size-10 !important; font-size: $font-size-10 !important;
line-height: $body-heading-line-height; line-height: $body-heading-line-height;
}
@include mq(sm) { @include mq(sm) {
font-size: $font-size-10-sm !important; font-size: $font-size-10-sm !important;

View File

@@ -21,14 +21,14 @@ table {
th, th,
td { td {
@include fs-3;
min-width: 7.5rem; min-width: 7.5rem;
padding: $sp-2 $sp-3; padding: $sp-2 $sp-3;
background-color: $table-background-color; background-color: $table-background-color;
border-bottom: $border rgba($border-color, 0.5); border-bottom: $border rgba($border-color, 0.5);
border-left: $border $border-color; border-left: $border $border-color;
@include fs-3;
&:first-of-type { &:first-of-type {
border-left: 0; border-left: 0;
} }

View File

@@ -3,9 +3,9 @@
h1, h1,
.text-alpha { .text-alpha {
@include fs-8;
font-weight: 300; font-weight: 300;
@include fs-8;
} }
h2, h2,
@@ -21,11 +21,11 @@ h3,
h4, h4,
.text-delta { .text-delta {
@include fs-2;
font-weight: 400; font-weight: 400;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.1em; letter-spacing: 0.1em;
@include fs-2;
} }
h4 code { h4 code {

View File

@@ -5,198 +5,261 @@ pre.highlight {
background: #31343f; background: #31343f;
color: #dee2f7; color: #dee2f7;
} }
.highlight pre { .highlight pre {
background: #31343f; background: #31343f;
} }
.highlight .hll { .highlight .hll {
background: #31343f; background: #31343f;
} }
.highlight .c { .highlight .c {
color: #63677e; color: #63677e;
font-style: italic; font-style: italic;
} }
.highlight .err { .highlight .err {
color: #960050; color: #960050;
background-color: #1e0010; background-color: #1e0010;
} }
.highlight .k { .highlight .k {
color: #e19ef5; color: #e19ef5;
} }
.highlight .l { .highlight .l {
color: #a3eea0; color: #a3eea0;
} }
.highlight .n { .highlight .n {
color: #dee2f7; color: #dee2f7;
} }
.highlight .o { .highlight .o {
color: #dee2f7; color: #dee2f7;
} }
.highlight .p { .highlight .p {
color: #dee2f7; color: #dee2f7;
} }
.highlight .cm { .highlight .cm {
color: #63677e; color: #63677e;
font-style: italic; font-style: italic;
} }
.highlight .cp { .highlight .cp {
color: #63677e; color: #63677e;
font-style: italic; font-style: italic;
} }
.highlight .c1 { .highlight .c1 {
color: #63677e; color: #63677e;
font-style: italic; font-style: italic;
} }
.highlight .cs { .highlight .cs {
color: #63677e; color: #63677e;
font-style: italic; font-style: italic;
} }
.highlight .ge { .highlight .ge {
font-style: italic; font-style: italic;
} }
.highlight .gs { .highlight .gs {
font-weight: 700; font-weight: 700;
} }
.highlight .kc { .highlight .kc {
color: #e19ef5; color: #e19ef5;
} }
.highlight .kd { .highlight .kd {
color: #e19ef5; color: #e19ef5;
} }
.highlight .kn { .highlight .kn {
color: #e19ef5; color: #e19ef5;
} }
.highlight .kp { .highlight .kp {
color: #e19ef5; color: #e19ef5;
} }
.highlight .kr { .highlight .kr {
color: #e19ef5; color: #e19ef5;
} }
.highlight .kt { .highlight .kt {
color: #e19ef5; color: #e19ef5;
} }
.highlight .ld { .highlight .ld {
color: #a3eea0; color: #a3eea0;
} }
.highlight .m { .highlight .m {
color: #eddc96; color: #eddc96;
} }
.highlight .s { .highlight .s {
color: #a3eea0; color: #a3eea0;
} }
.highlight .na { .highlight .na {
color: #eddc96; color: #eddc96;
} }
.highlight .nb { .highlight .nb {
color: #fdce68; color: #fdce68;
} }
.highlight .nc { .highlight .nc {
color: #fdce68; color: #fdce68;
} }
.highlight .no { .highlight .no {
color: #fdce68; color: #fdce68;
} }
.highlight .nd { .highlight .nd {
color: #fdce68; color: #fdce68;
} }
.highlight .ni { .highlight .ni {
color: #fdce68; color: #fdce68;
} }
.highlight .ne { .highlight .ne {
color: #fdce68; color: #fdce68;
} }
.highlight .nf { .highlight .nf {
color: #dee2f7; color: #dee2f7;
} }
.highlight .nl { .highlight .nl {
color: #fdce68; color: #fdce68;
} }
.highlight .nn { .highlight .nn {
color: #dee2f7; color: #dee2f7;
} }
.highlight .nx { .highlight .nx {
color: #dee2f7; color: #dee2f7;
} }
.highlight .py { .highlight .py {
color: #fdce68; color: #fdce68;
} }
.highlight .nt { .highlight .nt {
color: #f9867b; color: #f9867b;
} }
.highlight .nv { .highlight .nv {
color: #fdce68; color: #fdce68;
} }
.highlight .ow { .highlight .ow {
font-weight: 700; font-weight: 700;
} }
.highlight .w { .highlight .w {
color: #f8f8f2; color: #f8f8f2;
} }
.highlight .mf { .highlight .mf {
color: #eddc96; color: #eddc96;
} }
.highlight .mh { .highlight .mh {
color: #eddc96; color: #eddc96;
} }
.highlight .mi { .highlight .mi {
color: #eddc96; color: #eddc96;
} }
.highlight .mo { .highlight .mo {
color: #eddc96; color: #eddc96;
} }
.highlight .sb { .highlight .sb {
color: #a3eea0; color: #a3eea0;
} }
.highlight .sc { .highlight .sc {
color: #a3eea0; color: #a3eea0;
} }
.highlight .sd { .highlight .sd {
color: #a3eea0; color: #a3eea0;
} }
.highlight .s2 { .highlight .s2 {
color: #a3eea0; color: #a3eea0;
} }
.highlight .se { .highlight .se {
color: #a3eea0; color: #a3eea0;
} }
.highlight .sh { .highlight .sh {
color: #a3eea0; color: #a3eea0;
} }
.highlight .si { .highlight .si {
color: #a3eea0; color: #a3eea0;
} }
.highlight .sx { .highlight .sx {
color: #a3eea0; color: #a3eea0;
} }
.highlight .sr { .highlight .sr {
color: #7be2f9; color: #7be2f9;
} }
.highlight .s1 { .highlight .s1 {
color: #a3eea0; color: #a3eea0;
} }
.highlight .ss { .highlight .ss {
color: #7be2f9; color: #7be2f9;
} }
.highlight .bp { .highlight .bp {
color: #fdce68; color: #fdce68;
} }
.highlight .vc { .highlight .vc {
color: #fdce68; color: #fdce68;
} }
.highlight .vg { .highlight .vg {
color: #fdce68; color: #fdce68;
} }
.highlight .vi { .highlight .vi {
color: #f9867b; color: #f9867b;
} }
.highlight .il { .highlight .il {
color: #eddc96; color: #eddc96;
} }
.highlight .gu { .highlight .gu {
color: #75715e; color: #75715e;
} }
.highlight .gd { .highlight .gd {
color: #f92672; color: #f92672;
} }
.highlight .gi { .highlight .gi {
color: #a6e22e; color: #a6e22e;
} }

View File

@@ -5,204 +5,269 @@ pre.highlight {
background: #f9f9f9; background: #f9f9f9;
color: #383942; color: #383942;
} }
.highlight pre { .highlight pre {
background: #f9f9f9; background: #f9f9f9;
} }
.highlight .hll { .highlight .hll {
background: #f9f9f9; background: #f9f9f9;
} }
.highlight .c { .highlight .c {
color: #9fa0a6; color: #9fa0a6;
font-style: italic; font-style: italic;
} }
.highlight .err { .highlight .err {
color: #fff; color: #fff;
background-color: #e05151; background-color: #e05151;
} }
.highlight .k { .highlight .k {
color: #a625a4; color: #a625a4;
} }
.highlight .l { .highlight .l {
color: #50a04f; color: #50a04f;
} }
.highlight .n { .highlight .n {
color: #383942; color: #383942;
} }
.highlight .o { .highlight .o {
color: #383942; color: #383942;
} }
.highlight .p { .highlight .p {
color: #383942; color: #383942;
} }
.highlight .cm { .highlight .cm {
color: #9fa0a6; color: #9fa0a6;
font-style: italic; font-style: italic;
} }
.highlight .cp { .highlight .cp {
color: #9fa0a6; color: #9fa0a6;
font-style: italic; font-style: italic;
} }
.highlight .c1 { .highlight .c1 {
color: #9fa0a6; color: #9fa0a6;
font-style: italic; font-style: italic;
} }
.highlight .cs { .highlight .cs {
color: #9fa0a6; color: #9fa0a6;
font-style: italic; font-style: italic;
} }
.highlight .ge { .highlight .ge {
font-style: italic; font-style: italic;
} }
.highlight .gs { .highlight .gs {
font-weight: 700; font-weight: 700;
} }
.highlight .kc { .highlight .kc {
color: #a625a4; color: #a625a4;
} }
.highlight .kd { .highlight .kd {
color: #a625a4; color: #a625a4;
} }
.highlight .kn { .highlight .kn {
color: #a625a4; color: #a625a4;
} }
.highlight .kp { .highlight .kp {
color: #a625a4; color: #a625a4;
} }
.highlight .kr { .highlight .kr {
color: #a625a4; color: #a625a4;
} }
.highlight .kt { .highlight .kt {
color: #a625a4; color: #a625a4;
} }
.highlight .ld { .highlight .ld {
color: #50a04f; color: #50a04f;
} }
.highlight .m { .highlight .m {
color: #b66a00; color: #b66a00;
} }
.highlight .s { .highlight .s {
color: #50a04f; color: #50a04f;
} }
.highlight .na { .highlight .na {
color: #b66a00; color: #b66a00;
} }
.highlight .nb { .highlight .nb {
color: #ca7601; color: #ca7601;
} }
.highlight .nc { .highlight .nc {
color: #ca7601; color: #ca7601;
} }
.highlight .no { .highlight .no {
color: #ca7601; color: #ca7601;
} }
.highlight .nd { .highlight .nd {
color: #ca7601; color: #ca7601;
} }
.highlight .ni { .highlight .ni {
color: #ca7601; color: #ca7601;
} }
.highlight .ne { .highlight .ne {
color: #ca7601; color: #ca7601;
} }
.highlight .nf { .highlight .nf {
color: #383942; color: #383942;
} }
.highlight .nl { .highlight .nl {
color: #ca7601; color: #ca7601;
} }
.highlight .nn { .highlight .nn {
color: #383942; color: #383942;
} }
.highlight .nx { .highlight .nx {
color: #383942; color: #383942;
} }
.highlight .py { .highlight .py {
color: #ca7601; color: #ca7601;
} }
.highlight .nt { .highlight .nt {
color: #e35549; color: #e35549;
} }
.highlight .nv { .highlight .nv {
color: #ca7601; color: #ca7601;
} }
.highlight .ow { .highlight .ow {
font-weight: 700; font-weight: 700;
} }
.highlight .w { .highlight .w {
color: #f8f8f2; color: #f8f8f2;
} }
.highlight .mf { .highlight .mf {
color: #b66a00; color: #b66a00;
} }
.highlight .mh { .highlight .mh {
color: #b66a00; color: #b66a00;
} }
.highlight .mi { .highlight .mi {
color: #b66a00; color: #b66a00;
} }
.highlight .mo { .highlight .mo {
color: #b66a00; color: #b66a00;
} }
.highlight .sb { .highlight .sb {
color: #50a04f; color: #50a04f;
} }
.highlight .sc { .highlight .sc {
color: #50a04f; color: #50a04f;
} }
.highlight .sd { .highlight .sd {
color: #50a04f; color: #50a04f;
} }
.highlight .s2 { .highlight .s2 {
color: #50a04f; color: #50a04f;
} }
.highlight .se { .highlight .se {
color: #50a04f; color: #50a04f;
} }
.highlight .sh { .highlight .sh {
color: #50a04f; color: #50a04f;
} }
.highlight .si { .highlight .si {
color: #50a04f; color: #50a04f;
} }
.highlight .sx { .highlight .sx {
color: #50a04f; color: #50a04f;
} }
.highlight .sr { .highlight .sr {
color: #0083bb; color: #0083bb;
} }
.highlight .s1 { .highlight .s1 {
color: #50a04f; color: #50a04f;
} }
.highlight .ss { .highlight .ss {
color: #0083bb; color: #0083bb;
} }
.highlight .bp { .highlight .bp {
color: #ca7601; color: #ca7601;
} }
.highlight .vc { .highlight .vc {
color: #ca7601; color: #ca7601;
} }
.highlight .vg { .highlight .vg {
color: #ca7601; color: #ca7601;
} }
.highlight .vi { .highlight .vi {
color: #e35549; color: #e35549;
} }
.highlight .il { .highlight .il {
color: #b66a00; color: #b66a00;
} }
.highlight .gu { .highlight .gu {
color: #75715e; color: #75715e;
} }
.highlight .gd { .highlight .gd {
color: #e05151; color: #e05151;
} }
.highlight .gi { .highlight .gi {
color: #43d089; color: #43d089;
} }
.highlight .language-json .w + .s2 { .highlight .language-json .w + .s2 {
color: #e35549; color: #e35549;
} }
.highlight .language-json .kc { .highlight .language-json .kc {
color: #0083bb; color: #0083bb;
} }

View File

@@ -10,7 +10,7 @@
html { html {
line-height: 1.15; /* 1 */ line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */ text-size-adjust: 100%; /* 2 */
} }
/* Sections /* Sections
@@ -62,7 +62,7 @@ hr {
*/ */
pre { pre {
font-family: monospace, monospace; /* 1 */ font-family: monospace; /* 1 */
font-size: 1em; /* 2 */ font-size: 1em; /* 2 */
} }
@@ -105,7 +105,7 @@ strong {
code, code,
kbd, kbd,
samp { samp {
font-family: monospace, monospace; /* 1 */ font-family: monospace; /* 1 */
font-size: 1em; /* 2 */ font-size: 1em; /* 2 */
} }
@@ -198,7 +198,7 @@ button,
[type="button"], [type="button"],
[type="reset"], [type="reset"],
[type="submit"] { [type="submit"] {
-webkit-appearance: button; appearance: button;
} }
/** /**
@@ -290,7 +290,7 @@ textarea {
*/ */
[type="search"] { [type="search"] {
-webkit-appearance: textfield; /* 1 */ appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */ outline-offset: -2px; /* 2 */
} }
@@ -299,7 +299,7 @@ textarea {
*/ */
[type="search"]::-webkit-search-decoration { [type="search"]::-webkit-search-decoration {
-webkit-appearance: none; appearance: none;
} }
/** /**
@@ -308,7 +308,7 @@ textarea {
*/ */
::-webkit-file-upload-button { ::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */ appearance: button; /* 1 */
font: inherit; /* 2 */ font: inherit; /* 2 */
} }

View File

@@ -1,4 +1,5 @@
--- ---
layout: null
--- ---
(function (jtd, undefined) { (function (jtd, undefined) {
@@ -145,6 +146,18 @@ function searchLoaded(index, docs) {
var currentInput; var currentInput;
var currentSearchIndex = 0; var currentSearchIndex = 0;
{%- if site.search.focus_shortcut_key %}
// add event listener on ctrl + <focus_shortcut_key> for showing the search input
jtd.addEvent(document, 'keydown', function (e) {
if ((e.ctrlKey || e.metaKey) && e.key === '{{ site.search.focus_shortcut_key }}') {
e.preventDefault();
mainHeader.classList.add('nav-open');
searchInput.focus();
}
});
{%- endif %}
function showSearch() { function showSearch() {
document.documentElement.classList.add('search-active'); document.documentElement.classList.add('search-active');
} }
@@ -487,11 +500,28 @@ jtd.setTheme = function(theme) {
// and not have the slash on GitHub Pages // and not have the slash on GitHub Pages
function navLink() { function navLink() {
var href = document.location.pathname; var pathname = document.location.pathname;
if (href.endsWith('/') && href != '/') {
href = href.slice(0, -1); var navLink = document.getElementById('site-nav').querySelector('a[href="' + pathname + '"]');
if (navLink) {
return navLink;
} }
return document.getElementById('site-nav').querySelector('a[href="' + href + '"], a[href="' + href + '/"]');
// The `permalink` setting may produce navigation links whose `href` ends with `/` or `.html`.
// To find these links when `/` is omitted from or added to pathname, or `.html` is omitted:
if (pathname.endsWith('/') && pathname != '/') {
pathname = pathname.slice(0, -1);
}
if (pathname != '/') {
navLink = document.getElementById('site-nav').querySelector('a[href="' + pathname + '"], a[href="' + pathname + '/"], a[href="' + pathname + '.html"]');
if (navLink) {
return navLink;
}
}
return null; // avoids `undefined`
} }
// Scroll site-nav to ensure the link to the current page is visible // Scroll site-nav to ensure the link to the current page is visible
@@ -499,8 +529,7 @@ function navLink() {
function scrollNav() { function scrollNav() {
const targetLink = navLink(); const targetLink = navLink();
if (targetLink) { if (targetLink) {
const rect = targetLink.getBoundingClientRect(); targetLink.scrollIntoView({ block: "center" });
document.getElementById('site-nav').scrollBy(0, rect.top - 3*rect.height);
targetLink.removeAttribute('href'); targetLink.removeAttribute('href');
} }
} }
@@ -527,12 +556,14 @@ function activateNav() {
// Document ready // Document ready
jtd.onReady(function(){ jtd.onReady(function(){
if (document.getElementById('site-nav')) {
initNav(); initNav();
activateNav();
scrollNav();
}
{%- if site.search_enabled != false %} {%- if site.search_enabled != false %}
initSearch(); initSearch();
{%- endif %} {%- endif %}
activateNav();
scrollNav();
}); });
// Copy button on code // Copy button on code

View File

@@ -1,4 +1,5 @@
--- ---
layout: null
permalink: /assets/js/search-data.json permalink: /assets/js/search-data.json
--- ---
{ {

View File

@@ -66,6 +66,8 @@ search:
# Enable or disable the search button that appears in the bottom right corner of every page # Enable or disable the search button that appears in the bottom right corner of every page
# Supports true or false (default) # Supports true or false (default)
button: false button: false
# Focus the search input by pressing `ctrl + focus_shortcut_key` (or `cmd + focus_shortcut_key` on macOS)
focus_shortcut_key: 'k'
``` ```
## Mermaid Diagrams ## Mermaid Diagrams
@@ -99,6 +101,14 @@ aux_links:
aux_links_new_tab: false aux_links_new_tab: false
``` ```
## Navigation sidebar
```yaml
# Enable or disable the side/mobile menu globally
# Nav menu can also be selectively enabled or disabled using page variables or the minimal layout
nav_enabled: true
```
## Heading anchor links ## Heading anchor links
```yaml ```yaml
@@ -143,7 +153,7 @@ gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into t
_note: `footer_content` is deprecated, but still supported. For a better experience we have moved this into an include called `_includes/footer_custom.html` which will allow for robust markup / liquid-based content._ _note: `footer_content` is deprecated, but still supported. For a better experience we have moved this into an include called `_includes/footer_custom.html` which will allow for robust markup / liquid-based content._
- the "page last modified" data will only display if a page has a key called `last_modified_date`, formatted in some readable date format - the "page last modified" data will only display if a page has a key called `last_modified_date`, formatted in some readable date format
- `last_edit_time_format` uses Ruby's DateTime formatter; see examples and more information [at this link.](https://apidock.com/ruby/DateTime/strftime) - `last_edit_time_format` uses Ruby's DateTime formatter; for examples and information, please refer to the [official Ruby docs on `strftime` formatting](https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html)
- `gh_edit_repository` is the URL of the project's GitHub repository - `gh_edit_repository` is the URL of the project's GitHub repository
- `gh_edit_branch` is the branch that the docs site is served from; defaults to `main` - `gh_edit_branch` is the branch that the docs site is served from; defaults to `main`
- `gh_edit_source` is the source directory that your project files are stored in (should be the same as [site.source](https://jekyllrb.com/docs/configuration/options/)) - `gh_edit_source` is the source directory that your project files are stored in (should be the same as [site.source](https://jekyllrb.com/docs/configuration/options/))

View File

@@ -329,43 +329,9 @@ Future versions may subdivide components further; we guarantee that we will only
### Alternative layouts and example (`minimal`) ### Alternative layouts and example (`minimal`)
Users can develop custom layouts that compose, omit, or add components differently. We provide one first-class example titled `minimal`, inspired by Kevin Lin's work in [just-the-class](https://github.com/kevinlin1/just-the-class). This `minimal` layout does not render the sidebar, header, or search. To see an example, visit the [minimal layout test]({{site.baseurl}}/docs/minimal-test/) page. Users can develop custom layouts that compose, omit, or add components differently. We provide one first-class example titled `minimal`, which disables the navigation sidebar. To see an example, visit the [minimal layout test]({{site.baseurl}}/docs/minimal-test/) page.
Here is a simplified code example of what it looks like: Users can indicate this alternative layout in page front matter:
{% raw %}
```liquid
<!-- a simplified version of _layouts/minimal.html -->
<html>
{% include head.html %}
<body>
{% include icons/icons.html %}
{% comment %} Bandaid fix for breadcrumbs here! {% endcomment %}
{% include components/breadcrumbs.html %}
{% if site.heading_anchors != false %}
{% include vendor/anchor_headings.html html=content ... %}
{% else %}
{{ content }}
{% endif %}
{% if page.has_children == true and page.has_toc != false %}
{% include components/children_nav.html %}
{% endif %}
{% include components/footer.html %}
{% if site.mermaid %}
{% include components/mermaid.html %}
{% endif %}
</body>
</html>
```
{% endraw %}
This layout is packaged in Just the Docs. Users can indicate this alternative layout in page front matter:
{% raw %} {% raw %}
@@ -384,10 +350,10 @@ Similarly, users and developers can create other alternative layouts using Just
Under the hood, Under the hood,
- `default` and `minimal` inherit from the `table_wrappers` layout, which wraps all HTML `<table>` tags with a `div .table-wrapper` - `default` inherit from the `table_wrappers` layout, which wraps all HTML `<table>` tags with a `div .table-wrapper`
- `table_wrappers` inherits from `vendor/compress`, which is a local copy of Anatol Broder's [jekyll-compress-html](https://github.com/penibelst/jekyll-compress-html) Jekyll plugin - `table_wrappers` inherits from `vendor/compress`, which is a local copy of Anatol Broder's [jekyll-compress-html](https://github.com/penibelst/jekyll-compress-html) Jekyll plugin
Note that as of now, `minimal` and `default` have no inheritance relationship. The `minimal` layout inherits from the `default` but assigns `nav_enabled: false` to disable the navigation sidebar.
### Overridden default Jekyll layouts ### Overridden default Jekyll layouts

View File

@@ -28,7 +28,20 @@ Each page that has child pages generally has a list of links to those pages (you
## The `minimal` layout ## 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. 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.
## Selectively hiding or showing the sidebar
[Jekyll's front matter defaults] can be used to apply the `minimal` layout for many pages. But there are also other variables that can control the page layout. In `_config.yml`, you can set `nav_enabled: false` to disable the sidebar navigation panel across the entire site. This can then be selectively enabled on a page-by-page basis by assigning the `nav_enabled: true` page [front matter] variable. For instance, this could be used to enable sidebar navigation on a home page while all other pages have sidebar navigation disabled.
```yaml
---
layout: default
title: Home
nav_enabled: true
---
```
## Other layouts ## Other layouts

View File

@@ -237,6 +237,40 @@ Currently, the navigation structure is limited to 3 levels: grandchild pages can
--- ---
## Grouping pages with collections
Pages can also be grouped together by using Jekyll's and Just the Docs's [collections]({% link docs/configuration.md %}#document-collections) feature. In contrast to using [pages with children](#pages-with-children), pages grouped by collection are grouped by a shared header (the name of the collection) instead of a page.
The `nav_fold` configuration option works for collection-grouped pages. For more information, please refer to the [collections documentation]({% link docs/configuration.md %}#document-collections).
### Example (grouping by collection)
{: .no_toc }
The following example sets up two collections, `collection-one` and `collection-two`:
- any document placed within `_collection-1/` will be grouped under the `Collection One` header by default. Since `nav_fold` is set to `true`, the pages will be folded by default.
- any document placed within `_collection-2/` will be grouped under the `Collection Two` header by default. Since `nav_fold` is set to `false`, the pages will be expanded by default.
```yaml
_config.yml:
collections:
collection-one:
permalink: "/:collection/:path/"
output: true
collection-two:
permalink: "/:collection/:path/"
output: true
just_the_docs:
collections:
collection-one:
name: Collection One
nav_fold: true
collection-two:
name: Collection Two
nav_fold: false
```
---
## Auxiliary Links ## Auxiliary Links
To add auxiliary links to your site (in the upper right on all pages), add it to the `aux_links` [configuration option]({% link docs/configuration.md %}#aux-links) in your site's `_config.yml` file. To add auxiliary links to your site (in the upper right on all pages), add it to the `aux_links` [configuration option]({% link docs/configuration.md %}#aux-links) in your site's `_config.yml` file.

View File

@@ -94,6 +94,21 @@ The search button displays in the bottom right corner of the screen and triggers
search.button: true search.button: true
``` ```
### Focus search bar with a keyboard shortcut
Just the Docs supports focusing the search bar input with a keyboard shortcut. After setting the `search.focus_shortcut_key` config item key, users who press <kbd>Ctrl</kbd> + `search.focus_shortcut_key` (or on macOS, <kbd>Command</kbd> + `search.focus_shortcut_key`) will focus the search bar.
Note that this feature is **disabled by default**. `search.focus_shortcut_key` should be a [valid value from `KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key); this involves all ASCII alphanumeric values, as well as modifier keys.
For example,
```yaml
search:
focus_shortcut_key: 'k'
```
Will make <kbd>Ctrl</kbd> + <kbd>K</kbd> focus the search bar for Windows users (and <kbd>Command</kbd> + <kbd>K</kbd> on macOS).
## Hiding pages from search ## Hiding pages from search
Sometimes you might have a page that you don't want to be indexed for the search nor to show up in search results, e.g., a 404 page. Sometimes you might have a page that you don't want to be indexed for the search nor to show up in search results, e.g., a 404 page.

View File

@@ -58,6 +58,8 @@ var fun = function lang(l) {
``` ```
{% endhighlight %} {% endhighlight %}
Syntax highlighting, line numbers, and HTML compression do not work together; **the combination of these features generates invalid HTML that renders incorrectly**. To learn more, see ["Code with line numbers"]({% link docs/ui-components/line-nos.md %}).
--- ---
## Code blocks with rendered examples ## Code blocks with rendered examples

View File

@@ -8,8 +8,12 @@ permalink: /docs/ui-components/code/line-numbers/
# Code snippets with line numbers # Code snippets with line numbers
{: .warning }
In prior versions of the docs, we provided "workarounds" to rendering issues arising from code snippets with line numbers. While these seemed to resolve visual layout issues, they did not resolve core issues with Jekyll generating invalid HTML. See [the detailed explanation](#detailed-error-explanation) for more information.
The default settings for HTML compression are incompatible with the HTML The default settings for HTML compression are incompatible with the HTML
produced by Jekyll (4.1.1 or earlier) for line numbers from highlighted code produced by Jekyll for line numbers from highlighted code
-- both when using Kramdown code fences and when using Liquid highlight tags. -- both when using Kramdown code fences and when using Liquid highlight tags.
To avoid non-conforming HTML and unsatisfactory layout, HTML compression To avoid non-conforming HTML and unsatisfactory layout, HTML compression
@@ -40,90 +44,62 @@ Some code
{% endhighlight %}{% endraw %} {% endhighlight %}{% endraw %}
{% endhighlight %} {% endhighlight %}
## Workarounds ## Detailed Error Explanation
To use HTML compression together with line numbers, all highlighted code Consider this following code snippet, intended to highlight a simple Ruby program:
needs to be wrapped using one of the following workarounds.
(The variable name `some_var` can be changed to avoid clashes; it can also
be replaced by `code` -- but note that `code=code` cannot be removed).
### Code fences (three backticks)
{% highlight default %}
{% raw %}{% capture some_var %}
```some_language
Some code
``` ```
{% endcapture %} {% raw %}{% highlight ruby linenos %}
{% assign some_var = some_var | markdownify %}
{% include fix_linenos.html code=some_var %}{% endraw %}
{% endhighlight %}
### Liquid highlighting
{% highlight default %}
{% raw %}{% capture some_var %}
{% highlight some_language linenos %}
Some code
{% endhighlight %}
{% endcapture %}
{% include fix_linenos.html code=some_var %}{% endraw %}
{% endhighlight %}
_Credit:_ The original version of the above workaround was suggested by
Dmitry Hrabrov at
<https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901>.
## Examples
✅ Using code fences + workaround (will only show line numbers if enabled globally in `_config.yml`):
{% capture code_fence %}
```js
// Javascript code with syntax highlighting in fences
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l)
return true;
}
```
{% endcapture %}
{% assign code_fence = code_fence | markdownify %}
{% include fix_linenos.html code=code_fence %}
✅ Using liquid highlighting + workaround:
{% capture code %}
{% highlight ruby linenos %}
# Ruby code with syntax highlighting and fixed line numbers using Liquid
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
{% endhighlight %}
{% endcapture %}
{% include fix_linenos.html code=code %}
{% assign code = nil %}
Narrow code stays close to the line numbers:
{% capture code %}
{% highlight ruby linenos %}
def foo def foo
puts 'foo' puts 'foo'
end end
{% endhighlight %} {% endhighlight %}{% endraw %}
{% endcapture %} ```
{% include fix_linenos.html code=code %}
{% assign code = nil %}
{: .warning } If this is directly placed within a file processed by Jekyll (via Just the Docs, with HTML compression enabled), the following markup will be generated:
The following generates **incorrect** and **invalid** HTML. It should not be used as a positive example; the improper layout (with the broken HTML tags) is intentional.
❌ With the compression options used for the theme docs, the following example illustrates ```html
the **incorrect** formatting arising from the incompatibility of HTML compression <figure class="highlight">><code class="language-ruby" data-lang="ruby"><div class="table-wrapper"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
and the non-conforming HTML produced by Jekyll for line numbers: 2
3
</pre><td class="code"><pre><span class="k">def</span> <span class="nf">foo</span>
<span class="nb">puts</span> <span class="s1">'foo'</span>
<span class="k">end</span>
</pre></figure>
```
{% highlight ruby linenos %} This HTML is invalid; in particular, there are two issues:
def foo
puts 'foo' 1. there are many missing closing tags, and a superfluous `>`, which produce visually garbled output
end 2. a `<table>` is placed within a `<code>` element, which is syntactically invalid HTML (but is often allowed by browsers)
{% endhighlight %}
To emphasize this first difference, here is the same markup output, indented by tag:
```html
<figure class="highlight">
>
<code class="language-ruby" data-lang="ruby">
<div class="table-wrapper">
<table class="rouge-table">
<tbody>
<tr>
<td class="gutter gl">
<pre class="lineno">
1
2
3
</pre>
<td class="code">
<pre>
<span class="k">def</span>
<span class="nf">foo</span>
<span class="nb">puts</span>
<span class="s1">'foo'</span>
<span class="k">end</span>
</pre>
</figure>
```
In order, there are missing `</td>`, `</td>`, `</tr>`, `</tbody>`, `</table>`, `</div>`, and `</code>` tags. As a result, the following elements of the page - including the site footer - become visually garbled as browsers attempt to recover gracefully.
Prior workarounds we suggested (such as [Dmitry Hrabrov's in `jekyll-compress-html`#71](https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901)) resolve the missing tag problem. However, they still place a `<table>` within a `<code>` element. The HTML spec normatively states that `<code>` elements should only contain "[phrasing content](https://html.spec.whatwg.org/multipage/dom.html#phrasing-content-2)", which does not include `<table>` ([spec ref](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-code-element)). To avoid incorrectly rendered HTML, the previously-suggested workaround using the current version of `_includes/fix_linenos.html` should _not_ be used!

View File

@@ -1,3 +1 @@
root: _site root: _site
blacklist:
- "line-numbers"

View File

@@ -2,7 +2,7 @@
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = "just-the-docs" spec.name = "just-the-docs"
spec.version = "0.7.0" spec.version = "0.9.0"
spec.authors = ["Patrick Marsceill", "Matthew Wang"] spec.authors = ["Patrick Marsceill", "Matthew Wang"]
spec.email = ["patrick.marsceill@gmail.com", "matt@matthewwang.me"] spec.email = ["patrick.marsceill@gmail.com", "matt@matthewwang.me"]

View File

@@ -9,6 +9,7 @@ namespace :search do
File.open('assets/js/zzzz-search-data.json', 'w') do |f| File.open('assets/js/zzzz-search-data.json', 'w') do |f|
f.puts '--- f.puts '---
layout: null
permalink: /assets/js/search-data.json permalink: /assets/js/search-data.json
--- ---
{ {

1829
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,9 +7,9 @@
"bugs": "https://github.com/just-the-docs/just-the-docs/issues", "bugs": "https://github.com/just-the-docs/just-the-docs/issues",
"devDependencies": { "devDependencies": {
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^3.0.3", "prettier": "^3.3.3",
"stylelint": "^15.11.0", "stylelint": "^16.8.1",
"stylelint-config-standard-scss": "^11.0.0" "stylelint-config-standard-scss": "^13.1.0"
}, },
"scripts": { "scripts": {
"lint": "npm-run-all --parallel --continue-on-error lint:*", "lint": "npm-run-all --parallel --continue-on-error lint:*",
@@ -22,8 +22,7 @@
"ignoreFiles": [ "ignoreFiles": [
"assets/css/just-the-docs-default.scss", "assets/css/just-the-docs-default.scss",
"assets/css/just-the-docs-light.scss", "assets/css/just-the-docs-light.scss",
"assets/css/just-the-docs-dark.scss", "assets/css/just-the-docs-dark.scss"
"_sass/vendor/**/*.scss"
], ],
"extends": [ "extends": [
"stylelint-config-standard-scss" "stylelint-config-standard-scss"