Merge pull request #187 from SgtSilvio/improvement/site-logo

Improvement/site logo
This commit is contained in:
Patrick Marsceill 2019-09-09 15:10:55 -04:00 committed by GitHub
commit 843233c6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 12 deletions

View File

@ -21,6 +21,9 @@ url: "https://pmarsceill.github.io" # the base hostname & protocol for your site
permalink: pretty permalink: pretty
exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"] 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 # Enable or disable the site search
search_enabled: true search_enabled: true

View File

@ -1 +1,5 @@
{{ site.title }} {% if site.logo %}
<div class="site-logo"></div>
{% else %}
{{ site.title }}
{% endif %}

View File

@ -125,12 +125,12 @@
.site-header { .site-header {
display: flex; display: flex;
min-height: $header-height;
align-items: center; align-items: center;
@include mq(md) { @include mq(md) {
z-index: 101; z-index: 101;
height: $header-height; height: $header-height;
min-height: $header-height;
max-height: $header-height; max-height: $header-height;
border-bottom: $border $border-color; border-bottom: $border $border-color;
} }
@ -142,10 +142,26 @@
display: flex; display: flex;
height: 100%; height: 100%;
align-items: center; align-items: center;
padding-top: $gutter-spacing-sm; padding-top: $sp-3;
padding-bottom: $gutter-spacing-sm; padding-bottom: $sp-3;
color: $body-heading-color; color: $body-heading-color;
@include fs-6; @include fs-6;
@include mq(md) {
padding-top: $sp-2;
padding-bottom: $sp-2;
}
}
@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 { .menu-button {

View File

@ -3,6 +3,10 @@
# only Main files contain this front matter, not partials. # only Main files contain this front matter, not partials.
--- ---
{% if site.logo %}
$logo: "{{ site.logo | absolute_url }}";
{% endif %}
// //
// Import external dependencies // Import external dependencies
// //

View File

@ -3,6 +3,10 @@
# only Main files contain this front matter, not partials. # only Main files contain this front matter, not partials.
--- ---
{% if site.logo %}
$logo: "{{ site.logo | absolute_url }}";
{% endif %}
// //
// Import external dependencies // Import external dependencies
// //

View File

@ -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. 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 ```yaml
# Enable or disable the site search # Enable or disable the site search
# Support true (default) or false # Supports true (default) or false
search_enabled: true search_enabled: true
``` ```
@ -35,18 +42,17 @@ search_enabled: true
```yaml ```yaml
# Aux links for the upper right navigation # Aux links for the upper right navigation
aux_links: aux_links:
"Just the Docs on GitHub": "Just the Docs on GitHub":
- "//github.com/pmarsceill/just-the-docs" - "//github.com/pmarsceill/just-the-docs"
``` ```
## Heading anchor links ## Heading anchor links
```yaml ```yaml
# Heading anchor links appear on hover over h1-h6 tags # Heading anchor links appear on hover over h1-h6 tags in page content
# in page content allowing users to deep link to a particular # allowing users to deep link to a particular heading on a page.
# heading on a page.
# #
# Supprts true (default) or false/nil # Supports true (default) or false/nil
heading_anchors: true heading_anchors: true
``` ```