{% if site.heading_anchors != false %} - {% include vendor/anchor_headings.html html=content beforeHeading = "true" anchorBody="" anchorClass="anchor-heading" %} + {% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="" anchorClass="anchor-heading" %} {% else %} {{ content }} {% endif %} diff --git a/_sass/content.scss b/_sass/content.scss index 0ed47fc..2940286 100644 --- a/_sass/content.scss +++ b/_sass/content.scss @@ -116,26 +116,37 @@ .anchor-heading { position: absolute; - right: -$sp-3; + right: -$sp-4; width: $sp-5; height: 100%; + padding-right: $sp-1; + padding-left: $sp-1; overflow: visible; - fill: $link-color; - visibility: hidden; @include mq(md) { right: auto; left: -$sp-5; } + + svg { + display: inline-block; + width: 100%; + height: 100%; + fill: $link-color; + visibility: hidden; + } } + .anchor-heading:hover, h1:hover > .anchor-heading, h2:hover > .anchor-heading, h3:hover > .anchor-heading, h4:hover > .anchor-heading, h5:hover > .anchor-heading, h6:hover > .anchor-heading { - visibility: visible; + svg { + visibility: visible; + } } h1, From d4b79e2eace94d2af7986764b38ba1254e3d3dad Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 20 Jul 2019 23:42:27 +0200 Subject: [PATCH 10/23] Improved site header for logo (cherry picked from commit 2a5c38907488b998af75e9a1ef2499428b8f1a78) --- _sass/layout.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_sass/layout.scss b/_sass/layout.scss index 4c214ea..5ab7ff7 100644 --- a/_sass/layout.scss +++ b/_sass/layout.scss @@ -125,12 +125,12 @@ .site-header { display: flex; + min-height: $header-height; align-items: center; @include mq(md) { z-index: 101; height: $header-height; - min-height: $header-height; max-height: $header-height; border-bottom: $border $border-color; } @@ -142,8 +142,8 @@ display: flex; height: 100%; align-items: center; - padding-top: $gutter-spacing-sm; - padding-bottom: $gutter-spacing-sm; + padding-top: $sp-2; + padding-bottom: $sp-2; color: $body-heading-color; @include fs-6; } From 89a331ee857dd05adc9172dcb7e1cd41937bb97e Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sun, 21 Jul 2019 00:04:50 +0200 Subject: [PATCH 11/23] Improved site header for logo (cherry picked from commit 468bf8368783309e69fdcaa91f7eb5b1e05d96aa) --- _sass/layout.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_sass/layout.scss b/_sass/layout.scss index 5ab7ff7..21a5490 100644 --- a/_sass/layout.scss +++ b/_sass/layout.scss @@ -146,6 +146,11 @@ padding-bottom: $sp-2; color: $body-heading-color; @include fs-6; + + @include mq(md) { + padding-top: $sp-3; + padding-bottom: $sp-3; + } } .menu-button { From 6a46a4797e5491d7ce5b85eddf0bd9f0e85a4a06 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sun, 21 Jul 2019 00:06:36 +0200 Subject: [PATCH 12/23] Improved site header for logo (cherry picked from commit 97d1c663ef566ffe20fb1ec217fd2d8c1a8a2382) --- _sass/layout.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_sass/layout.scss b/_sass/layout.scss index 21a5490..d826cfc 100644 --- a/_sass/layout.scss +++ b/_sass/layout.scss @@ -142,14 +142,14 @@ display: flex; height: 100%; align-items: center; - padding-top: $sp-2; - padding-bottom: $sp-2; + padding-top: $sp-3; + padding-bottom: $sp-3; color: $body-heading-color; @include fs-6; @include mq(md) { - padding-top: $sp-3; - padding-bottom: $sp-3; + padding-top: $sp-2; + padding-bottom: $sp-2; } } From 132cecfea3ba2dbdcf37ac519390175d713edd4b Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 17 Aug 2019 14:32:25 +0200 Subject: [PATCH 13/23] Added logo variable to _config.yml which can be set to a path/url Automatically replaces the title with a logo --- _config.yml | 1 + _includes/title.html | 6 +++++- _sass/layout.scss | 11 +++++++++++ assets/css/dark-mode-preview.scss | 4 ++++ assets/css/just-the-docs.scss | 4 ++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index d12d439..60b446d 100644 --- a/_config.yml +++ b/_config.yml @@ -17,6 +17,7 @@ title: Just the Docs description: A Jekyll theme for documentation baseurl: "/just-the-docs" # the subpath of your site, e.g. /blog url: "https://pmarsceill.github.io" # the base hostname & protocol for your site, e.g. http://example.com +#logo: "/assets/images/just-the-docs.png" permalink: pretty exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"] diff --git a/_includes/title.html b/_includes/title.html index f6d5669..8bd3fa8 100644 --- a/_includes/title.html +++ b/_includes/title.html @@ -1 +1,5 @@ -{{ site.title }} \ No newline at end of file +{% if site.logo %} + +{% else %} + {{ site.title }} +{% endif %} diff --git a/_sass/layout.scss b/_sass/layout.scss index d826cfc..9ec8b07 100644 --- a/_sass/layout.scss +++ b/_sass/layout.scss @@ -153,6 +153,17 @@ } } +@if variable-exists(logo) { + .site-logo { + width: 100%; + height: 100%; + background-image: url($logo); + background-position: left center; + background-repeat: no-repeat; + background-size: contain; + } +} + .menu-button { appearance: none; display: flex; diff --git a/assets/css/dark-mode-preview.scss b/assets/css/dark-mode-preview.scss index 8b77da6..c524e81 100644 --- a/assets/css/dark-mode-preview.scss +++ b/assets/css/dark-mode-preview.scss @@ -3,6 +3,10 @@ # only Main files contain this front matter, not partials. --- +{% if site.logo %} +$logo: "{{ site.logo | absolute_url }}"; +{% endif %} + // // Import external dependencies // diff --git a/assets/css/just-the-docs.scss b/assets/css/just-the-docs.scss index 6a2eefa..57d03aa 100644 --- a/assets/css/just-the-docs.scss +++ b/assets/css/just-the-docs.scss @@ -3,6 +3,10 @@ # only Main files contain this front matter, not partials. --- +{% if site.logo %} +$logo: "{{ site.logo | absolute_url }}"; +{% endif %} + // // Import external dependencies // From 91760ee8c97dcc2fb0b43179e924e9da4ea81fcf Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 17 Aug 2019 14:46:28 +0200 Subject: [PATCH 14/23] Added documentation for logo variable --- _config.yml | 4 +++- docs/configuration.md | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/_config.yml b/_config.yml index 60b446d..d722e9e 100644 --- a/_config.yml +++ b/_config.yml @@ -17,11 +17,13 @@ title: Just the Docs description: A Jekyll theme for documentation baseurl: "/just-the-docs" # the subpath of your site, e.g. /blog url: "https://pmarsceill.github.io" # the base hostname & protocol for your site, e.g. http://example.com -#logo: "/assets/images/just-the-docs.png" permalink: pretty exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"] +# Set a path/url to a logo that will be displayed instead of the title +#logo: "/assets/images/just-the-docs.png" + # Enable or disable the site search search_enabled: true diff --git a/docs/configuration.md b/docs/configuration.md index 14422fd..03e7e52 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -22,11 +22,18 @@ Just the Docs has some specific configuration parameters that can be defined in View this site's [_config.yml](https://github.com/pmarsceill/just-the-docs/tree/master/_config.yml) file as an example. -## Search enabled +## Site logo + +```yaml +# Set a path/url to a logo that will be displayed instead of the title +logo: "/assets/images/just-the-docs.png" +``` + +## Search ```yaml # Enable or disable the site search -# Support true (default) or false +# Supports true (default) or false search_enabled: true ``` @@ -35,18 +42,17 @@ search_enabled: true ```yaml # Aux links for the upper right navigation aux_links: - "Just the Docs on GitHub": - - "//github.com/pmarsceill/just-the-docs" + "Just the Docs on GitHub": + - "//github.com/pmarsceill/just-the-docs" ``` ## Heading anchor links ```yaml -# Heading anchor links appear on hover over h1-h6 tags -# in page content allowing users to deep link to a particular -# heading on a page. +# Heading anchor links appear on hover over h1-h6 tags in page content +# allowing users to deep link to a particular heading on a page. # -# Supprts true (default) or false/nil +# Supports true (default) or false/nil heading_anchors: true ``` From 7382a9a379baebab17270dee24d5c1525b5cbf3e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2019 19:28:29 +0000 Subject: [PATCH 15/23] [Security] Bump mixin-deep from 1.3.1 to 1.3.2 Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. **This update includes a security fix.** - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d6b72a..3fb8c9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "just-the-docs", - "version": "0.2.5", + "version": "0.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2776,9 +2776,9 @@ } }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", From 47b7991805acf268c44ca1ca80992baa8768d7e5 Mon Sep 17 00:00:00 2001 From: Ian Carrico Date: Wed, 4 Sep 2019 08:55:11 -0400 Subject: [PATCH 16/23] Allow for custom overrides by the user --- _sass/overrides.scss | 3 +++ assets/css/just-the-docs.scss | 1 + 2 files changed, 4 insertions(+) create mode 100644 _sass/overrides.scss diff --git a/_sass/overrides.scss b/_sass/overrides.scss new file mode 100644 index 0000000..21e9527 --- /dev/null +++ b/_sass/overrides.scss @@ -0,0 +1,3 @@ +// +// Custom overrides from a user. +// diff --git a/assets/css/just-the-docs.scss b/assets/css/just-the-docs.scss index 6a2eefa..4de25c0 100644 --- a/assets/css/just-the-docs.scss +++ b/assets/css/just-the-docs.scss @@ -42,3 +42,4 @@ @import "./tables"; @import "./code"; @import "./utilities/utilities"; +@import "./overrides"; From 1aee233e1f363816892b97e09eaed67885b9de0c Mon Sep 17 00:00:00 2001 From: Ian Carrico Date: Wed, 4 Sep 2019 09:04:10 -0400 Subject: [PATCH 17/23] Add in some docs --- docs/customization.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/customization.md b/docs/customization.md index eccb4bc..a3d5b6f 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -69,3 +69,20 @@ $link-color: $blue-000; ``` _Note:_ Editing the variables directly in `_sass/support/variables.scss` is not recommended and can cause other dependencies to fail. + +## Override styles + +To add your own CSS at the end of the cascade, edit `_sass/overrides.scss` to add in your own custom CSS. This will allow for all overrides to be kept in a single file, and allow for any upstream changes to still be allowed. + +For example, if you'd like to add your own styles for printing a page, you could add the following styles. + +#### Example +{: .no_toc } + +```scss +// Print-only styles. +@media print { + .side-bar, .page-header { display: none; } + .main-content { max-width: auto; margin: 1em;} +} +``` From 3d0240ff0b467f7ef724d771cf01f0222d003e91 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2019 10:34:12 +0000 Subject: [PATCH 18/23] Bump @primer/css from 12.6.0 to 12.7.0 Bumps [@primer/css](https://github.com/primer/css) from 12.6.0 to 12.7.0. - [Release notes](https://github.com/primer/css/releases) - [Changelog](https://github.com/primer/css/blob/master/CHANGELOG.md) - [Commits](https://github.com/primer/css/compare/v12.6.0...v12.7.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d6b72a..b7c1138 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "just-the-docs", - "version": "0.2.5", + "version": "0.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -177,11 +177,11 @@ "dev": true }, "@primer/css": { - "version": "12.6.0", - "resolved": "https://registry.npmjs.org/@primer/css/-/css-12.6.0.tgz", - "integrity": "sha512-GzQr/MPCbTlgvAd4bEXy4RA5cZvz7k/wkCzG7sOmjB9g9EtGnkzmLz6aS58EBRJsxfe6QU/iZ2/N/66/Bn5eZA==", + "version": "12.7.0", + "resolved": "https://registry.npmjs.org/@primer/css/-/css-12.7.0.tgz", + "integrity": "sha512-EVqfwX1jxKWQoV9IxxCJQG7HlyKefdkYTJdnDV43Rr1cyidUTkQN9W0uMuN+RD9cmAzip/40b2E+7gsvsFDmBA==", "requires": { - "@primer/octicons": "9.1.1" + "@primer/octicons": "^9.1.1" } }, "@primer/octicons": { diff --git a/package.json b/package.json index 0c5a8ea..e4deedf 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "stylelint-selector-no-utility": "^4.0.0" }, "dependencies": { - "@primer/css": "^12.6.0" + "@primer/css": "^12.7.0" }, "scripts": { "test": "stylelint '**/*.scss'" From 1564ca4511c9adf8d8894700c1fbaf326b6b2dd9 Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Mon, 9 Sep 2019 21:50:05 +0200 Subject: [PATCH 19/23] Update configuration.md Added documentation for `search_tokenizer_separator`. --- docs/configuration.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 14422fd..5e469d2 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -28,6 +28,10 @@ View this site's [_config.yml](https://github.com/pmarsceill/just-the-docs/tree/ # Enable or disable the site search # Support true (default) or false search_enabled: true + +# Enable support for hyphenated search words: +search_tokenizer_separator: /[\s/]+/ + ``` ## Aux links From 9616dcf761e947d6dc8939f29ebffe7e59e201f3 Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Mon, 9 Sep 2019 15:50:48 -0400 Subject: [PATCH 20/23] Update just-the-docs.js --- assets/js/just-the-docs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/js/just-the-docs.js b/assets/js/just-the-docs.js index 308460e..0216181 100644 --- a/assets/js/just-the-docs.js +++ b/assets/js/just-the-docs.js @@ -52,8 +52,13 @@ function initSearch() { if (request.status >= 200 && request.status < 400) { // Success! var data = JSON.parse(request.responseText); - + + {% if site.search_tokenizer_separator != nil %} lunr.tokenizer.separator = {{ site.search_tokenizer_separator }} + {% else %} + lunr.tokenizer.separator = /[\s\-/]+/ + {% end %} + var index = lunr(function () { this.ref('id'); this.field('title', { boost: 200 }); From 44d689b9948b03d9b220960e7990fe1e90935479 Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Mon, 9 Sep 2019 15:55:31 -0400 Subject: [PATCH 21/23] Lint --- _sass/layout.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sass/layout.scss b/_sass/layout.scss index 9ec8b07..6644dc3 100644 --- a/_sass/layout.scss +++ b/_sass/layout.scss @@ -158,8 +158,8 @@ width: 100%; height: 100%; background-image: url($logo); - background-position: left center; background-repeat: no-repeat; + background-position: left center; background-size: contain; } } From ff106641b0353f4b92d4fd2dde9444d3f261bb36 Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Mon, 9 Sep 2019 16:09:05 -0400 Subject: [PATCH 22/23] syntax error --- assets/js/just-the-docs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/just-the-docs.js b/assets/js/just-the-docs.js index 0216181..2f6cea0 100644 --- a/assets/js/just-the-docs.js +++ b/assets/js/just-the-docs.js @@ -57,7 +57,7 @@ function initSearch() { lunr.tokenizer.separator = {{ site.search_tokenizer_separator }} {% else %} lunr.tokenizer.separator = /[\s\-/]+/ - {% end %} + {% endif %} var index = lunr(function () { this.ref('id'); From 423b8c9f4637e8437dbcf896bd1837f70698bdf0 Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Mon, 9 Sep 2019 16:29:51 -0400 Subject: [PATCH 23/23] Update _config.yml --- _config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/_config.yml b/_config.yml index 9176a8f..c58fcc9 100644 --- a/_config.yml +++ b/_config.yml @@ -27,10 +27,8 @@ exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "pac # Enable or disable the site search search_enabled: true -# Set the search token separator -search_tokenizer_separator: /[\s\-/]+/ -# For hyphenated-word search: -# search_tokenizer_separator: /[\s/]+/ +# Set the search token separator for hyphenated-word search: +search_tokenizer_separator: /[\s/]+/ # Enable or disable heading anchors heading_anchors: true