From cba53a69145580ea948133412f1baefd264b9150 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Mon, 20 May 2019 09:48:57 +0200 Subject: [PATCH 01/87] Make themes more customizable (cherry picked from commit dffb2706a158784e2f3091f895a868e373683bc8) --- .stylelintrc.json | 4 +- _config.yml | 2 +- _includes/head.html | 6 ++- _sass/color_schemes/dark.scss | 1 + _sass/color_schemes/light.scss | 1 + .../modules.scss | 21 +-------- assets/css/just-the-docs-dark.scss | 5 +++ assets/css/just-the-docs-light.scss | 5 +++ assets/css/just-the-docs.scss | 44 ------------------- assets/js/just-the-docs.js | 14 ++++++ docs/configuration.md | 11 ++--- docs/customization.md | 11 ++--- 12 files changed, 44 insertions(+), 81 deletions(-) create mode 100644 _sass/color_schemes/light.scss rename assets/css/dark-mode-preview.scss => _sass/modules.scss (54%) create mode 100644 assets/css/just-the-docs-dark.scss create mode 100644 assets/css/just-the-docs-light.scss delete mode 100644 assets/css/just-the-docs.scss diff --git a/.stylelintrc.json b/.stylelintrc.json index 108fc51..2253e64 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,7 +1,7 @@ { "ignoreFiles" : [ - "assets/css/just-the-docs.scss", - "assets/css/dark-mode-preview.scss", + "assets/css/just-the-docs-light.scss", + "assets/css/just-the-docs-dark.scss", "_sass/vendor/**/*.scss" ], "extends": [ diff --git a/_config.yml b/_config.yml index d12d439..17441c0 100644 --- a/_config.yml +++ b/_config.yml @@ -35,7 +35,7 @@ aux_links: # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." -# Color scheme currently only supports "dark" or nil (default) +# Color scheme currently only supports "dark" or "light"/nil (default) color_scheme: nil # Google Analytics Tracking (optional) diff --git a/_includes/head.html b/_includes/head.html index eae6a5e..f7ab6ed 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -12,7 +12,11 @@ - + {% assign color_scheme = site.color_scheme %} + {% if color_theme == nil %} + {% assign color_scheme = 'light' %} + {% endif %} + {% if site.ga_tracking != nil %} diff --git a/_sass/color_schemes/dark.scss b/_sass/color_schemes/dark.scss index f0e6505..333c2b1 100644 --- a/_sass/color_schemes/dark.scss +++ b/_sass/color_schemes/dark.scss @@ -1,3 +1,4 @@ +// override this file to change the dark theme $body-background-color: $grey-dk-300; $sidebar-color: $grey-dk-300; diff --git a/_sass/color_schemes/light.scss b/_sass/color_schemes/light.scss new file mode 100644 index 0000000..e9624b3 --- /dev/null +++ b/_sass/color_schemes/light.scss @@ -0,0 +1 @@ +// override this file to change the light (default) theme \ No newline at end of file diff --git a/assets/css/dark-mode-preview.scss b/_sass/modules.scss similarity index 54% rename from assets/css/dark-mode-preview.scss rename to _sass/modules.scss index 8b77da6..c0b017b 100644 --- a/assets/css/dark-mode-preview.scss +++ b/_sass/modules.scss @@ -1,28 +1,11 @@ ---- -# this ensures Jekyll reads the file to be transformed into CSS later -# only Main files contain this front matter, not partials. ---- - // // Import external dependencies // - @import "./vendor/normalize.scss/normalize.scss"; // -// Import Just the Docs scss -// - -// Support -@import "./support/support"; - -// -// Import custom color scheme scss -// - -@import "./color_schemes/dark.scss"; - // Modules +// @import "./base"; @import "./layout"; @import "./content"; @@ -38,4 +21,4 @@ // // Import custom overrides // -@import "./custom/custom"; +@import "./custom/custom"; \ No newline at end of file diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss new file mode 100644 index 0000000..a19ffc7 --- /dev/null +++ b/assets/css/just-the-docs-dark.scss @@ -0,0 +1,5 @@ +--- +--- +@import "./support/support"; +@import "./color_schemes/dark"; +@import "./modules"; \ No newline at end of file diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss new file mode 100644 index 0000000..c32b314 --- /dev/null +++ b/assets/css/just-the-docs-light.scss @@ -0,0 +1,5 @@ +--- +--- +@import "./support/support"; +@import "./color_schemes/light"; +@import "./modules"; diff --git a/assets/css/just-the-docs.scss b/assets/css/just-the-docs.scss deleted file mode 100644 index 6a2eefa..0000000 --- a/assets/css/just-the-docs.scss +++ /dev/null @@ -1,44 +0,0 @@ ---- -# this ensures Jekyll reads the file to be transformed into CSS later -# only Main files contain this front matter, not partials. ---- - -// -// Import external dependencies -// - -@import "./vendor/normalize.scss/normalize.scss"; - -// -// Import Just the Docs scss -// - -// Support -@import "./support/support"; - -// -// Import custom overrides -// - -@import "./custom/custom"; - -// -// Import custom color scheme scss -// - -{% if site.color_scheme == "dark" %} -@import "./color_schemes/dark.scss"; -{% endif %} - -// Modules -@import "./base"; -@import "./layout"; -@import "./content"; -@import "./navigation"; -@import "./typography"; -@import "./labels"; -@import "./buttons"; -@import "./search"; -@import "./tables"; -@import "./code"; -@import "./utilities/utilities"; diff --git a/assets/js/just-the-docs.js b/assets/js/just-the-docs.js index aadbf82..c765a9b 100644 --- a/assets/js/just-the-docs.js +++ b/assets/js/just-the-docs.js @@ -274,11 +274,25 @@ function initSearch() { } } +// Focus + function pageFocus() { var mainContent = document.querySelector('.js-main-content'); mainContent.focus(); } +// Switch theme + +jtd.getTheme = function() { + var cssFileHref = document.querySelector('[rel="stylesheet"]').getAttribute('href'); + return cssFileHref.substring(cssFileHref.lastIndexOf('-') + 1, cssFileHref.length - 4); +} + +jtd.setTheme = function(theme) { + var cssFile = document.querySelector('[rel="stylesheet"]'); + cssFile.setAttribute('href', '{{ "assets/css/just-the-docs-" | absolute_url }}' + theme + '.css'); +} + // Document ready jtd.onReady(function(){ diff --git a/docs/configuration.md b/docs/configuration.md index 14422fd..cb00b1a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -67,17 +67,14 @@ color_scheme: "dark" See [Customization]({{ site.baseurl }}{% link docs/customization.md %}) for more information. diff --git a/docs/customization.md b/docs/customization.md index eccb4bc..6f715bf 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -36,17 +36,14 @@ color_scheme: "dark" ## Specific visual customization From f61b836f6e836595cd3979a5fc22eeedc17b01d8 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Mon, 20 May 2019 10:05:56 +0200 Subject: [PATCH 02/87] Fixed stylesheet link (cherry picked from commit ac42a41ae3e36b002df52882be296c01873c0e5b) --- _includes/head.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index f7ab6ed..e640f97 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -12,9 +12,10 @@ - {% assign color_scheme = site.color_scheme %} - {% if color_theme == nil %} + {% if site.color_scheme == nil or site.color_scheme == "nil" %} {% assign color_scheme = 'light' %} + {% else %} + {% assign color_scheme = site.color_scheme %} {% endif %} From da50250f47d74350d0cf1bba11aff6fc3cfb3e49 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Mon, 20 May 2019 10:16:30 +0200 Subject: [PATCH 03/87] Fixed custom css (cherry picked from commit 7df9af5ab1f4b7f1c286d176a8b24be9d3ce8063) --- _sass/modules.scss | 7 +------ assets/css/just-the-docs-dark.scss | 3 ++- assets/css/just-the-docs-light.scss | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/_sass/modules.scss b/_sass/modules.scss index c0b017b..4b1f129 100644 --- a/_sass/modules.scss +++ b/_sass/modules.scss @@ -16,9 +16,4 @@ @import "./search"; @import "./tables"; @import "./code"; -@import "./utilities/utilities"; - -// -// Import custom overrides -// -@import "./custom/custom"; \ No newline at end of file +@import "./utilities/utilities"; \ No newline at end of file diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss index a19ffc7..8a5b8f7 100644 --- a/assets/css/just-the-docs-dark.scss +++ b/assets/css/just-the-docs-dark.scss @@ -2,4 +2,5 @@ --- @import "./support/support"; @import "./color_schemes/dark"; -@import "./modules"; \ No newline at end of file +@import "./modules"; +@import "./custom/custom"; \ No newline at end of file diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss index c32b314..997198e 100644 --- a/assets/css/just-the-docs-light.scss +++ b/assets/css/just-the-docs-light.scss @@ -3,3 +3,4 @@ @import "./support/support"; @import "./color_schemes/light"; @import "./modules"; +@import "./custom/custom"; From 5f0de692bec814a7c9d4441adc2474ae73080431 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 15 Aug 2019 18:44:10 +0200 Subject: [PATCH 04/87] Fixed css style --- _sass/color_schemes/light.scss | 2 +- _sass/modules.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_sass/color_schemes/light.scss b/_sass/color_schemes/light.scss index e9624b3..5932f29 100644 --- a/_sass/color_schemes/light.scss +++ b/_sass/color_schemes/light.scss @@ -1 +1 @@ -// override this file to change the light (default) theme \ No newline at end of file +// override this file to change the light (default) theme diff --git a/_sass/modules.scss b/_sass/modules.scss index 4b1f129..dc94a4b 100644 --- a/_sass/modules.scss +++ b/_sass/modules.scss @@ -16,4 +16,4 @@ @import "./search"; @import "./tables"; @import "./code"; -@import "./utilities/utilities"; \ No newline at end of file +@import "./utilities/utilities"; From 9e0bc86dbe3d2870d534dae6c61b7d116f6b02d0 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 20 Jul 2019 20:06:45 +0200 Subject: [PATCH 05/87] Simplified css color schemes (cherry picked from commit 52b0bced5d235d7557413e064f3841ea774d9063) --- _includes/css/just-the-docs.scss | 3 +++ _sass/modules.scss | 1 + assets/css/just-the-docs-dark.scss | 5 +---- assets/css/just-the-docs-light.scss | 5 +---- 4 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 _includes/css/just-the-docs.scss diff --git a/_includes/css/just-the-docs.scss b/_includes/css/just-the-docs.scss new file mode 100644 index 0000000..61c8c2e --- /dev/null +++ b/_includes/css/just-the-docs.scss @@ -0,0 +1,3 @@ +@import "./support/support"; +@import "./color_schemes/{{ include.color_scheme }}"; +@import "./modules"; diff --git a/_sass/modules.scss b/_sass/modules.scss index dc94a4b..30f1f2a 100644 --- a/_sass/modules.scss +++ b/_sass/modules.scss @@ -17,3 +17,4 @@ @import "./tables"; @import "./code"; @import "./utilities/utilities"; +@import "./custom/custom"; diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss index 8a5b8f7..c44bde1 100644 --- a/assets/css/just-the-docs-dark.scss +++ b/assets/css/just-the-docs-dark.scss @@ -1,6 +1,3 @@ --- --- -@import "./support/support"; -@import "./color_schemes/dark"; -@import "./modules"; -@import "./custom/custom"; \ No newline at end of file +{% include css/just-the-docs.scss color_scheme="dark" %} \ No newline at end of file diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss index 997198e..a5aab89 100644 --- a/assets/css/just-the-docs-light.scss +++ b/assets/css/just-the-docs-light.scss @@ -1,6 +1,3 @@ --- --- -@import "./support/support"; -@import "./color_schemes/light"; -@import "./modules"; -@import "./custom/custom"; +{% include css/just-the-docs.scss color_scheme="light" %} \ No newline at end of file From 6c569cbdc253b886b230cd80f39d9f54fce66254 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 20 Jul 2019 22:04:17 +0200 Subject: [PATCH 06/87] Fixed custom css (cherry picked from commit bab3437a1feefc49213e1e787db0451491aca9b9) --- _includes/css/just-the-docs.scss | 1 + _sass/modules.scss | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/css/just-the-docs.scss b/_includes/css/just-the-docs.scss index 61c8c2e..ee779b2 100644 --- a/_includes/css/just-the-docs.scss +++ b/_includes/css/just-the-docs.scss @@ -1,3 +1,4 @@ @import "./support/support"; @import "./color_schemes/{{ include.color_scheme }}"; @import "./modules"; +@import "./custom/custom"; diff --git a/_sass/modules.scss b/_sass/modules.scss index 30f1f2a..dc94a4b 100644 --- a/_sass/modules.scss +++ b/_sass/modules.scss @@ -17,4 +17,3 @@ @import "./tables"; @import "./code"; @import "./utilities/utilities"; -@import "./custom/custom"; From 3995fbfc3559cbe33dc778f5cca818b6dd2bc4fa Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 20 Jul 2019 22:11:41 +0200 Subject: [PATCH 07/87] More customizable css (cherry picked from commit 8aa0899facd01f689692fccdb338673f5e9a9fbd) --- _includes/css/custom.scss | 1 + _includes/css/just-the-docs.scss | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 _includes/css/custom.scss diff --git a/_includes/css/custom.scss b/_includes/css/custom.scss new file mode 100644 index 0000000..2ad1576 --- /dev/null +++ b/_includes/css/custom.scss @@ -0,0 +1 @@ +@import "./custom/custom"; diff --git a/_includes/css/just-the-docs.scss b/_includes/css/just-the-docs.scss index ee779b2..9c27ce6 100644 --- a/_includes/css/just-the-docs.scss +++ b/_includes/css/just-the-docs.scss @@ -1,4 +1,4 @@ @import "./support/support"; @import "./color_schemes/{{ include.color_scheme }}"; @import "./modules"; -@import "./custom/custom"; +{% include css/custom.scss %} From 2febd256db056b73ef06992fb9788c9ded4a29da Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sun, 21 Jul 2019 17:00:21 +0200 Subject: [PATCH 08/87] Added .liquid suffix to included scss files (cherry picked from commit 7fb79c2018b979fdf917f427ca5d3f2451f3265d) --- _includes/css/{custom.scss => custom.scss.liquid} | 0 _includes/css/{just-the-docs.scss => just-the-docs.scss.liquid} | 2 +- assets/css/just-the-docs-dark.scss | 2 +- assets/css/just-the-docs-light.scss | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename _includes/css/{custom.scss => custom.scss.liquid} (100%) rename _includes/css/{just-the-docs.scss => just-the-docs.scss.liquid} (73%) diff --git a/_includes/css/custom.scss b/_includes/css/custom.scss.liquid similarity index 100% rename from _includes/css/custom.scss rename to _includes/css/custom.scss.liquid diff --git a/_includes/css/just-the-docs.scss b/_includes/css/just-the-docs.scss.liquid similarity index 73% rename from _includes/css/just-the-docs.scss rename to _includes/css/just-the-docs.scss.liquid index 9c27ce6..2fc1e27 100644 --- a/_includes/css/just-the-docs.scss +++ b/_includes/css/just-the-docs.scss.liquid @@ -1,4 +1,4 @@ @import "./support/support"; @import "./color_schemes/{{ include.color_scheme }}"; @import "./modules"; -{% include css/custom.scss %} +{% include css/custom.scss.liquid %} diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss index c44bde1..3f5bd6b 100644 --- a/assets/css/just-the-docs-dark.scss +++ b/assets/css/just-the-docs-dark.scss @@ -1,3 +1,3 @@ --- --- -{% include css/just-the-docs.scss color_scheme="dark" %} \ No newline at end of file +{% include css/just-the-docs.scss.liquid color_scheme="dark" %} \ No newline at end of file diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss index a5aab89..336d74e 100644 --- a/assets/css/just-the-docs-light.scss +++ b/assets/css/just-the-docs-light.scss @@ -1,3 +1,3 @@ --- --- -{% include css/just-the-docs.scss color_scheme="light" %} \ No newline at end of file +{% include css/just-the-docs.scss.liquid color_scheme="light" %} \ No newline at end of file From d549d37e6faac68cfeba7cec13e35d306d47fee5 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 15 Aug 2019 20:12:57 +0200 Subject: [PATCH 09/87] Fixed missing new lines --- _includes/title.html | 2 +- _layouts/table_wrappers.html | 2 +- assets/css/just-the-docs-dark.scss | 2 +- assets/css/just-the-docs-light.scss | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_includes/title.html b/_includes/title.html index f6d5669..35b2c6c 100644 --- a/_includes/title.html +++ b/_includes/title.html @@ -1 +1 @@ -{{ site.title }} \ No newline at end of file +{{ site.title }} diff --git a/_layouts/table_wrappers.html b/_layouts/table_wrappers.html index cc6187a..3f8f226 100644 --- a/_layouts/table_wrappers.html +++ b/_layouts/table_wrappers.html @@ -4,4 +4,4 @@ layout: vendor/compress {% assign content_ = content | replace: '', '' %} -{{ content_ }} \ No newline at end of file +{{ content_ }} diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss index 3f5bd6b..ac92fb1 100644 --- a/assets/css/just-the-docs-dark.scss +++ b/assets/css/just-the-docs-dark.scss @@ -1,3 +1,3 @@ --- --- -{% include css/just-the-docs.scss.liquid color_scheme="dark" %} \ No newline at end of file +{% include css/just-the-docs.scss.liquid color_scheme="dark" %} diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss index 336d74e..ac69688 100644 --- a/assets/css/just-the-docs-light.scss +++ b/assets/css/just-the-docs-light.scss @@ -1,3 +1,3 @@ --- --- -{% include css/just-the-docs.scss.liquid color_scheme="light" %} \ No newline at end of file +{% include css/just-the-docs.scss.liquid color_scheme="light" %} From 95498ccaf8f1829a9123bde4c14800fb3219f28a Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 17 Aug 2019 15:02:53 +0200 Subject: [PATCH 10/87] Added just-the-docs-default.scss which includes the theme set in _config.yml --- _includes/head.html | 7 +------ _sass/color_schemes/dark.scss | 2 -- _sass/color_schemes/light.scss | 1 - assets/css/just-the-docs-default.scss | 8 ++++++++ 4 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 assets/css/just-the-docs-default.scss diff --git a/_includes/head.html b/_includes/head.html index e640f97..16ffe3d 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -12,12 +12,7 @@ - {% if site.color_scheme == nil or site.color_scheme == "nil" %} - {% assign color_scheme = 'light' %} - {% else %} - {% assign color_scheme = site.color_scheme %} - {% endif %} - + {% if site.ga_tracking != nil %} diff --git a/_sass/color_schemes/dark.scss b/_sass/color_schemes/dark.scss index 333c2b1..9a0b9ea 100644 --- a/_sass/color_schemes/dark.scss +++ b/_sass/color_schemes/dark.scss @@ -1,5 +1,3 @@ -// override this file to change the dark theme - $body-background-color: $grey-dk-300; $sidebar-color: $grey-dk-300; $border-color: $grey-dk-200; diff --git a/_sass/color_schemes/light.scss b/_sass/color_schemes/light.scss index 5932f29..e69de29 100644 --- a/_sass/color_schemes/light.scss +++ b/_sass/color_schemes/light.scss @@ -1 +0,0 @@ -// override this file to change the light (default) theme diff --git a/assets/css/just-the-docs-default.scss b/assets/css/just-the-docs-default.scss new file mode 100644 index 0000000..63fde26 --- /dev/null +++ b/assets/css/just-the-docs-default.scss @@ -0,0 +1,8 @@ +--- +--- +{% if site.color_scheme and site.color_scheme != "nil" %} + {% assign color_scheme = site.color_scheme %} +{% else %} + {% assign color_scheme = "light" %} +{% endif %} +{% include css/just-the-docs.scss.liquid color_scheme=color_scheme %} From 3ed2d586fdf0a67ffd7a7f4b85bbaec63633481a Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 17 Aug 2019 16:07:09 +0200 Subject: [PATCH 11/87] Fixed stylelintrc.json --- .stylelintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.stylelintrc.json b/.stylelintrc.json index 2253e64..e8d6e17 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,5 +1,6 @@ { "ignoreFiles" : [ + "assets/css/just-the-docs-default.scss", "assets/css/just-the-docs-light.scss", "assets/css/just-the-docs-dark.scss", "_sass/vendor/**/*.scss" From 7c8ead0bff574e80542a3132d377e53d92332dbb Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Mon, 9 Sep 2019 19:31:23 -0700 Subject: [PATCH 12/87] adds page last modified to footer --- _layouts/default.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_layouts/default.html b/_layouts/default.html index d414234..de5244e 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -83,6 +83,9 @@ layout: table_wrappers {% if site.footer_content != nil %}
+ {% if page.last_modified_date %} +

Page last modified: {{ page.last_modified_date | date: "%Y-%m-%d %H:%M" }}

+ {% endif %}

{{ site.footer_content }}

{% endif %} From be5822cb860e695eabc3368867d38f569bb93f19 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Mon, 9 Sep 2019 19:43:33 -0700 Subject: [PATCH 13/87] adds page last modified above header --- _layouts/default.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_layouts/default.html b/_layouts/default.html index de5244e..d56132e 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -59,6 +59,9 @@ layout: table_wrappers {% endif %} {% endunless %}
+ {% if page.last_modified_date %} +

Page last modified: {{ page.last_modified_date | date: "%Y-%m-%d %H:%M" }}

+ {% endif %} {% if site.heading_anchors != false %} {% include vendor/anchor_headings.html html=content beforeHeading = "true" anchorBody="" anchorClass="anchor-heading" %} {% else %} From 97efc81fa904054e367d9fb1f5df7f11e2a90e6b Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Wed, 11 Sep 2019 15:31:47 -0700 Subject: [PATCH 14/87] implements configuration for footer data and "edit this page" functionality --- _config.yml | 6 ++++++ _layouts/default.html | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/_config.yml b/_config.yml index d12d439..cab96f5 100644 --- a/_config.yml +++ b/_config.yml @@ -34,6 +34,12 @@ aux_links: # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." +# Footer metadata +show_last_edit_time: true +last_edit_time_format: "%b %e %Y at %I:%M %p" +show_gh_edit_link: true +gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" +edit_link_text: "Edit this page on GitHub" # Color scheme currently only supports "dark" or nil (default) color_scheme: nil diff --git a/_layouts/default.html b/_layouts/default.html index d56132e..e7d4996 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -59,9 +59,6 @@ layout: table_wrappers {% endif %} {% endunless %}
- {% if page.last_modified_date %} -

Page last modified: {{ page.last_modified_date | date: "%Y-%m-%d %H:%M" }}

- {% endif %} {% if site.heading_anchors != false %} {% include vendor/anchor_headings.html html=content beforeHeading = "true" anchorBody="" anchorClass="anchor-heading" %} {% else %} @@ -86,8 +83,15 @@ layout: table_wrappers {% if site.footer_content != nil %}
- {% if page.last_modified_date %} -

Page last modified: {{ page.last_modified_date | date: "%Y-%m-%d %H:%M" }}

+ {% if site.show_last_edit_time and site.last_edit_time_format and page.last_modified_date %} +

+ Page last modified: {{ page.last_modified_date | date: site.last_edit_time_format }}. +

+ {% endif %} + {% if site.show_gh_edit_link and site.edit_link_text %} +

+ Edit this page on GitHub. +

{% endif %}

{{ site.footer_content }}

From 4ff38dbe9c8090ea31bcb39927d8ba7d0ffcff99 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Wed, 11 Sep 2019 15:36:36 -0700 Subject: [PATCH 15/87] adds documentation --- docs/configuration.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 14422fd..1a443c9 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -55,8 +55,18 @@ heading_anchors: true ```yaml # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." +# Footer metadata +show_last_edit_time: true +last_edit_time_format: "%b %e %Y at %I:%M %p" +show_gh_edit_link: true +gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" +edit_link_text: "Edit this page on GitHub" ``` +* 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) +* `gh_edit_repository` should be changed to the project's GitHub repository + ## Color scheme ```yaml From 9c4622d75f5cfec36c3ce1950cbcb221aea6c9dc Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Sat, 14 Sep 2019 17:54:27 -0700 Subject: [PATCH 16/87] implements conditional or on footer --- _layouts/default.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 5bf27a9..9c333af 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -86,7 +86,7 @@ layout: table_wrappers {% endif %} - {% if site.footer_content != nil %} + {% if site.footer_content != nil or site.show_last_edit_time or site.show_gh_edit_link %}
{% if site.show_last_edit_time and site.last_edit_time_format and page.last_modified_date %} @@ -99,7 +99,9 @@ layout: table_wrappers Edit this page on GitHub.

{% endif %} + {% if site.footer_content != nil %}

{{ site.footer_content }}

+ {% endif %}
{% endif %} From 5549a15df9749ab3bfc554f0933fc90865f2fbd8 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Tue, 1 Oct 2019 22:22:34 -0700 Subject: [PATCH 17/87] adds option to make aux links open in new tab --- _config.yml | 3 +++ _layouts/default.html | 10 +++++++++- docs/configuration.md | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index a090670..c7dd5ee 100644 --- a/_config.yml +++ b/_config.yml @@ -38,6 +38,9 @@ aux_links: "Just the Docs on GitHub": - "//github.com/pmarsceill/just-the-docs" +# Makes Aux links open in a new tab. Default is false +aux_links_new_tab: false + # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." diff --git a/_layouts/default.html b/_layouts/default.html index b1d3c72..20d3b58 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -43,7 +43,15 @@ layout: table_wrappers {% if site.aux_links != nil %} {% endif %} diff --git a/docs/configuration.md b/docs/configuration.md index eb43a08..e18f75c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -48,6 +48,9 @@ search_tokenizer_separator: /[\s/]+/ aux_links: "Just the Docs on GitHub": - "//github.com/pmarsceill/just-the-docs" + +# Makes Aux links open in a new tab. Default is false +aux_links_new_tab: false ``` ## Heading anchor links From 6660f442b078ab9dc668c010b1e4378297f32b22 Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Fri, 11 Oct 2019 21:40:34 +0100 Subject: [PATCH 18/87] Alphabetic navigation order When `nav_order` is omitted, the order of nodes at each menu level (and in the auto-generated TOC) is alphabetical by `title`, instead of random. Any nodes with a specified `nav_order` precede all nodes at that level where it is omitted. Note that `nav_order` fields must have a uniform site-ide type: integers and strings cannot be mixed, otherwise Jekyll reports errors. The implementation filters the ordered and unordered pages from `site.html_pages`, sorts them separately, and concatenates the resulting arrays. --- _includes/nav.html | 8 +++++--- _layouts/default.html | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/_includes/nav.html b/_includes/nav.html index d561a42..a691f4f 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -1,6 +1,8 @@
-
+