diff options
author | Guillermo Guerrero Ibarra <wolf.fox1985@gmail.com> | 2021-08-16 18:29:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-16 18:29:31 +0300 |
commit | fce0ad3c19f55b5d916b741bcee1516001d3b08d (patch) | |
tree | e8baa58f533b12ae77e5d2f7663c2256254175fb | |
parent | 0204d2ff126740f29b0f21639b66281d82c68528 (diff) |
Text alternative for logo. (#314)
* Text alternative for logo.
* markdown
-rw-r--r-- | README.md | 11 | ||||
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/partials/nav.html | 8 |
3 files changed, 19 insertions, 3 deletions
@@ -119,7 +119,16 @@ Leave the `googleAnalytics` key empty to disable it. ### Logo -You can select the logos using the logo and logo_small parameters. The logo_small value will be used when the site is rendered on small screens. +A logo can be selected, two parameters `logo` and `logo_small` can be defined. By default `logo` is used for medium and big screens and the `logo_small` value will be used when the site is rendered on small screens. Also there is the posibility to disable the logo and render a alternative text. + +```toml +[params] + disabled_logo = false + logo_text = "Universal" + + logo = "img/logo.png" + logo_small = "img/logo-small.png" +``` ### Contact form diff --git a/exampleSite/config.toml b/exampleSite/config.toml index fa3fffc..7d25c3d 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -437,6 +437,9 @@ paginate = 10 # Format dates with Go's time formatting date_format = "January 2, 2006" + disabled_logo = false + logo_text = "Universal" + logo = "img/logo.png" logo_small = "img/logo-small.png" address = """<p class="text-uppercase"><strong>Universal Ltd.</strong> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 8142469..dd44ae0 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -3,8 +3,12 @@ <div class="container"> <div class="navbar-header"> <a class="navbar-brand home" href="{{ "/" | relURL }}"> - <img src="{{ .Site.Params.logo | relURL }}" alt="{{ .Title }} logo" class="hidden-xs hidden-sm"> - <img src="{{ .Site.Params.logo_small | relURL }}" alt="{{ .Title }} logo" class="visible-xs visible-sm"> + {{ if default false .Site.Params.disabled_logo }} + <h4>{{ .Site.Params.logo_text }}</h4> + {{ else }} + <img src="{{ .Site.Params.logo | relURL }}" alt="{{ .Title }} logo" class="hidden-xs hidden-sm" /> + <img src="{{ .Site.Params.logo_small | relURL }}" alt="{{ .Title }} logo" class="visible-xs visible-sm" /> + {{ end }} <span class="sr-only">{{ .Title }} - {{ i18n "navHome" }}</span> </a> <div class="navbar-buttons"> |