diff --git a/.drone.yml b/.drone.yml index 8800024..d309d94 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,7 +15,7 @@ steps: - gulp default - name: test - image: klakegg/hugo:0.59.1-ext-alpine + image: klakegg/hugo:0.69.0-ext-alpine commands: - cd exampleSite/ - mkdir themes/ && ln -s ../../. themes/hugo-geekdoc && hugo-official @@ -72,7 +72,7 @@ steps: - curl -L https://github.com/xoxys/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C exampleSite/themes/hugo-geekdoc/ --strip-components=1 - name: test - image: klakegg/hugo:0.59.1-ext-alpine + image: klakegg/hugo:0.69.0-ext-alpine commands: - cd exampleSite/ && hugo-official diff --git a/README.md b/README.md index d03593b..35f7465 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Hugo Geekdoc Theme [![Build Status](https://img.shields.io/drone/build/xoxys/hugo-geekdoc?logo=drone)](https://cloud.drone.io/xoxys/hugo-geekdoc) -[![Hugo Version](https://img.shields.io/badge/hugo-0.55-blue.svg)](https://gohugo.io) +[![Hugo Version](https://img.shields.io/badge/hugo-0.65-blue.svg)](https://gohugo.io) [![GitHub release](https://img.shields.io/github/v/release/xoxys/hugo-geekdoc)](https://github.com/xoxys/hugo-geekdoc/releases/latest) [![License: MIT](https://img.shields.io/github/license/xoxys/hugo-geekdoc)](LICENSE) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 09dced4..7278905 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -16,6 +16,7 @@ markup: unsafe: true tableOfContents: startLevel: 1 + endLevel: 9 params: geekdocToC: 3 diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index e341f91..6c7862b 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -3,7 +3,7 @@ title: Documentation --- [![Build Status](https://img.shields.io/drone/build/xoxys/hugo-geekdoc?logo=drone)](https://cloud.drone.io/xoxys/hugo-geekdoc) -[![Hugo Version](https://img.shields.io/badge/hugo-0.55-blue.svg)](https://gohugo.io) +[![Hugo Version](https://img.shields.io/badge/hugo-0.65-blue.svg)](https://gohugo.io) [![GitHub release](https://img.shields.io/github/v/release/xoxys/hugo-geekdoc)](https://github.com/xoxys/hugo-geekdoc/releases/latest) [![License: MIT](https://img.shields.io/github/license/xoxys/hugo-geekdoc)](LICENSE) @@ -16,7 +16,3 @@ Geekdoc is a simple Hugo theme for documentations. This work is inspired and par - Customisable - Zero initial configuration - Handy shortcodes - -## Requirements - -- Hugo 0.55 or higher diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html index ea04661..aa05c10 100644 --- a/layouts/shortcodes/button.html +++ b/layouts/shortcodes/button.html @@ -2,16 +2,16 @@ {{ $target := "" }} {{ with .Get "href" }} - {{ $ref = . }} - {{ $target = "_blank" }} + {{ $ref = . }} + {{ $target = "_blank" }} {{ end }} {{ with .Get "relref" }} - {{ $ref = relref $ . }} + {{ $ref = relref $ . }} {{ end }} - {{ $.Inner }} + {{ $.Inner }} diff --git a/layouts/shortcodes/columns.html b/layouts/shortcodes/columns.html index 4d474b8..ce92aee 100644 --- a/layouts/shortcodes/columns.html +++ b/layouts/shortcodes/columns.html @@ -1,7 +1,7 @@
- {{ range split .Inner "<--->" }} -
- {{ . | markdownify }} -
- {{ end }} + {{ range split .Inner "<--->" }} +
+ {{ . | markdownify }} +
+ {{ end }}
diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html index 0be90c2..f3b67c9 100644 --- a/layouts/shortcodes/expand.html +++ b/layouts/shortcodes/expand.html @@ -1,12 +1,12 @@
- +
diff --git a/layouts/shortcodes/hint.html b/layouts/shortcodes/hint.html index 8bf8ce1..5506853 100644 --- a/layouts/shortcodes/hint.html +++ b/layouts/shortcodes/hint.html @@ -1,3 +1,3 @@
- {{ .Inner | markdownify }} + {{ .Inner | markdownify }}
diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html index 3948eca..d144c6a 100644 --- a/layouts/shortcodes/mermaid.html +++ b/layouts/shortcodes/mermaid.html @@ -1,9 +1,14 @@ {{ if not (.Page.Scratch.Get "mermaid") }} + {{ .Page.Scratch.Set "mermaid" true }} {{ end }}

- {{ .Inner }} + {{- .Inner -}}

diff --git a/layouts/shortcodes/tab.html b/layouts/shortcodes/tab.html index 9c162e7..e2a207c 100644 --- a/layouts/shortcodes/tab.html +++ b/layouts/shortcodes/tab.html @@ -1,12 +1,12 @@ {{ if .Parent }} - {{ $name := .Get 0 }} - {{ $group := printf "tabs-%s" (.Parent.Get 0) }} + {{ $name := .Get 0 }} + {{ $group := printf "tabs-%s" (.Parent.Get 0) }} - {{ if not (.Parent.Scratch.Get $group) }} - {{ .Parent.Scratch.Set $group slice }} - {{ end }} + {{ if not (.Parent.Scratch.Get $group) }} + {{ .Parent.Scratch.Set $group slice }} + {{ end }} - {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} + {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} {{ else }} - {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} + {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} {{ end}} diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html index 2ab4d1f..fb9965a 100644 --- a/layouts/shortcodes/tabs.html +++ b/layouts/shortcodes/tabs.html @@ -3,14 +3,14 @@ {{ $group := printf "tabs-%s" $id }}
- {{ range $index, $tab := .Scratch.Get $group }} - - -
- {{ .Content | markdownify }} -
- {{ end }} + {{ range $index, $tab := .Scratch.Get $group }} + + +
+ {{ .Content | markdownify }} +
+ {{ end }}
diff --git a/layouts/shortcodes/toc-tree.html b/layouts/shortcodes/toc-tree.html index 7fe4620..310bd5a 100644 --- a/layouts/shortcodes/toc-tree.html +++ b/layouts/shortcodes/toc-tree.html @@ -1,35 +1,33 @@ {{ $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }} {{ if $tocLevels }} -
- {{ template "toc-tree" dict "sect" .Page.Pages }} -
+
+ {{ template "toc-tree" dict "sect" .Page.Pages }} +
{{ end }} {{ define "toc-tree" }} - {{ end }} diff --git a/layouts/shortcodes/toc.html b/layouts/shortcodes/toc.html index b1c64e9..771478f 100644 --- a/layouts/shortcodes/toc.html +++ b/layouts/shortcodes/toc.html @@ -1,8 +1,5 @@ {{ $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }} {{ if and $tocLevels .Page.TableOfContents }} -
- {{ .Page.TableOfContents }} -
-
+
{{ .Page.TableOfContents }}
{{ end }}