From 7a4865a4690c3e897d8a63e08d1e299173c9996c Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 24 Apr 2023 16:16:15 -0700 Subject: [PATCH 01/52] Remove unused `release-drafter` action (#1237) --- .github/release-drafter.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 6a1034e..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,35 +0,0 @@ -references: - - v+ - - main -name-template: "v$RESOLVED_VERSION 🌈" -tag-template: "v$RESOLVED_VERSION" -categories: - - title: "🚀 Features" - labels: - - "feature" - - "enhancement" - - title: "🐛 Bug Fixes" - labels: - - "fix" - - "bugfix" - - "bug" - - title: "🧰 Maintenance" - label: - - "chore" - - "dependencies" -change-template: "- $TITLE @$AUTHOR (#$NUMBER)" -version-resolver: - major: - labels: - - "next-major-release" - minor: - labels: - - "next-minor-release" - patch: - labels: - - "patch" - default: minor -template: | - ## Changes - - $CHANGES From 3723875b93063d373a09298bc2d84dee9077297a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Apr 2023 09:39:02 -0700 Subject: [PATCH 02/52] Bump stylelint-config-standard-scss from 8.0.0 to 9.0.0 (#1238) Bumps [stylelint-config-standard-scss](https://github.com/stylelint-scss/stylelint-config-standard-scss) from 8.0.0 to 9.0.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/v8.0.0...v9.0.0) --- updated-dependencies: - dependency-name: stylelint-config-standard-scss dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 74 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index e913983..0da4791 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "npm-run-all": "^4.1.5", "prettier": "^2.8.8", "stylelint": "^15.6.0", - "stylelint-config-standard-scss": "^8.0.0" + "stylelint-config-standard-scss": "^9.0.0" } }, "node_modules/@babel/code-frame": { @@ -2630,27 +2630,27 @@ } }, "node_modules/stylelint-config-recommended": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-11.0.0.tgz", - "integrity": "sha512-SoGIHNI748OCZn6BxFYT83ytWoYETCINVHV3LKScVAWQQauWdvmdDqJC5YXWjpBbxg2E761Tg5aUGKLFOVhEkA==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", + "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", "dev": true, "peerDependencies": { - "stylelint": "^15.3.0" + "stylelint": "^15.5.0" } }, "node_modules/stylelint-config-recommended-scss": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-10.0.0.tgz", - "integrity": "sha512-+YvPgUHi0W5mCJCKdupBCIsWPYNbWuJcRmFtSYujwNg+41ljFknhO9bpY6C+oahv659zW7W1AT7i6DQvJYYr1A==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-11.0.0.tgz", + "integrity": "sha512-EDghTDU7aOv2LTsRZvcT1w8mcjUaMhuy+t38iV5I/0Qiu6ixdkRwhLEMul3K/fnB2v9Nwqvb3xpvJfPH+HduDw==", "dev": true, "dependencies": { "postcss-scss": "^4.0.6", - "stylelint-config-recommended": "^11.0.0", + "stylelint-config-recommended": "^12.0.0", "stylelint-scss": "^4.6.0" }, "peerDependencies": { "postcss": "^8.3.3", - "stylelint": "^15.3.0" + "stylelint": "^15.5.0" }, "peerDependenciesMeta": { "postcss": { @@ -2659,29 +2659,29 @@ } }, "node_modules/stylelint-config-standard": { - "version": "32.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-32.0.0.tgz", - "integrity": "sha512-UnGJxYDyYFrIE9CjDMZRkrNh2o4lOtO+MVZ9qG5b8yARfsWho0GMx4YvhHfsv8zKKgHeWX2wfeyxmuoqcaYZ4w==", + "version": "33.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz", + "integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==", "dev": true, "dependencies": { - "stylelint-config-recommended": "^11.0.0" + "stylelint-config-recommended": "^12.0.0" }, "peerDependencies": { - "stylelint": "^15.4.0" + "stylelint": "^15.5.0" } }, "node_modules/stylelint-config-standard-scss": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-8.0.0.tgz", - "integrity": "sha512-TDT/gJD/0LUDoUgkjF1uoI/4DfczXHxg7gJVcWT4/JbE6k5hszVuI14reNX+tEwSyMNhcK2BA7izrK+uVAz7XA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-9.0.0.tgz", + "integrity": "sha512-yPKpJsrZn4ybuQZx/DkEHuCjw7pJginErE/47dFhCnrvD48IJ4UYec8tSiCuJWMA3HRjbIa3nh5ZeSauDGuVAg==", "dev": true, "dependencies": { - "stylelint-config-recommended-scss": "^10.0.0", - "stylelint-config-standard": "^32.0.0" + "stylelint-config-recommended-scss": "^11.0.0", + "stylelint-config-standard": "^33.0.0" }, "peerDependencies": { "postcss": "^8.3.3", - "stylelint": "^15.4.0" + "stylelint": "^15.5.0" }, "peerDependenciesMeta": { "postcss": { @@ -4850,40 +4850,40 @@ } }, "stylelint-config-recommended": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-11.0.0.tgz", - "integrity": "sha512-SoGIHNI748OCZn6BxFYT83ytWoYETCINVHV3LKScVAWQQauWdvmdDqJC5YXWjpBbxg2E761Tg5aUGKLFOVhEkA==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", + "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", "dev": true, "requires": {} }, "stylelint-config-recommended-scss": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-10.0.0.tgz", - "integrity": "sha512-+YvPgUHi0W5mCJCKdupBCIsWPYNbWuJcRmFtSYujwNg+41ljFknhO9bpY6C+oahv659zW7W1AT7i6DQvJYYr1A==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-11.0.0.tgz", + "integrity": "sha512-EDghTDU7aOv2LTsRZvcT1w8mcjUaMhuy+t38iV5I/0Qiu6ixdkRwhLEMul3K/fnB2v9Nwqvb3xpvJfPH+HduDw==", "dev": true, "requires": { "postcss-scss": "^4.0.6", - "stylelint-config-recommended": "^11.0.0", + "stylelint-config-recommended": "^12.0.0", "stylelint-scss": "^4.6.0" } }, "stylelint-config-standard": { - "version": "32.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-32.0.0.tgz", - "integrity": "sha512-UnGJxYDyYFrIE9CjDMZRkrNh2o4lOtO+MVZ9qG5b8yARfsWho0GMx4YvhHfsv8zKKgHeWX2wfeyxmuoqcaYZ4w==", + "version": "33.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz", + "integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==", "dev": true, "requires": { - "stylelint-config-recommended": "^11.0.0" + "stylelint-config-recommended": "^12.0.0" } }, "stylelint-config-standard-scss": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-8.0.0.tgz", - "integrity": "sha512-TDT/gJD/0LUDoUgkjF1uoI/4DfczXHxg7gJVcWT4/JbE6k5hszVuI14reNX+tEwSyMNhcK2BA7izrK+uVAz7XA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-9.0.0.tgz", + "integrity": "sha512-yPKpJsrZn4ybuQZx/DkEHuCjw7pJginErE/47dFhCnrvD48IJ4UYec8tSiCuJWMA3HRjbIa3nh5ZeSauDGuVAg==", "dev": true, "requires": { - "stylelint-config-recommended-scss": "^10.0.0", - "stylelint-config-standard": "^32.0.0" + "stylelint-config-recommended-scss": "^11.0.0", + "stylelint-config-standard": "^33.0.0" } }, "stylelint-scss": { diff --git a/package.json b/package.json index 9428e11..5a8d894 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "npm-run-all": "^4.1.5", "prettier": "^2.8.8", "stylelint": "^15.6.0", - "stylelint-config-standard-scss": "^8.0.0" + "stylelint-config-standard-scss": "^9.0.0" }, "scripts": { "lint": "npm-run-all --parallel --continue-on-error lint:*", From e64d97c4c820babc7d8c71f8a6d17ad99f453aeb Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Tue, 25 Apr 2023 09:46:42 -0700 Subject: [PATCH 03/52] Fix context-based media feature (not supported by Safari `<16.4` (#1240) Realized that the new syntax is only supported on [Safari 16.4](https://caniuse.com/css-media-range-syntax), which is gated by OS updates. Going to revert this change for the foreseeable future. Closes #1239. --- _sass/support/mixins/_layout.scss | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/_sass/support/mixins/_layout.scss b/_sass/support/mixins/_layout.scss index 89b6e11..428dec6 100644 --- a/_sass/support/mixins/_layout.scss +++ b/_sass/support/mixins/_layout.scss @@ -12,7 +12,7 @@ // If the key exists in the map @if $value { // Prints a media query based on the value - @media (width >= rem($value)) { + @media (min-width: rem($value)) { @content; } } @else { diff --git a/package.json b/package.json index 5a8d894..50525c3 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "alpha-value-notation": null, "at-rule-empty-line-before": null, "color-function-notation": null, + "media-feature-range-notation": "prefix", "no-descending-specificity": null, "scss/no-global-function-names": null } From aaf5a68154507cc5b16e1b0c239c481c8fbe3a1e Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Tue, 25 Apr 2023 09:51:08 -0700 Subject: [PATCH 04/52] Prep `v0.5.1` --- CHANGELOG.md | 40 +++++++++++++++++++++++++++++++++++++++- just-the-docs.gemspec | 2 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7b0c70..27e1e1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,20 +20,58 @@ This website includes docs for some new features that are not available in `v0.5 Code changes to `main` that are *not* in the latest release: -- Fixed: disable copy code button in insecure contexts [@rmoff] in [#1226] +- N/A Docs changes in `main` that are *not* in the latest release: +- N/A + +## Release v0.5.1 + +Hi all, this is a very small minor patch release that has two small behavioral bugfixes: fixing a regression introduced in `v0.5.0` on Safari versions `<16.4` (broken media query), and the copy code button providing incorrect feedback in insecure browser contexts. This should be a smooth upgrade with no breaking changes. + +As always, we'd love your feedback. [Open an issue](https://github.com/just-the-docs/just-the-docs/issues) or [start a discussion](https://github.com/just-the-docs/just-the-docs/discussions) for bug reports, feature requests, and any other feedback. Thanks for continuing to use Just the Docs! + +### Using Release `v0.5.1` + +Users who have not pinned the theme version will be **automatically upgraded to `v0.5.1` 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.5.1 +``` + +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.5.1" +``` + +To use and pin a previous version of the theme, replace the `0.5.1` with the desired release tag. + +### Bugfixes + + +- Fixed: disable copy code button in insecure contexts [@rmoff] in [#1226] +- Fixed: context-based media feature not supported by Safari `<16.4` by [@mattxwang] in [#1240] + +### Documentation + - Added: document copy code button requiring secure context by [@rmoff] in [#1225] - Fixed: typo ("them" → "theme") in MIGRATION.md by [@waldyrious] in [#1219] - Fixed: `font-weight` typo (Utilities > Typography) by [@mattxwang] in [#1229] - Fixed: `just the docs` typo in migration guide by [@mattxwang] in [#1230] +### New Contributors +- [@rmoff] made their first contribution in [#1225] + [#1219]: https://github.com/just-the-docs/just-the-docs/pull/1219 [#1225]: https://github.com/just-the-docs/just-the-docs/pull/1225 [#1226]: https://github.com/just-the-docs/just-the-docs/pull/1226 [#1229]: https://github.com/just-the-docs/just-the-docs/pull/1229 [#1230]: https://github.com/just-the-docs/just-the-docs/pull/1230 +[#1240]: https://github.com/just-the-docs/just-the-docs/pull/1240 [@rmoff]: https://github.com/rmoff diff --git a/just-the-docs.gemspec b/just-the-docs.gemspec index ba84aa5..c91d7f7 100644 --- a/just-the-docs.gemspec +++ b/just-the-docs.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "just-the-docs" - spec.version = "0.5.0" + spec.version = "0.5.1" spec.authors = ["Patrick Marsceill", "Matthew Wang"] spec.email = ["patrick.marsceill@gmail.com", "matt@matthewwang.me"] From 3048541778d143537609482e8071e07464baefc3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 May 2023 09:31:07 -0700 Subject: [PATCH 05/52] Bump stylelint from 15.6.0 to 15.6.1 (#1246) Bumps [stylelint](https://github.com/stylelint/stylelint) from 15.6.0 to 15.6.1. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/15.6.0...15.6.1) --- updated-dependencies: - dependency-name: stylelint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 74 +++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 41 insertions(+), 35 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0da4791..c39abaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "npm-run-all": "^4.1.5", "prettier": "^2.8.8", - "stylelint": "^15.6.0", + "stylelint": "^15.6.1", "stylelint-config-standard-scss": "^9.0.0" } }, @@ -2031,9 +2031,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz", - "integrity": "sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==", + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.12.tgz", + "integrity": "sha512-NdxGCAZdRrwVI1sy59+Wzrh+pMMHxapGnpfenDVlMEXoOcvt4pGE0JLK9YY2F5dLxcFYA/YbVQKhcGU+FtSYQg==", "dev": true, "dependencies": { "cssesc": "^3.0.0", @@ -2366,10 +2366,16 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", + "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/slash": { "version": "3.0.0", @@ -2570,9 +2576,9 @@ "dev": true }, "node_modules/stylelint": { - "version": "15.6.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.6.0.tgz", - "integrity": "sha512-Cqzpc8tvJm77KaM8qUbhpJ/UYK55Ia0whQXj4b9IId9dlPICO7J8Lyo15SZWiHxKjlvy3p5FQor/3n6i8ignXg==", + "version": "15.6.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.6.1.tgz", + "integrity": "sha512-d8icFBlVl93Elf3Z5ABQNOCe4nx69is3D/NZhDLAie1eyYnpxfeKe7pCfqzT5W4F8vxHCLSDfV8nKNJzogvV2Q==", "dev": true, "dependencies": { "@csstools/css-parser-algorithms": "^2.1.1", @@ -2602,11 +2608,11 @@ "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.4.22", + "postcss": "^8.4.23", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.11", + "postcss-selector-parser": "^6.0.12", "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "string-width": "^4.2.3", @@ -2616,7 +2622,7 @@ "svg-tags": "^1.0.0", "table": "^6.8.1", "v8-compile-cache": "^2.3.0", - "write-file-atomic": "^5.0.0" + "write-file-atomic": "^5.0.1" }, "bin": { "stylelint": "bin/stylelint.js" @@ -2933,13 +2939,13 @@ "dev": true }, "node_modules/write-file-atomic": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.0.tgz", - "integrity": "sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, "dependencies": { "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" + "signal-exit": "^4.0.1" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -4416,9 +4422,9 @@ "requires": {} }, "postcss-selector-parser": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz", - "integrity": "sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==", + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.12.tgz", + "integrity": "sha512-NdxGCAZdRrwVI1sy59+Wzrh+pMMHxapGnpfenDVlMEXoOcvt4pGE0JLK9YY2F5dLxcFYA/YbVQKhcGU+FtSYQg==", "dev": true, "requires": { "cssesc": "^3.0.0", @@ -4639,9 +4645,9 @@ } }, "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", + "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", "dev": true }, "slash": { @@ -4800,9 +4806,9 @@ "dev": true }, "stylelint": { - "version": "15.6.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.6.0.tgz", - "integrity": "sha512-Cqzpc8tvJm77KaM8qUbhpJ/UYK55Ia0whQXj4b9IId9dlPICO7J8Lyo15SZWiHxKjlvy3p5FQor/3n6i8ignXg==", + "version": "15.6.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.6.1.tgz", + "integrity": "sha512-d8icFBlVl93Elf3Z5ABQNOCe4nx69is3D/NZhDLAie1eyYnpxfeKe7pCfqzT5W4F8vxHCLSDfV8nKNJzogvV2Q==", "dev": true, "requires": { "@csstools/css-parser-algorithms": "^2.1.1", @@ -4832,11 +4838,11 @@ "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.4.22", + "postcss": "^8.4.23", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.11", + "postcss-selector-parser": "^6.0.12", "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "string-width": "^4.2.3", @@ -4846,7 +4852,7 @@ "svg-tags": "^1.0.0", "table": "^6.8.1", "v8-compile-cache": "^2.3.0", - "write-file-atomic": "^5.0.0" + "write-file-atomic": "^5.0.1" } }, "stylelint-config-recommended": { @@ -5078,13 +5084,13 @@ "dev": true }, "write-file-atomic": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.0.tgz", - "integrity": "sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, "requires": { "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" + "signal-exit": "^4.0.1" } }, "yallist": { diff --git a/package.json b/package.json index 50525c3..7cd5d13 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "devDependencies": { "npm-run-all": "^4.1.5", "prettier": "^2.8.8", - "stylelint": "^15.6.0", + "stylelint": "^15.6.1", "stylelint-config-standard-scss": "^9.0.0" }, "scripts": { From 8e38759613c027477764f2f60fbf5ed3550fbca0 Mon Sep 17 00:00:00 2001 From: Peter Mosses <18308236+pdmosses@users.noreply.github.com> Date: Tue, 9 May 2023 17:57:26 +0200 Subject: [PATCH 06/52] Fix liquid variable leakage in navigation components (#1243) * Refactor nav, breadcrumbs, children_nav Fix #1118 Improve the modularity of building the nav-panel, breadcrumbs, and children-nav by making them independent. This also significantly simplifies the Liquid code. * Fix order of breadcrumbs * Update breadcrumbs.html Revert inclusion of single breadcrumb for top-level pages. * Update breadcrumbs.html * Update children_nav.html Revert to the previous layout in the HTML, to allow the use of `diff` to check the built site. * Update minimal.html Remove the previously required workaround involving `nav.html`. * Add docs pages about layouts The aim of the initial version of these docs pages is to illustrate the difference between the default and minimal layouts. * Update CHANGELOG.md --- CHANGELOG.md | 4 +- _includes/components/breadcrumbs.html | 58 ++++++-- _includes/components/children_nav.html | 34 ++++- _includes/nav.html | 191 +++---------------------- _includes/sorted_pages.html | 95 ++++++++++++ _layouts/default.html | 2 +- _layouts/minimal.html | 28 +--- docs/layout/layout.md | 40 ++++++ docs/layout/minimal/default-child.md | 8 ++ docs/layout/minimal/minimal-child.md | 8 ++ docs/layout/minimal/minimal.md | 12 ++ 11 files changed, 263 insertions(+), 217 deletions(-) create mode 100644 _includes/sorted_pages.html create mode 100644 docs/layout/layout.md create mode 100644 docs/layout/minimal/default-child.md create mode 100644 docs/layout/minimal/minimal-child.md create mode 100644 docs/layout/minimal/minimal.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 27e1e1d..f18e399 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,12 +20,14 @@ This website includes docs for some new features that are not available in `v0.5 Code changes to `main` that are *not* in the latest release: -- N/A +- Fixed: liquid variable leakage in navigation components by [@pdmosses] in [#1243] Docs changes in `main` that are *not* in the latest release: - N/A +[#1243]: https://github.com/just-the-docs/just-the-docs/pull/1243 + ## Release v0.5.1 Hi all, this is a very small minor patch release that has two small behavioral bugfixes: fixing a regression introduced in `v0.5.0` on Safari versions `<16.4` (broken media query), and the copy code button providing incorrect feedback in insecure browser contexts. This should be a smooth upgrade with no breaking changes. diff --git a/_includes/components/breadcrumbs.html b/_includes/components/breadcrumbs.html index f1bc488..82ad6bd 100644 --- a/_includes/components/breadcrumbs.html +++ b/_includes/components/breadcrumbs.html @@ -1,15 +1,43 @@ -{% unless page.url == "/" %} - {% if page.parent %} - - {% endif %} -{% endunless %} +{%- comment -%} + Include as: {%- include components/breadcrumbs.html -%} + Depends on: page, site. + Results in: HTML for the breadcrumbs component. + Overwrites: + pages_list, parent_page, grandparent_page. +{%- endcomment -%} + +{%- if page.url != "/" and page.parent -%} + + {%- assign pages_list = site[page.collection] + | default: site.html_pages + | where_exp: "item", "item.title != nil" + | where_exp: "item", "item.has_children != nil" -%} + + {%- if page.grand_parent -%} + {%- assign parent_page = pages_list + | where: "title", page.parent + | where: "parent", page.grand_parent + | first -%} + {%- assign grandparent_page = pages_list + | where: "title", page.grand_parent + | first -%} + {%- else -%} + {%- assign parent_page = pages_list + | where: "title", page.parent + | where_exp: "item", "item.parent == nil" + | first -%} + {%- endif -%} + + + +{%- endif -%} diff --git a/_includes/components/children_nav.html b/_includes/components/children_nav.html index e76f98d..ce2482a 100644 --- a/_includes/components/children_nav.html +++ b/_includes/components/children_nav.html @@ -1,9 +1,33 @@ +{%- comment -%} + Include as: {%- include components/children_nav.html -%} + Depends on: page, site. + Results in: HTML for the children-navigation component. + Includes: + sorted_pages.html + toc_heading_custom.html + Overwrites: + child_pages. +{%- endcomment -%} + +{%- if page.has_children == true and page.has_toc != false -%} + {%- assign child_pages = site[page.collection] + | default: site.html_pages + | where: "parent", page.title + | where: "grand_parent", page.parent -%} + + {%- include sorted_pages.html pages = child_pages -%} + + {%- if page.child_nav_order == 'desc' or page.child_nav_order == 'reversed' -%} + {%- assign sorted_pages = sorted_pages | reverse -%} + {%- endif -%} +{%- endif -%} +
{% include toc_heading_custom.html %}
    - {% for child in include.toc_list %} -
  • - {{ child.title }}{% if child.summary %} - {{ child.summary }}{% endif %} -
  • - {% endfor %} +{% for child in sorted_pages %} +
  • + {{ child.title }}{% if child.summary %} - {{ child.summary }}{% endif %} +
  • +{% endfor %}
diff --git a/_includes/nav.html b/_includes/nav.html index e80dfcd..422f833 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -1,137 +1,31 @@ {%- comment -%} - The `nav_order` values of pages affect the order in which they are shown in - the navigation panel and in the automatically generated tables of contents. - Sibling pages with the same `nav_order` value may be shown in any order. - Sibling pages with no `nav_order` value are shown after all pages that have - explicit `nav_order` values, ordered by their `title` values. - - The `nav_order` and `title` values can be numbers or strings. To avoid build - failures, we sort numbers and strings separately. We sort numbers by their - values, and strings lexicographically. The case-sensitivity of string sorting - is determined by the configuration setting of `nav_sort`. Pages with no `title` - value are excluded from the navigation. - - Note: Numbers used as `title` or `nav_order` values should not be in quotes, - unless you intend them to be lexicographically ordered. Numbers are written - without spaces or thousands-separators. Negative numbers are preceded by `-`. - Floats are written with the integral and fractional parts separated by `.`. - (Bounds on the magnitude and precision are presumably the same as in Liquid.) + Include as: {%- include nav.html pages = pages key = key -%} + Depends on: include.pages, include.key, page, site. + Results in: HTML for the navigation panel. + Includes: + sorted_pages.html + Overwrites: + nav_pages, first_level_pages, second_level_pages, third_level_pages, + node, children_list, child, grand_children_list, grand_child. {%- endcomment -%} -{%- assign title_pages = include.pages - | where_exp: "item", "item.title != nil" -%} +{%- assign nav_pages = include.pages + | where_exp: "item", "item.title != nil" + | where_exp: "item", "item.nav_exclude != true" -%} + +{%- include sorted_pages.html pages = nav_pages -%} + +{%- assign first_level_pages = sorted_pages + | where_exp: "item", "item.parent == nil" -%} +{%- assign second_level_pages = sorted_pages + | where_exp: "item", "item.parent != nil" + | where_exp: "item", "item.grand_parent == nil" -%} +{%- assign third_level_pages = sorted_pages + | where_exp: "item", "item.grand_parent != nil" -%} {%- comment -%} - A page with `nav_exclude: true` does not appear in the main navigation. - If it has a `parent`, it may appear in the parent's table of contents. - If it specifies `has_children: true`, it should appear in the breadcrumbs - of the child pages, but its order in relation to other pages is irrelevant. - Pages that never appear can be removed from the pages that need to be sorted. - This optimisation can be significant on a site with many pages. - - In Jekyll 4, the pages to be sorted can be filtered by: - - {%- assign title_pages = title_pages - | where_exp: "item", "item.nav_exclude != true or item.parent != nil" -%} - - That filter is not allowed in Jekyll 3. The following iterative code gives the - same effect, but it is activated only when it will filter more than 50% of the - pages. -{%- endcomment -%} - -{%- unless title_pages == empty -%} - {%- assign unsorted_pages = title_pages - | where_exp: "item", "item.parent == nil" - | where_exp: "item", "item.nav_exclude == true" -%} - {%- assign title_pages_size = title_pages.size -%} - {%- assign unsorted_pages_percent = unsorted_pages.size - | times: 100 | divided_by: title_pages_size -%} - {%- if unsorted_pages_percent > 50 -%} - {%- assign sorted_pages = "" | split: "" -%} - {%- for item in title_pages -%} - {%- if item.nav_exclude != true or item.parent -%} - {%- assign sorted_pages = sorted_pages | push: item -%} - {%- endif -%} - {%- endfor -%} - {%- assign title_pages = sorted_pages -%} - {%- endif -%} -{%- endunless -%} - -{%- assign nav_order_pages = title_pages - | where_exp: "item", "item.nav_order != nil" -%} -{%- assign title_order_pages = title_pages - | where_exp: "item", "item.nav_order == nil" -%} - -{%- comment -%} - Divide the arrays of `nav_order_pages` and `title_order_pages` according to - the type of value. - - The first character of the result of `jsonify` is `"` only for strings. - Grouping by a single character also ensures the number of groups is small. -{%- endcomment -%} - -{%- assign nav_number_pages = "" | split: "" -%} -{%- assign nav_string_pages = "" | split: "" -%} -{%- assign nav_order_groups = nav_order_pages - | group_by_exp: "item", "item.nav_order | jsonify | slice: 0" -%} -{%- for group in nav_order_groups -%} - {%- if group.name == '"' -%} - {%- assign nav_string_pages = group.items -%} - {%- else -%} - {%- assign nav_number_pages = nav_number_pages | concat: group.items -%} - {%- endif -%} -{%- endfor -%} - -{%- unless nav_number_pages == empty -%} - {%- assign nav_number_pages = nav_number_pages | sort: "nav_order" -%} -{%- endunless -%} - -{%- unless nav_string_pages == empty -%} - {%- if site.nav_sort == 'case_insensitive' -%} - {%- assign nav_string_pages = nav_string_pages | sort_natural: "nav_order" -%} - {%- else -%} - {%- assign nav_string_pages = nav_string_pages | sort: "nav_order" -%} - {%- endif -%} -{%- endunless -%} - -{%- assign title_number_pages = "" | split: "" -%} -{%- assign title_string_pages = "" | split: "" -%} -{%- assign title_order_groups = title_order_pages - | group_by_exp: "item", "item.title | jsonify | slice: 0" -%} -{%- for group in title_order_groups -%} - {%- if group.name == '"' -%} - {%- assign title_string_pages = group.items -%} - {%- else -%} - {%- assign title_number_pages = title_number_pages | concat: group.items -%} - {%- endif -%} -{%- endfor -%} - -{%- unless title_number_pages == empty -%} - {%- assign title_number_pages = title_number_pages | sort: "title" -%} -{%- endunless -%} - -{%- unless title_string_pages == empty -%} - {%- if site.nav_sort == 'case_insensitive' -%} - {%- assign title_string_pages = title_string_pages | sort_natural: "title" -%} - {%- else -%} - {%- assign title_string_pages = title_string_pages | sort: "title" -%} - {%- endif -%} -{%- endunless -%} - -{%- assign pages_list = nav_number_pages | concat: nav_string_pages - | concat: title_number_pages | concat: title_string_pages -%} - -{%- assign first_level_pages = pages_list - | where_exp: "item", "item.parent == nil" -%} -{%- assign second_level_pages = pages_list - | where_exp: "item", "item.parent != nil" - | where_exp: "item", "item.grand_parent == nil" -%} -{%- assign third_level_pages = pages_list - | where_exp: "item", "item.grand_parent != nil" -%} - -{%- comment -%} - The order of sibling pages in `pages_list` determines the order of display of - links to them in lists of navigation links and in auto-generated TOCs. + The order of sibling pages in `sorted_pages` determines the order of display of + links to them in lists of navigation links. Note that Liquid evaluates conditions from right to left (and it does not allow the use of parentheses). Some conditions are not so easy to express clearly... @@ -210,42 +104,3 @@ {%- endunless -%} {%- endfor -%} - -{%- comment -%} - `page.collection` is the name of the Jekyll collection that contains the page, - if any, and otherwise nil. Similarly for `include.key`. - - If the current page is in the collection (if any) whose navigation is currently - being generated, the following code sets `first_level_url` to the URL used in - the page's top-level breadcrumb (if any), and `second_level_url` to that used - in the page's second-level breadcrumb (if any). - - For pages with children, the code also sets `toc_list` to the list of child pages, - reversing the order if needed. -{%- endcomment -%} - -{%- if page.collection == include.key -%} - {%- for node in first_level_pages -%} - {%- if page.grand_parent == node.title or page.parent == node.title and page.grand_parent == nil -%} - {%- assign first_level_url = node.url | relative_url -%} - {%- endif -%} - {%- if node.has_children -%} - {%- assign children_list = second_level_pages | where: "parent", node.title -%} - {%- for child in children_list -%} - {%- if child.has_children -%} - {%- if page.url == child.url or page.parent == child.title and page.grand_parent == child.parent -%} - {%- assign second_level_url = child.url | relative_url -%} - {%- endif -%} - {%- endif -%} - {%- endfor -%} - {%- endif -%} - {%- endfor -%} - {%- if page.has_children == true and page.has_toc != false -%} - {%- assign toc_list = pages_list - | where: "parent", page.title - | where_exp: "item", "item.grand_parent == page.parent" -%} - {%- if page.child_nav_order == 'desc' or page.child_nav_order == 'reversed' -%} - {%- assign toc_list = toc_list | reverse -%} - {%- endif -%} - {%- endif -%} -{%- endif -%} diff --git a/_includes/sorted_pages.html b/_includes/sorted_pages.html new file mode 100644 index 0000000..0870aab --- /dev/null +++ b/_includes/sorted_pages.html @@ -0,0 +1,95 @@ +{%- comment -%} + Include as: {%- include sorted_pages.html pages = pages -%} + Depends on: include.pages. + Assigns to: sorted_pages. + Overwrites: + nav_order_pages, title_order_pages, + nav_number_pages, nav_string_pages, nav_order_groups, group, + title_number_pages, title_string_pages, title_order_groups. +{%- endcomment -%} + +{%- comment -%} + The `nav_order` values of pages affect the order in which they are shown in + the navigation panel and in the automatically generated tables of contents. + Sibling pages with the same `nav_order` value may be shown in any order. + Sibling pages with no `nav_order` value are shown after all pages that have + explicit `nav_order` values, ordered by their `title` values. + + The `nav_order` and `title` values can be numbers or strings. To avoid build + failures, we sort numbers and strings separately. We sort numbers by their + values, and strings lexicographically. The case-sensitivity of string sorting + is determined by the configuration setting of `nav_sort`. Pages with no `title` + value are excluded from the navigation. + + Note: Numbers used as `title` or `nav_order` values should not be in quotes, + unless you intend them to be lexicographically ordered. Numbers are written + without spaces or thousands-separators. Negative numbers are preceded by `-`. + Floats are written with the integral and fractional parts separated by `.`. + (Bounds on the magnitude and precision are presumably the same as in Liquid.) +{%- endcomment -%} + +{%- assign nav_order_pages = include.pages + | where_exp: "item", "item.nav_order != nil" -%} +{%- assign title_order_pages = include.pages + | where_exp: "item", "item.nav_order == nil" -%} + +{%- comment -%} + Divide the arrays of `nav_order_pages` and `title_order_pages` according to + the type of value. + + The first character of the result of `jsonify` is `"` only for strings. + Grouping by a single character also ensures the number of groups is small. +{%- endcomment -%} + +{%- assign nav_number_pages = "" | split: "" -%} +{%- assign nav_string_pages = "" | split: "" -%} +{%- assign nav_order_groups = nav_order_pages + | group_by_exp: "item", "item.nav_order | jsonify | slice: 0" -%} +{%- for group in nav_order_groups -%} + {%- if group.name == '"' -%} + {%- assign nav_string_pages = group.items -%} + {%- else -%} + {%- assign nav_number_pages = nav_number_pages | concat: group.items -%} + {%- endif -%} +{%- endfor -%} + +{%- unless nav_number_pages == empty -%} + {%- assign nav_number_pages = nav_number_pages | sort: "nav_order" -%} +{%- endunless -%} + +{%- unless nav_string_pages == empty -%} + {%- if site.nav_sort == 'case_insensitive' -%} + {%- assign nav_string_pages = nav_string_pages | sort_natural: "nav_order" -%} + {%- else -%} + {%- assign nav_string_pages = nav_string_pages | sort: "nav_order" -%} + {%- endif -%} +{%- endunless -%} + +{%- assign title_number_pages = "" | split: "" -%} +{%- assign title_string_pages = "" | split: "" -%} +{%- assign title_order_groups = title_order_pages + | group_by_exp: "item", "item.title | jsonify | slice: 0" -%} +{%- for group in title_order_groups -%} + {%- if group.name == '"' -%} + {%- assign title_string_pages = group.items -%} + {%- else -%} + {%- assign title_number_pages = title_number_pages | concat: group.items -%} + {%- endif -%} +{%- endfor -%} + +{%- unless title_number_pages == empty -%} + {%- assign title_number_pages = title_number_pages | sort: "title" -%} +{%- endunless -%} + +{%- unless title_string_pages == empty -%} + {%- if site.nav_sort == 'case_insensitive' -%} + {%- assign title_string_pages = title_string_pages | sort_natural: "title" -%} + {%- else -%} + {%- assign title_string_pages = title_string_pages | sort: "title" -%} + {%- endif -%} +{%- endunless -%} + +{%- assign sorted_pages = nav_number_pages + | concat: nav_string_pages + | concat: title_number_pages + | concat: title_string_pages -%} diff --git a/_layouts/default.html b/_layouts/default.html index 3bc0e0a..6be391e 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -22,7 +22,7 @@ layout: table_wrappers {% endif %} {% if page.has_children == true and page.has_toc != false %} - {% include components/children_nav.html toc_list=toc_list %} + {% include components/children_nav.html %} {% endif %} {% include components/footer.html %} diff --git a/_layouts/minimal.html b/_layouts/minimal.html index 0fb9511..854dbd0 100644 --- a/_layouts/minimal.html +++ b/_layouts/minimal.html @@ -9,32 +9,6 @@ layout: table_wrappers Skip to main content {% include icons/icons.html %} - {% comment %} - This is a bandaid fix to properly render breadcrumbs; as of now, there is some variable leakage between the sidebar component (which computes parents, grandparents) and the breadcrumbs component. We plan to remove this in a future release to deduplicate code. - - For more context, see https://github.com/just-the-docs/just-the-docs/pull/1058#discussion_r1057014053 - {% endcomment %} - {% capture nav %} - {% assign 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 pages_top_size > 0 %} - {% include nav.html pages=site.html_pages key=nil %} - {% endif %} - {% if site.just_the_docs.collections %} - {% assign collections_size = site.just_the_docs.collections | size %} - {% for collection_entry in site.just_the_docs.collections %} - {% assign collection_key = collection_entry[0] %} - {% assign collection_value = collection_entry[1] %} - {% assign collection = site[collection_key] %} - {% if collection_value.nav_exclude != true %} - {% include nav.html pages=collection key=collection_key %} - {% endif %} - {% endfor %} - {% endif %} - {% endcapture %}
{% include components/breadcrumbs.html %}
@@ -45,7 +19,7 @@ layout: table_wrappers {% endif %} {% if page.has_children == true and page.has_toc != false %} - {% include components/children_nav.html toc_list=toc_list %} + {% include components/children_nav.html %} {% endif %} {% include components/footer.html %} diff --git a/docs/layout/layout.md b/docs/layout/layout.md new file mode 100644 index 0000000..6bf3de9 --- /dev/null +++ b/docs/layout/layout.md @@ -0,0 +1,40 @@ +--- +title: Layout +layout: default +nav_order: 4.5 +has_children: true +--- + +# Layout + +You specify the layout for a page in its [front matter]. Just the Docs has a `default` layout with a sidebar, used for almost all pages in the theme docs, and a `minimal` layout that omits the sidebar. +{: .fs-6 .fw-300 } + +## The layout concept + +See the [Jekyll docs page about layouts] for an explanation of the general idea of layouts and how to specify them. + +You can use [Jekyll's front matter defaults] to specify the same layout for many pages. + +## The `default` layout + +This page uses the default layout. + +It is a *responsive* layout: on medium and larger width displays, it displays a sidebar, including a navigation panel; on smaller width displays, the sidebar is automatically hidden under a button. + +Each child (and grandchild) page of a top-level page has so-called *breadcrumbs*: links to its parent (and grandparent) pages. It shows the breadcrumbs above the main content of the page. + +Each page that has child pages generally has a list of links to those pages (you can suppress it by `has_toc: false` in the front matter). It shows the list as a *table of contents* below the main content. + +## The `minimal` layout + +A child and grandchild page of this page use the minimal layout. This differs from the default layout by omitting the sidebar -- and thereby also the navigation panel. To navigate between pages with the minimal layout, you can use the breadcrumbs and the tables of contents. + +## Other layouts + +Just the Docs has further layouts: `about`, `home`, `page`, and `post`. Currently, they are all based on the `default` layout. See the [Jekyll docs about inheritance] for how to customize them. + +[front matter]: https://jekyllrb.com/docs/front-matter/ "Jekyll docs about front matter" +[Jekyll docs page about layouts]: https://jekyllrb.com/docs/layouts/ "Jekyll docs about layouts" +[Jekyll's front matter defaults]: https://jekyllrb.com/docs/configuration/front-matter-defaults/ "Jekyll docs about front matter defaults" +[Jekyll docs about inheritance]: https://jekyllrb.com/docs/layouts/#inheritance "Jekyll docs about inheritance" diff --git a/docs/layout/minimal/default-child.md b/docs/layout/minimal/default-child.md new file mode 100644 index 0000000..3035580 --- /dev/null +++ b/docs/layout/minimal/default-child.md @@ -0,0 +1,8 @@ +--- +title: Default layout child page +layout: default +parent: A minimal layout page +grand_parent: Layout +--- + +This is a child page that uses the same minimal layout as its parent page. diff --git a/docs/layout/minimal/minimal-child.md b/docs/layout/minimal/minimal-child.md new file mode 100644 index 0000000..26bcff7 --- /dev/null +++ b/docs/layout/minimal/minimal-child.md @@ -0,0 +1,8 @@ +--- +title: Minimal layout child page +layout: minimal +parent: A minimal layout page +grand_parent: Layout +--- + +This is a child page that uses the same minimal layout as its parent page. diff --git a/docs/layout/minimal/minimal.md b/docs/layout/minimal/minimal.md new file mode 100644 index 0000000..1821d67 --- /dev/null +++ b/docs/layout/minimal/minimal.md @@ -0,0 +1,12 @@ +--- +title: A minimal layout page +layout: minimal +parent: Layout +has_children: true +--- + +# A minimal layout page + +This page illustrates the built-in layout `minimal`. + +One of its child pages also uses the minimal layout; the other child pages uses the default layout. From 0b93b35a3f53824269b9dd24c04a35d802c06f35 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Sun, 14 May 2023 22:06:14 -0700 Subject: [PATCH 07/52] Update canonical site domain to be `just-the-docs.com` (#1211) This PR locks in *almost* everything to switch over to [just-the-docs.com](https://just-the-docs.com)! It: - replaces all instances to the theme docs site (`https://just-the-docs.github.io/just-the-docs`) with `https://just-the-docs.com` - as @max06 has noted below, we do not change other links with the same `.github.io` prefix - changes the `site.url` and `site.baseurl` in the theme docs' `_config.yml` - adds a note in both the changelog and migration guide that a frozen version of `v0.3.3` docs is available at [https://v0-3-3-docs.just-the-docs.com/](https://v0-3-3-docs.just-the-docs.com/) Closes #1160. --- CHANGELOG.md | 22 ++++++++++++---------- MIGRATION.md | 4 ++-- README.md | 4 ++-- _config.yml | 4 ++-- index.md | 2 +- just-the-docs.gemspec | 2 +- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f18e399..d9fa56e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ Docs changes in `main` that are *not* in the latest release: [#1243]: https://github.com/just-the-docs/just-the-docs/pull/1243 +The theme docs website has a new canonical URL: . We've also retroactively published the theme docs website for version `v0.3.3` at . + ## Release v0.5.1 Hi all, this is a very small minor patch release that has two small behavioral bugfixes: fixing a regression introduced in `v0.5.0` on Safari versions `<16.4` (broken media query), and the copy code button providing incorrect feedback in insecure browser contexts. This should be a smooth upgrade with no breaking changes. @@ -89,7 +91,7 @@ As always, we'd love your feedback. [Open an issue](https://github.com/just-the- **Migration**: users with a custom `setup.scss` cannot rely on variables or functions defined in `color_scheme`. This reverts to the behaviour in `v0.4.1`. Users should instead move those variables or functions to the `color_scheme` files themselves. -For more, refer to the [migration guide](https://just-the-docs.github.io/just-the-docs/MIGRATION/). +For more, refer to the [migration guide](https://just-the-docs.com/MIGRATION/). ### Using Release `v0.5.0` @@ -129,7 +131,7 @@ To use and pin a previous version of the theme, replace the `0.5.0` with the des Hello! We're back again with another small release. Like `v0.4.1`, this release is a [semver patch](https://semver.org/): it only includes bugfixes, and is fully backwards-compatible. -The big highlight of this theme is fixing our light scheme code highlighting contrast issues; this was one of our most-requested features! This change is fully backwards-compatible; users can [opt-in to our old highlighting theme](https://just-the-docs.github.io/just-the-docs/docs/customization/#deprecated-legacy_light) by using `legacy_light` instead of `light`. +The big highlight of this theme is fixing our light scheme code highlighting contrast issues; this was one of our most-requested features! This change is fully backwards-compatible; users can [opt-in to our old highlighting theme](https://just-the-docs.com/docs/customization/#deprecated-legacy_light) by using `legacy_light` instead of `light`. As always, we'd love your feedback. [Open an issue](https://github.com/just-the-docs/just-the-docs/issues) or [start a discussion](https://github.com/just-the-docs/just-the-docs/discussions) for bug reports, feature requests, and any other feedback. Thanks for continuing to use Just the Docs! @@ -230,16 +232,16 @@ We're so excited to release Just the Docs `v0.4.0`. This release has been almost `v0.4.0` contains many new features and bugfixes. We enumerate all of them in further sections in this changelog; however, we'd like to call out some of the most-requested changes: - better support for dark theme: dark highlighting, search input color -- [callouts](https://just-the-docs.github.io/just-the-docs/docs/ui-components/callouts/), a new design component to highlight content -- [configuring mermaid.js](https://just-the-docs.github.io/just-the-docs/docs/ui-components/code/#mermaid-diagram-code-blocks), a markdown-native diagram visualization library -- [copy code button](https://just-the-docs.github.io/just-the-docs/docs/ui-components/code/#copy-button) for code snippets -- [external navigation links](https://just-the-docs.github.io/just-the-docs/docs/navigation-structure/#external-navigation-links) +- [callouts](https://just-the-docs.com/docs/ui-components/callouts/), a new design component to highlight content +- [configuring mermaid.js](https://just-the-docs.com/docs/ui-components/code/#mermaid-diagram-code-blocks), a markdown-native diagram visualization library +- [copy code button](https://just-the-docs.com/docs/ui-components/code/#copy-button) for code snippets +- [external navigation links](https://just-the-docs.com/docs/navigation-structure/#external-navigation-links) - major improvements to nav generation efficiency and robustness - minor improvements to built-in accessibility (SVG icons, nav titles, skip to main content) -- [modularized site components](https://just-the-docs.github.io/just-the-docs/docs/customization/#custom-layouts-and-includes) (advanced feature) -- [new custom includes](https://just-the-docs.github.io/just-the-docs/docs/customization/#override-includes): table of contents heading, navigation panel footer, search placeholder, lunr search indices +- [modularized site components](https://just-the-docs.com/docs/customization/#custom-layouts-and-includes) (advanced feature) +- [new custom includes](https://just-the-docs.com/docs/customization/#override-includes): table of contents heading, navigation panel footer, search placeholder, lunr search indices - bugfixes involving WEBrick and Ruby 3, Liquid processing in CSS comments, nested task lists, relative URLs, scroll navigation, corrupted search data from rake, breadcrumbs, and more! -- more documentation for [custom includes](https://just-the-docs.github.io/just-the-docs/docs/customization/#override-includes), this changelog, and the [migration guide](https://just-the-docs.github.io/just-the-docs/MIGRATION/) +- more documentation for [custom includes](https://just-the-docs.com/docs/customization/#override-includes), this changelog, and the [migration guide](https://just-the-docs.com/MIGRATION/) *After usage instructions and the roadmap, we enumerate all changes from `v0.3.3`.* @@ -272,7 +274,7 @@ remote_theme: just-the-docs/just-the-docs@v0.3.3 ### Migration Guide and Strategies -We've developed a new [migration guide](https://just-the-docs.github.io/just-the-docs/MIGRATION/) for users to migrate from version `v0.3.3` to `v0.4.0`. It outlines major changes in project maintenance (e.g. new repository link, team) as well as breaking changes that may break your site (and potential solutions). We suggest that all users refer to the guide before manually upgrading their site. +We've developed a new [migration guide](https://just-the-docs.com/MIGRATION/) for users to migrate from version `v0.3.3` to `v0.4.0`. It outlines major changes in project maintenance (e.g. new repository link, team) as well as breaking changes that may break your site (and potential solutions). We suggest that all users refer to the guide before manually upgrading their site. **For the vast majority of users, we do not anticipate that this will be a breaking change.** The major touch points are surrounding new includes, navigation (ordering, pages, and collections), the favicon, and a shift to relative URLs. However, users who heavily customize the theme (primarily by overriding includes) will likely have to make minor changes. diff --git a/MIGRATION.md b/MIGRATION.md index aaacded..6a9c5c8 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -71,7 +71,7 @@ For those users, we suggest moving those variables and functions to each relevan The theme repo is now at . The name of its default branch is now `main`. -The theme docs website is now published at . +The theme docs website is now published at . We've also retroactively published the theme docs website for version `v0.3.3` at . GitHub provides access to previous versions of the theme repo. You can browse [previous versions of the theme docs website] on the [Internet Archive]. @@ -84,7 +84,7 @@ formatted for browsing on GitHub. It also explains how to install the theme as a Ruby Gem, without creating a new site. [README]: https://github.com/just-the-docs/just-the-docs/blob/main/README.md -[home page]: https://just-the-docs.github.io/just-the-docs +[home page]: https://just-the-docs.com #### Deploy previews diff --git a/README.md b/README.md index 7876f7b..d8b76b8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

Just the Docs

A modern, highly customizable, and responsive Jekyll theme for documentation with built-in search.
Easily hosted on GitHub Pages with few dependencies.

-

See it in action!

+

See it in action!




@@ -102,7 +102,7 @@ The theme is available as open source under the terms of the [MIT License](http: [Jekyll]: https://jekyllrb.com [Just the Docs Template]: https://just-the-docs.github.io/just-the-docs-template/ -[Just the Docs]: https://just-the-docs.github.io/just-the-docs/ +[Just the Docs]: https://just-the-docs.com [Just the Docs repo]: https://github.com/just-the-docs/just-the-docs [GitHub Pages]: https://pages.github.com/ [Template README]: https://github.com/just-the-docs/just-the-docs-template/blob/main/README.md diff --git a/_config.yml b/_config.yml index 68098e5..1b043d9 100644 --- a/_config.yml +++ b/_config.yml @@ -15,8 +15,8 @@ # in the templates via {{ site.myvariable }}. title: Just the Docs description: A Jekyll theme for documentation -baseurl: "/just-the-docs" # the subpath of your site, e.g. /blog -url: "https://just-the-docs.github.io" # the base hostname & protocol for your site, e.g. http://example.com +baseurl: "" # the subpath of your site, e.g. /blog +url: "https://just-the-docs.com" # the base hostname & protocol for your site, e.g. http://example.com repository: just-the-docs/just-the-docs # for github-metadata permalink: pretty diff --git a/index.md b/index.md index bbe91a3..e77551e 100644 --- a/index.md +++ b/index.md @@ -89,7 +89,7 @@ Just the Docs is committed to fostering a welcoming community. [Jekyll configuration]: https://jekyllrb.com/docs/configuration/ [source file for this page]: https://github.com/just-the-docs/just-the-docs/blob/main/index.md [Just the Docs Template]: https://just-the-docs.github.io/just-the-docs-template/ -[Just the Docs]: https://just-the-docs.github.io/just-the-docs/ +[Just the Docs]: https://just-the-docs.com [Just the Docs repo]: https://github.com/just-the-docs/just-the-docs [Just the Docs README]: https://github.com/just-the-docs/just-the-docs/blob/main/README.md [GitHub Pages]: https://pages.github.com/ diff --git a/just-the-docs.gemspec b/just-the-docs.gemspec index c91d7f7..71a3346 100644 --- a/just-the-docs.gemspec +++ b/just-the-docs.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.metadata = { "bug_tracker_uri" => "https://github.com/just-the-docs/just-the-docs/issues", "changelog_uri" => "https://github.com/just-the-docs/just-the-docs/blob/main/CHANGELOG.md", - "documentation_uri" => "https://just-the-docs.github.io/just-the-docs/", + "documentation_uri" => "https://just-the-docs.com/", "source_code_uri" => "https://github.com/just-the-docs/just-the-docs", } From 216d342f26cc474573322d0bd1787114c7b480dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 09:28:19 -0700 Subject: [PATCH 08/52] Bump stylelint from 15.6.1 to 15.6.2 (#1254) Bumps [stylelint](https://github.com/stylelint/stylelint) from 15.6.1 to 15.6.2. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/15.6.1...15.6.2) --- updated-dependencies: - dependency-name: stylelint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index c39abaf..1451d1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "npm-run-all": "^4.1.5", "prettier": "^2.8.8", - "stylelint": "^15.6.1", + "stylelint": "^15.6.2", "stylelint-config-standard-scss": "^9.0.0" } }, @@ -2576,9 +2576,9 @@ "dev": true }, "node_modules/stylelint": { - "version": "15.6.1", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.6.1.tgz", - "integrity": "sha512-d8icFBlVl93Elf3Z5ABQNOCe4nx69is3D/NZhDLAie1eyYnpxfeKe7pCfqzT5W4F8vxHCLSDfV8nKNJzogvV2Q==", + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.6.2.tgz", + "integrity": "sha512-fjQWwcdUye4DU+0oIxNGwawIPC5DvG5kdObY5Sg4rc87untze3gC/5g/ikePqVjrAsBUZjwMN+pZsAYbDO6ArQ==", "dev": true, "dependencies": { "@csstools/css-parser-algorithms": "^2.1.1", @@ -4806,9 +4806,9 @@ "dev": true }, "stylelint": { - "version": "15.6.1", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.6.1.tgz", - "integrity": "sha512-d8icFBlVl93Elf3Z5ABQNOCe4nx69is3D/NZhDLAie1eyYnpxfeKe7pCfqzT5W4F8vxHCLSDfV8nKNJzogvV2Q==", + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.6.2.tgz", + "integrity": "sha512-fjQWwcdUye4DU+0oIxNGwawIPC5DvG5kdObY5Sg4rc87untze3gC/5g/ikePqVjrAsBUZjwMN+pZsAYbDO6ArQ==", "dev": true, "requires": { "@csstools/css-parser-algorithms": "^2.1.1", diff --git a/package.json b/package.json index 7cd5d13..93b883a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "devDependencies": { "npm-run-all": "^4.1.5", "prettier": "^2.8.8", - "stylelint": "^15.6.1", + "stylelint": "^15.6.2", "stylelint-config-standard-scss": "^9.0.0" }, "scripts": { From 3618253d15d8258b152b311857a3d33203670c0b Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 22 May 2023 14:14:38 -0700 Subject: [PATCH 09/52] Fix CI installing multiple copies of Jekyll, explicitly add `kramdown-gfm-parser` to the `3.9` build (#1248) See: https://github.com/just-the-docs/just-the-docs/pull/1112#issuecomment-1533518323. --- .github/workflows/ci.yml | 18 +++++++++++++----- fixtures/Gemfile-jekyll-3.9 | 13 +++++++++++++ fixtures/Gemfile-jekyll-4.3 | 9 +++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 fixtures/Gemfile-jekyll-3.9 create mode 100644 fixtures/Gemfile-jekyll-4.3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 938a3ec..cef61b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,14 +25,18 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: false - - name: Bundle Install + - name: Bundle Install (Jekyll ${{ matrix.jekyll-version }}) run: bundle install - - name: Install Jekyll ${{ matrix.jekyll-version }} - run: gem install jekyll -v ${{ matrix.jekyll-version }} + env: + BUNDLE_GEMFILE: fixtures/Gemfile-jekyll-${{ matrix.jekyll-version }} - name: Init Search run: bundle exec rake search:init + env: + BUNDLE_GEMFILE: fixtures/Gemfile-jekyll-${{ matrix.jekyll-version }} - name: Build Site run: bundle exec jekyll build + env: + BUNDLE_GEMFILE: fixtures/Gemfile-jekyll-${{ matrix.jekyll-version }} github-pages-build: name: Build (github-pages gem) @@ -45,9 +49,13 @@ jobs: ruby-version: '3.1' bundler-cache: false - name: Bundle Install - run: BUNDLE_GEMFILE=fixtures/Gemfile-github-pages bundle install + run: bundle install + env: + BUNDLE_GEMFILE: fixtures/Gemfile-github-pages - name: Build Site - run: BUNDLE_GEMFILE=fixtures/Gemfile-github-pages bundle exec jekyll build + run: bundle exec jekyll build + env: + BUNDLE_GEMFILE: fixtures/Gemfile-github-pages assets: name: Test CSS and JS diff --git a/fixtures/Gemfile-jekyll-3.9 b/fixtures/Gemfile-jekyll-3.9 new file mode 100644 index 0000000..4e3af87 --- /dev/null +++ b/fixtures/Gemfile-jekyll-3.9 @@ -0,0 +1,13 @@ +source "https://rubygems.org" + +gem "jekyll", "~> 3.9" + +gem "jekyll-seo-tag", ">= 2.0" +gem "rake", ">= 12.3.1" + +# required for Jekyll 3 +gem "webrick", "~> 1.7" +gem "kramdown-parser-gfm", '~> 1.1' + +# docs-only +gem "jekyll-github-metadata", ">= 2.15" diff --git a/fixtures/Gemfile-jekyll-4.3 b/fixtures/Gemfile-jekyll-4.3 new file mode 100644 index 0000000..731a113 --- /dev/null +++ b/fixtures/Gemfile-jekyll-4.3 @@ -0,0 +1,9 @@ +source "https://rubygems.org" + +gem "jekyll", "~> 4.3" + +gem "jekyll-seo-tag", ">= 2.0" +gem "rake", ">= 12.3.1" + +# docs-only +gem "jekyll-github-metadata", ">= 2.15" From cffe2f1b29377f6d953d33a642a8f09be88209cf Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Wed, 31 May 2023 14:35:56 -0600 Subject: [PATCH 10/52] Add ARIA roles and labels to search, header, logo, mobile menu button, and main content (#1259) This PR fixes several Axe errors I found while working on https://viewcomponent.org/. I did not see any visual regressions on my deploy, but I'd encourage testing with other sites. --------- Co-authored-by: Lindsey Wild <35239154+lindseywild@users.noreply.github.com> --- _includes/components/search_header.html | 2 +- _includes/components/sidebar.html | 6 +++--- _includes/title.html | 2 +- _layouts/default.html | 22 +++++++++++----------- _sass/layout.scss | 7 +++++++ 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/_includes/components/search_header.html b/_includes/components/search_header.html index 98425d5..3562124 100644 --- a/_includes/components/search_header.html +++ b/_includes/components/search_header.html @@ -1,6 +1,6 @@ {% capture search_placeholder %}{% include search_placeholder_custom.html %}{% endcapture %} -