diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2020-01-24 00:07:47 +0100 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2020-01-24 00:07:56 +0100 |
commit | ba5d38ad4427bcda21a4cc57689464ed58d8b9a0 (patch) | |
tree | 12964eb240f749baa7276369265c89a04765d14e /layouts/partials/docs | |
parent | 2acd6ab280390057bf6d68a801a1be0f09dbd0b9 (diff) |
Rework of main template, adds options for more fine customisation
Diffstat (limited to 'layouts/partials/docs')
-rw-r--r-- | layouts/partials/docs/brand.html | 2 | ||||
-rw-r--r-- | layouts/partials/docs/footer.html | 29 | ||||
-rw-r--r-- | layouts/partials/docs/header.html | 11 | ||||
-rw-r--r-- | layouts/partials/docs/menu.html | 6 | ||||
-rw-r--r-- | layouts/partials/docs/mobile-header.html | 8 | ||||
-rw-r--r-- | layouts/partials/docs/post-meta.html | 6 | ||||
-rw-r--r-- | layouts/partials/docs/taxonomy.html | 2 | ||||
-rw-r--r-- | layouts/partials/docs/toc.html | 11 |
8 files changed, 29 insertions, 46 deletions
diff --git a/layouts/partials/docs/brand.html b/layouts/partials/docs/brand.html index 7d3ca3a..3fab74b 100644 --- a/layouts/partials/docs/brand.html +++ b/layouts/partials/docs/brand.html @@ -1,5 +1,5 @@ <h2 class="book-brand"> - <a href="{{ .Site.BaseURL }}"> + <a href="{{ .Site.BaseURL | relLangURL }}"> {{- with .Site.Params.BookLogo -}} <img src="{{ . | relURL }}" alt="Logo" /> {{- end -}} diff --git a/layouts/partials/docs/footer.html b/layouts/partials/docs/footer.html index 0665f86..f9ca80d 100644 --- a/layouts/partials/docs/footer.html +++ b/layouts/partials/docs/footer.html @@ -1,33 +1,24 @@ -<div class="book-footer justify-between"> - {{ if .Site.IsMultiLingual }} +<div class="flex justify-between"> +{{ if .Site.IsMultiLingual }} {{ partial "docs/languages" . }} - {{ end }} +{{ end }} - {{ if and .GitInfo .Site.Params.BookRepo }} - {{ with .GitInfo }} +{{ if and .GitInfo .Site.Params.BookRepo }} <div> - {{ $date := .AuthorDate.Local.Format (default "January 2, 2006" $.Site.Params.BookDateFormat) }} - <a class="flex align-center" href="{{ $.Site.Params.BookRepo }}/commit/{{ .Hash }}" title='{{ i18n "Last modified by" }} {{ .AuthorName }} | {{ $date }}' target="_blank"> + {{ $date := .GitInfo.AuthorDate.Local.Format (default "January 2, 2006" .Site.Params.BookDateFormat) }} + <a class="flex align-center" href="{{ .Site.Params.BookRepo }}/commit/{{ .GitInfo.Hash }}" title='{{ i18n "Last modified by" }} {{ .GitInfo.AuthorName }} | {{ $date }}' target="_blank" rel="noopener"> <img src="{{ "svg/calendar.svg" | relURL }}" class="book-icon" alt="Calendar" /> <span>{{ $date }}</span> </a> </div> - {{ end }} - {{ end }} +{{ end }} - {{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }} +{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }} <div> - <a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ replace .File.Path "\\" "/" }}" target="_blank"> + <a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener"> <img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="Edit" /> <span>{{ i18n "Edit this page" }}</span> </a> </div> - {{ end }} - -</div> - -{{ if (default true (default .Site.Params.BookComments .Params.bookComments)) }} -<div class="book-comments"> - {{ partial "docs/comments" . }} -</div> {{ end }} +</div> diff --git a/layouts/partials/docs/header.html b/layouts/partials/docs/header.html new file mode 100644 index 0000000..23834df --- /dev/null +++ b/layouts/partials/docs/header.html @@ -0,0 +1,11 @@ +<div class="flex align-center justify-between"> + <label for="menu-control"> + <img src="{{ "svg/menu.svg" | relURL }}" class="book-icon" alt="Menu" /> + </label> + + <strong>{{ partial "docs/title" . }}</strong> + + <label for="toc-control"> + <img src="{{ "svg/toc.svg" | relURL }}" class="book-icon" alt="Table of Contents" /> + </label> +</div> diff --git a/layouts/partials/docs/menu.html b/layouts/partials/docs/menu.html index 6e41096..0db676f 100644 --- a/layouts/partials/docs/menu.html +++ b/layouts/partials/docs/menu.html @@ -1,12 +1,12 @@ -<nav id="BookMenu"> +<nav> {{ partial "docs/brand" . }} {{ partial "docs/search" . }} {{ partial "docs/inject/menu-before" . }} {{ if .Site.Params.BookMenuBundle }} - {{ partial "docs/menu-bundle" . }} + {{ partial "docs/menu-bundle" . }} {{ else }} - {{ partial "docs/menu-filetree" . }} + {{ partial "docs/menu-filetree" . }} {{ end }} {{ partial "docs/inject/menu-after" . }} diff --git a/layouts/partials/docs/mobile-header.html b/layouts/partials/docs/mobile-header.html deleted file mode 100644 index 4212a8e..0000000 --- a/layouts/partials/docs/mobile-header.html +++ /dev/null @@ -1,8 +0,0 @@ -<header class="flex align-center justify-between book-header"> - <label id="menu-control" for="menu-control"> - <img src="{{ "svg/menu.svg" | relURL }}" class="book-icon" alt="Menu" /> - </label> - <label id="toc-control" for="toc-control"> - <strong>{{ partial "docs/title" . }}</strong> - </label> -</header> diff --git a/layouts/partials/docs/post-meta.html b/layouts/partials/docs/post-meta.html index 41221c7..c68ea95 100644 --- a/layouts/partials/docs/post-meta.html +++ b/layouts/partials/docs/post-meta.html @@ -1,4 +1,4 @@ -{{ $dateFormat := default "January 2, 2006" .Site.Params.BookDateFormat }} +{{ $dateFormat := (default "January 2, 2006" .Site.Params.BookDateFormat) }} {{ if or .Date .Params.tags }} <div> {{ with .Date}} @@ -6,10 +6,10 @@ {{ end }} {{ range $term, $_ := .Site.Taxonomies }} - {{ with $list := index $.Params $term }} + {{ with $list := $.Param $term }} <div> {{ range $n, $single := $list }}{{ if $n }}, {{ end }} - {{ with $.Site.GetPage (printf "/%s/%s" $term $single | urlize) }} + {{- with $.Site.GetPage (printf "/%s/%s" $term $single | urlize) }} <a href="{{ .RelPermalink }}">{{ .Title }}</a> {{- end }} {{- end }} diff --git a/layouts/partials/docs/taxonomy.html b/layouts/partials/docs/taxonomy.html index db82e4c..2ebeb82 100644 --- a/layouts/partials/docs/taxonomy.html +++ b/layouts/partials/docs/taxonomy.html @@ -1,4 +1,3 @@ -<aside class="book-toc fixed"> <nav> <ul> {{ range $term, $_ := .Site.Taxonomies }} @@ -17,4 +16,3 @@ {{ end }} </ul> </nav> -</aside> diff --git a/layouts/partials/docs/toc.html b/layouts/partials/docs/toc.html index 79bfc0a..64546ec 100644 --- a/layouts/partials/docs/toc.html +++ b/layouts/partials/docs/toc.html @@ -1,10 +1 @@ -{{ $tocLevels := default (default 6 .Site.Params.BookToC) .Params.BookToC }} -{{ if and $tocLevels .Page.TableOfContents }} - <aside class="book-toc levels-{{$tocLevels}} fixed"> - {{ with .Page.TableOfContents }} - <label id="toc-control" for="toc-control"> - {{ . }} - </label> - {{ end }} - </aside> -{{ end }} +{{ .TableOfContents }} |