config: Add option to display logo instead of title in nav bar (#214)

* Add `logo = ""` to `[params]` config
This commit is contained in:
George Cushen committed 2017-10-17 01:59:51 +01:00
1 parent 0fb54898df
commit 41d0123b54
3 files changed
+19 -1

No files matched your search

+4
View File
@@ -57,6 +57,10 @@ defaultContentLanguageInSubdir = false
# Enable Keybase in Contact section by entering your keybase.io username.
keybase = ""
# Diplay a logo in navigation bar rather than title (optional).
# To enable, place an image in `static/img/` and reference its filename below. To disable, set the value to "".
logo = ""
# Enable Google Maps by entering your API key, latitude, and longitude.
# Get your API key: https://developers.google.com/maps/documentation/javascript/get-api-key
# Get your coords: Right-click place on Google Maps. Select 'What's here?'. At the bottom is a card with the coords.
+8
View File
@@ -1024,6 +1024,10 @@ nav#navbar-main li {
padding-bottom: 10px;
}
.navbar-brand img {
max-height: 50px;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: {{ .Get "menu_text" }} !important;
}
@@ -1092,6 +1096,10 @@ nav#navbar-main li {
padding-bottom: 5px;
}
.navbar-brand img {
max-height: 40px;
}
.navbar-header {
float: none;
min-height: inherit;
+7 -1
View File
@@ -12,7 +12,13 @@
<span class="icon-bar"></span>
</button>
{{ end }}
<a class="navbar-brand" href="{{ "/" | relLangURL }}">{{ .Site.Title }}</a>
<a class="navbar-brand" href="{{ "/" | relLangURL }}">
{{- if .Site.Params.logo -}}
<img src="{{ printf "/img/%s" .Site.Params.logo | relURL }}" alt="{{ .Site.Title }}">
{{- else -}}
{{- .Site.Title -}}
{{- end -}}
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->