update required hugo min version to v0.65

This commit is contained in:
Robert Kaussow 2020-04-15 01:09:53 +02:00
parent e0f69f1cf7
commit ea44ee3860
13 changed files with 73 additions and 76 deletions

View File

@ -15,7 +15,7 @@ steps:
- gulp default - gulp default
- name: test - name: test
image: klakegg/hugo:0.59.1-ext-alpine image: klakegg/hugo:0.69.0-ext-alpine
commands: commands:
- cd exampleSite/ - cd exampleSite/
- mkdir themes/ && ln -s ../../. themes/hugo-geekdoc && hugo-official - 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 - 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 - name: test
image: klakegg/hugo:0.59.1-ext-alpine image: klakegg/hugo:0.69.0-ext-alpine
commands: commands:
- cd exampleSite/ && hugo-official - cd exampleSite/ && hugo-official

View File

@ -1,7 +1,7 @@
# Hugo Geekdoc Theme # Hugo Geekdoc Theme
[![Build Status](https://img.shields.io/drone/build/xoxys/hugo-geekdoc?logo=drone)](https://cloud.drone.io/xoxys/hugo-geekdoc) [![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) [![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) [![License: MIT](https://img.shields.io/github/license/xoxys/hugo-geekdoc)](LICENSE)

View File

@ -16,6 +16,7 @@ markup:
unsafe: true unsafe: true
tableOfContents: tableOfContents:
startLevel: 1 startLevel: 1
endLevel: 9
params: params:
geekdocToC: 3 geekdocToC: 3

View File

@ -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) [![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) [![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) [![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 - Customisable
- Zero initial configuration - Zero initial configuration
- Handy shortcodes - Handy shortcodes
## Requirements
- Hugo 0.55 or higher

View File

@ -2,16 +2,16 @@
{{ $target := "" }} {{ $target := "" }}
{{ with .Get "href" }} {{ with .Get "href" }}
{{ $ref = . }} {{ $ref = . }}
{{ $target = "_blank" }} {{ $target = "_blank" }}
{{ end }} {{ end }}
{{ with .Get "relref" }} {{ with .Get "relref" }}
{{ $ref = relref $ . }} {{ $ref = relref $ . }}
{{ end }} {{ end }}
<span class="gdoc-button{{ with .Get "class" }} {{ . }}{{ end }}"> <span class="gdoc-button{{ with .Get "class" }} {{ . }}{{ end }}">
<a {{ with $ref }} href="{{.}}" {{ end }} {{ with $target }} target="{{.}}" {{ end }} class="gdoc-button__link"> <a {{ with $ref }} href="{{.}}" {{ end }} {{ with $target }} target="{{.}}" {{ end }} class="gdoc-button__link">
{{ $.Inner }} {{ $.Inner }}
</a> </a>
</span> </span>

View File

@ -1,7 +1,7 @@
<div class="gdoc-columns flex flex-wrap"> <div class="gdoc-columns flex flex-wrap">
{{ range split .Inner "<--->" }} {{ range split .Inner "<--->" }}
<div class="gdoc-columns__content gdoc-markdown--nested flex-even"> <div class="gdoc-columns__content gdoc-markdown--nested flex-even">
{{ . | markdownify }} {{ . | markdownify }}
</div> </div>
{{ end }} {{ end }}
</div> </div>

View File

@ -1,12 +1,12 @@
<div class="gdoc-expand"> <div class="gdoc-expand">
<label> <label>
<div class="gdoc-expand__head flex justify-between"> <div class="gdoc-expand__head flex justify-between">
<span>{{ default "Expand" (.Get 0) }}</span> <span>{{ default "Expand" (.Get 0) }}</span>
<span>{{ default "↕" (.Get 1) }}</span> <span>{{ default "↕" (.Get 1) }}</span>
</div> </div>
<input type="checkbox" class="gdoc-expand__control hidden" /> <input type="checkbox" class="gdoc-expand__control hidden" />
<div class="gdoc-markdown--nested gdoc-expand__content"> <div class="gdoc-markdown--nested gdoc-expand__content">
{{ .Inner | markdownify }} {{ .Inner | markdownify }}
</div> </div>
</label> </label>
</div> </div>

View File

@ -1,3 +1,3 @@
<blockquote class="gdoc-hint {{ .Get 0 }}"> <blockquote class="gdoc-hint {{ .Get 0 }}">
{{ .Inner | markdownify }} {{ .Inner | markdownify }}
</blockquote> </blockquote>

View File

@ -1,9 +1,14 @@
{{ if not (.Page.Scratch.Get "mermaid") }} {{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time --> <!-- Include mermaid only first time -->
<script src="{{ "js/mermaid.min.js" | relURL }}"></script> <script src="{{ "js/mermaid.min.js" | relURL }}"></script>
<script>
mermaid.initialize({
flowchart: { useMaxWidth: true }
});
</script>
{{ .Page.Scratch.Set "mermaid" true }} {{ .Page.Scratch.Set "mermaid" true }}
{{ end }} {{ end }}
<p class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}"> <p class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
{{ .Inner }} {{- .Inner -}}
</p> </p>

View File

@ -1,12 +1,12 @@
{{ if .Parent }} {{ if .Parent }}
{{ $name := .Get 0 }} {{ $name := .Get 0 }}
{{ $group := printf "tabs-%s" (.Parent.Get 0) }} {{ $group := printf "tabs-%s" (.Parent.Get 0) }}
{{ if not (.Parent.Scratch.Get $group) }} {{ if not (.Parent.Scratch.Get $group) }}
{{ .Parent.Scratch.Set $group slice }} {{ .Parent.Scratch.Set $group slice }}
{{ end }} {{ end }}
{{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }}
{{ else }} {{ else }}
{{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }}
{{ end}} {{ end}}

View File

@ -3,14 +3,14 @@
{{ $group := printf "tabs-%s" $id }} {{ $group := printf "tabs-%s" $id }}
<div class="gdoc-tabs"> <div class="gdoc-tabs">
{{ range $index, $tab := .Scratch.Get $group }} {{ range $index, $tab := .Scratch.Get $group }}
<input type="radio" class="gdoc-tabs__control hidden" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" <input type="radio" class="gdoc-tabs__control hidden" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}"
{{ if not $index }}checked="checked" {{ end }} /> {{ if not $index }}checked="checked" {{ end }} />
<label for="{{ printf "%s-%d" $group $index }}" class="gdoc-tabs__label"> <label for="{{ printf "%s-%d" $group $index }}" class="gdoc-tabs__label">
{{ $tab.Name }} {{ $tab.Name }}
</label> </label>
<div class="gdoc-markdown--nested gdoc-tabs__content"> <div class="gdoc-markdown--nested gdoc-tabs__content">
{{ .Content | markdownify }} {{ .Content | markdownify }}
</div> </div>
{{ end }} {{ end }}
</div> </div>

View File

@ -1,35 +1,33 @@
{{ $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }} {{ $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }}
{{ if $tocLevels }} {{ if $tocLevels }}
<div class="gdoc-toc gdoc-toc__level--{{$tocLevels}}"> <div class="gdoc-toc gdoc-toc__level--{{$tocLevels}}">
{{ template "toc-tree" dict "sect" .Page.Pages }} {{ template "toc-tree" dict "sect" .Page.Pages }}
</div> </div>
{{ end }} {{ end }}
<!-- templates --> <!-- templates -->
{{ define "toc-tree" }} {{ define "toc-tree" }}
<ul> <ul>
{{ range .sect.GroupBy "Weight" }} {{ range .sect.GroupBy "Weight" }}
{{ range .ByTitle }} {{ range .ByTitle }}
{{ if not .Params.geekdocHidden }} {{ if not .Params.geekdocHidden }}
<li> <li>
{{ if or .Content .Params.geekdocFlatSection }} {{ if or .Content .Params.geekdocFlatSection }}
<span> <span>
<a href="{{ .RelPermalink }}" class="gdoc-toc__entry"> <a href="{{ .RelPermalink }}" class="gdoc-toc__entry">{{ partial "title" . }}</a>
{{ partial "title" . }} </span>
</a> {{ else }}
</span> <span>{{ partial "title" . }}</span>
{{ else }} {{ end }}
<span>{{ partial "title" . }}</span>
{{ end }}
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }} {{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
{{ if and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }} {{ if and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }}
{{ template "toc-tree" dict "sect" .Pages }} {{ template "toc-tree" dict "sect" .Pages }}
{{ end }} {{ end }}
</li> </li>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}
</ul> </ul>
{{ end }} {{ end }}

View File

@ -1,8 +1,5 @@
{{ $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }} {{ $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }}
{{ if and $tocLevels .Page.TableOfContents }} {{ if and $tocLevels .Page.TableOfContents }}
<div class="gdoc-toc gdoc-toc__level--{{$tocLevels}}"> <div class="gdoc-toc gdoc-toc__level--{{$tocLevels}}">{{ .Page.TableOfContents }}<hr></div>
{{ .Page.TableOfContents }}
<hr>
</div>
{{ end }} {{ end }}