From d4b79e2eace94d2af7986764b38ba1254e3d3dad Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 20 Jul 2019 23:42:27 +0200 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 4/5] 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 5/5] 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 ```