mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-25 12:46:44 +00:00
Optional brand logo in the menu controlled by .Site.Params.BookLogo
- documentation in README.md and exampleSite/config.{toml,yaml}
This commit is contained in:
parent
7d0ee68c3b
commit
6004c7edc3
@ -127,6 +127,10 @@ disableKinds = ['taxonomy', 'taxonomyTerm']
|
|||||||
# You can also specify this parameter per page in front matter
|
# You can also specify this parameter per page in front matter
|
||||||
BookToC = 3
|
BookToC = 3
|
||||||
|
|
||||||
|
# (Optional, default none) Set the path to a logo for the book. If the logo is
|
||||||
|
# /static/logo.png then the path would be /logo.png
|
||||||
|
BookLogo = '/logo.png'
|
||||||
|
|
||||||
# (Optional, default none) Set leaf bundle to render as side menu
|
# (Optional, default none) Set leaf bundle to render as side menu
|
||||||
# When not specified file structure and weights will be used
|
# When not specified file structure and weights will be used
|
||||||
BookMenuBundle = '/menu'
|
BookMenuBundle = '/menu'
|
||||||
|
@ -93,6 +93,15 @@ ul.pagination {
|
|||||||
|
|
||||||
.book-brand {
|
.book-brand {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 40px;
|
||||||
|
max-height: 40px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.book-menu {
|
.book-menu {
|
||||||
|
@ -20,6 +20,10 @@ pygmentsCodeFences = true
|
|||||||
# You can also specify this parameter per page in front matter
|
# You can also specify this parameter per page in front matter
|
||||||
BookToC = 3
|
BookToC = 3
|
||||||
|
|
||||||
|
# (Optional, default none) Set the path to a logo for the book. If the logo is
|
||||||
|
# /static/logo.png then the path would be /logo.png
|
||||||
|
# BookLogo = '/logo.png'
|
||||||
|
|
||||||
# (Optional, default none) Set leaf bundle to render as side menu
|
# (Optional, default none) Set leaf bundle to render as side menu
|
||||||
# When not specified file structure and weights will be used
|
# When not specified file structure and weights will be used
|
||||||
BookMenuBundle = '/menu'
|
BookMenuBundle = '/menu'
|
||||||
|
@ -20,6 +20,10 @@ params:
|
|||||||
# You can also specify this parameter per page in front matter
|
# You can also specify this parameter per page in front matter
|
||||||
BookToC: 3
|
BookToC: 3
|
||||||
|
|
||||||
|
# (Optional, default none) Set the path to a logo for the book. If the logo is
|
||||||
|
# /static/logo.png then the path would be /logo.png
|
||||||
|
# BookLogo: /logo.png
|
||||||
|
|
||||||
# (Optional, default none) Set leaf bundle to render as side menu
|
# (Optional, default none) Set leaf bundle to render as side menu
|
||||||
# When not specified file structure and weights will be used
|
# When not specified file structure and weights will be used
|
||||||
BookMenuBundle: /menu
|
BookMenuBundle: /menu
|
||||||
@ -45,6 +49,6 @@ params:
|
|||||||
# - In blog posts
|
# - In blog posts
|
||||||
BookDateFormat: 'Jan 2, 2006'
|
BookDateFormat: 'Jan 2, 2006'
|
||||||
|
|
||||||
# (Optional, default true) Enables search function with lunr.js,
|
# (Optional, default true) Enables search function with lunr.js,
|
||||||
# Index is built on fly, therefore it might slowdown your website.
|
# Index is built on fly, therefore it might slowdown your website.
|
||||||
BookSearch: true
|
BookSearch: true
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
<h2 class="book-brand">
|
<h2 class="book-brand">
|
||||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
<a href="{{ .Site.BaseURL }}">
|
||||||
|
{{- with .Site.Params.BookLogo -}}
|
||||||
|
<img src="{{ . }}" alt="Logo" />
|
||||||
|
<span>
|
||||||
|
{{- end -}}
|
||||||
|
{{ .Site.Title }}
|
||||||
|
{{- with .Site.Params.BookLogo -}}
|
||||||
|
</span>
|
||||||
|
{{- end -}}
|
||||||
|
</a>
|
||||||
</h2>
|
</h2>
|
||||||
|
Loading…
Reference in New Issue
Block a user