Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Guerrero Ibarra <wolf.fox1985@gmail.com>2021-08-16 18:29:31 +0300
committerGitHub <noreply@github.com>2021-08-16 18:29:31 +0300
commitfce0ad3c19f55b5d916b741bcee1516001d3b08d (patch)
treee8baa58f533b12ae77e5d2f7663c2256254175fb
parent0204d2ff126740f29b0f21639b66281d82c68528 (diff)
Text alternative for logo. (#314)
* Text alternative for logo. * markdown
-rw-r--r--README.md11
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/partials/nav.html8
3 files changed, 19 insertions, 3 deletions
diff --git a/README.md b/README.md
index 07600d7..50f5261 100644
--- a/README.md
+++ b/README.md
@@ -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">