From 6004c7edc3e43e9079cab50b39a2dd395294a22a Mon Sep 17 00:00:00 2001 From: Paul Twohey Date: Sun, 1 Sep 2019 11:05:34 -0700 Subject: [PATCH] Optional brand logo in the menu controlled by .Site.Params.BookLogo - documentation in README.md and exampleSite/config.{toml,yaml} --- README.md | 4 ++++ assets/book.scss | 9 +++++++++ exampleSite/config.toml | 4 ++++ exampleSite/config.yaml | 6 +++++- layouts/partials/docs/brand.html | 11 ++++++++++- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76e59d5..2732dca 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,10 @@ disableKinds = ['taxonomy', 'taxonomyTerm'] # You can also specify this parameter per page in front matter 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 # When not specified file structure and weights will be used BookMenuBundle = '/menu' diff --git a/assets/book.scss b/assets/book.scss index 5922ab0..6f3a8d1 100644 --- a/assets/book.scss +++ b/assets/book.scss @@ -93,6 +93,15 @@ ul.pagination { .book-brand { margin-top: 0; + + img { + max-width: 40px; + max-height: 40px; + vertical-align: middle; + } + span { + margin-left: 0.5rem; + } } .book-menu { diff --git a/exampleSite/config.toml b/exampleSite/config.toml index ae71adb..dff15bb 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -20,6 +20,10 @@ pygmentsCodeFences = true # You can also specify this parameter per page in front matter 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 # When not specified file structure and weights will be used BookMenuBundle = '/menu' diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 59d0ddc..8c6ad8c 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -20,6 +20,10 @@ params: # You can also specify this parameter per page in front matter 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 # When not specified file structure and weights will be used BookMenuBundle: /menu @@ -45,6 +49,6 @@ params: # - In blog posts 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. BookSearch: true diff --git a/layouts/partials/docs/brand.html b/layouts/partials/docs/brand.html index 7d7b721..9a74dc0 100644 --- a/layouts/partials/docs/brand.html +++ b/layouts/partials/docs/brand.html @@ -1,3 +1,12 @@

- {{ .Site.Title }} + + {{- with .Site.Params.BookLogo -}} + Logo + + {{- end -}} + {{ .Site.Title }} + {{- with .Site.Params.BookLogo -}} + + {{- end -}} +