code cleanup and add documentation for config params

This commit is contained in:
Robert Kaussow 2020-01-14 00:15:39 +01:00
parent f2f51adff0
commit aac46df166
12 changed files with 196 additions and 43 deletions

View file

@ -8,9 +8,9 @@
<ul class="gdoc-nav__list">
{{ range .sect.GroupBy "Weight" "desc" }}
{{ range .ByTitle }}
{{ if not .Params.geekdocHidden }}
<li>
{{ if or .Content .Params.ListOnly }}
{{ if or .Content .Params.geekdocFlatSection }}
<span class="flex">
<a href="{{ .RelPermalink }}" class="gdoc-nav__entry {{ if eq $current . }}is-active{{ end }}">
{{ partial "title" . }}
@ -21,11 +21,11 @@
{{ end }}
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
{{ if and (ne $numberOfPages 0) (not .Params.ListOnly) }}
{{ if and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }}
{{ template "tree-nav" dict "sect" .Pages "current" $current}}
{{ end }}
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>

View file

@ -44,7 +44,7 @@
<div class="gdoc-page__footer flex justify-between">
{{ $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev) .Site.Params.GeekdocMenuBundle) }}
{{ $showPrevNext := (and (not .Site.Params.GeekdocNextPrev) .Site.Params.GeekdocMenuBundle) }}
{{ if $showPrevNext }}
<span>
{{ with ($current.Scratch.Get "prevPage") }}

View file

@ -17,7 +17,7 @@
{{end}}
<div class="gdoc-page__header flex justify-between" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
{{$showBreadcrumb := (and (not .Params.disableBreadcrumb) (not .Site.Params.disableBreadcrumb))}}
{{$showBreadcrumb := (and (not .Page.Params.geekdocBreadcrumb) (not .Site.Params.geekdocBreadcrumb))}}
<span>
{{if $showBreadcrumb}}
<span class="breadcrumb">

View file

@ -6,7 +6,7 @@
</label>
<a class="gdoc-header__link" href="{{ .Site.BaseURL }}">
<span class="gdoc-brand flex align-center">
<img class="gdoc-brand__img" src="{{ "brand.svg" | relURL }}" alt="Branding" width=48 height=48>
<img class="gdoc-brand__img" src="{{ (default "brand.svg" .Site.Params.GeekdocLogo) | relURL }}" alt="{{ .Site.Title }}" width=38 height=38>
{{ .Site.Title }}
</span>
</a>