add hugo-book theme module

customization:
- automatically add title to every page
- allow mermaid codeblocks to render without shortcodes
This commit is contained in:
Johannes Kimmel 2022-11-18 17:06:38 +01:00
parent ab42f7fee0
commit 15ec6bbc19
6 changed files with 40 additions and 0 deletions

View File

@ -9,3 +9,12 @@ enableGitInfo: true
markup: markup:
tableOfContents: tableOfContents:
endLevel: 4 endLevel: 4
module:
imports:
- path: github.com/alex-shpak/hugo-book
params:
# https://themes.gohugo.io/themes/hugo-book/
BookSection: "*"
# BookTheme: auto # erst Grafiken anpassen

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module git.freifunk-franken.de/freifunk-franken/docs
go 1.19
require github.com/alex-shpak/hugo-book v0.0.0-20221111100854-d5b75f4fb3aa // indirect

2
go.sum Normal file
View File

@ -0,0 +1,2 @@
github.com/alex-shpak/hugo-book v0.0.0-20221111100854-d5b75f4fb3aa h1:VthswmcR+7NtpamidIRuFq+8JRAz4v+s7xVJ0MmeLqM=
github.com/alex-shpak/hugo-book v0.0.0-20221111100854-d5b75f4fb3aa/go.mod h1:L4NMyzbn15fpLIpmmtDg9ZFFyTZzw87/lk7M2bMQ7ds=

View File

@ -0,0 +1,12 @@
{{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time -->
<script src="{{ "mermaid.min.js" | relURL }}"></script>
{{ with resources.Get "mermaid.json" }}
<script>mermaid.initialize({{ .Content | safeJS }})</script>
{{ end }}
{{ .Page.Scratch.Set "mermaid" true }}
{{ end }}
<p class="mermaid">
{{- .Inner -}}
</p>

View File

@ -0,0 +1,6 @@
{{ define "main" }}
<article class="markdown">
<h1>{{- .Page.Title -}}</h1>
{{- .Content -}}
</article>
{{ end }}

View File

@ -0,0 +1,6 @@
{{ define "main" }}
<article class="markdown">
<h1>{{- .Page.Title -}}</h1>
{{- .Content -}}
</article>
{{ end }}