refactor: replace gulp by webpack and npm scripts (#258)
BREAKING CHANGE: We have replaced `gulp` with `webpack` and `npm scripts` to build this theme. If you build it on your own or use build commands during the deployment, you may have to adjust your setup. BREAKING CHANGE: The `GeekblogIcons` font is using the icon name as Unicode now. As a consequence, you have to replace all references to Icons from this font if you have customized the theme. BREAKING CHANGE: We have refactored the search integration to split Hugo templates from JavaScript code. To get it working again, you need to adjust the `outputFormats` and `outputs` in your Hugo configuration file, as [documented](https://geekdocs.de/usage/configuration/#site-configuration).
This commit is contained in:
parent
2ac2a9faab
commit
5c5e2d59cb
122 changed files with 18705 additions and 5208 deletions
|
@ -1,77 +1,97 @@
|
|||
{{ $current := . }}
|
||||
{{ template "tree-nav" dict "sect" .Site.Home.Sections "current" $current }}
|
||||
|
||||
|
||||
<!-- templates -->
|
||||
{{ define "tree-nav" }}
|
||||
{{ $current := .current }}
|
||||
{{ $current := .current }}
|
||||
|
||||
<ul class="gdoc-nav__list">
|
||||
{{ $sortBy := (default "title" .current.Site.Params.GeekdocFileTreeSortBy | lower) }}
|
||||
{{ range .sect.GroupBy "Weight" }}
|
||||
{{ $rangeBy := .ByTitle }}
|
||||
|
||||
{{ if eq $sortBy "title" }}
|
||||
{{ $rangeBy = .ByTitle }}
|
||||
{{ else if eq $sortBy "linktitle" }}
|
||||
{{ $rangeBy = .ByLinkTitle }}
|
||||
{{ else if eq $sortBy "date" }}
|
||||
{{ $rangeBy = .ByDate }}
|
||||
{{ else if eq $sortBy "publishdate" }}
|
||||
{{ $rangeBy = .ByPublishDate }}
|
||||
{{ else if eq $sortBy "expirydate" }}
|
||||
{{ $rangeBy = .ByExpiryDate }}
|
||||
{{ else if eq $sortBy "lastmod" }}
|
||||
{{ $rangeBy = .ByLastmod }}
|
||||
{{ else if eq $sortBy "title_reverse" }}
|
||||
{{ $rangeBy = .ByTitle.Reverse }}
|
||||
{{ else if eq $sortBy "linktitle_reverse" }}
|
||||
{{ $rangeBy = .ByLinkTitle.Reverse }}
|
||||
{{ else if eq $sortBy "date_reverse" }}
|
||||
{{ $rangeBy = .ByDate.Reverse }}
|
||||
{{ else if eq $sortBy "publishdate_reverse" }}
|
||||
{{ $rangeBy = .ByPublishDate.Reverse }}
|
||||
{{ else if eq $sortBy "expirydate_reverse" }}
|
||||
{{ $rangeBy = .ByExpiryDate.Reverse }}
|
||||
{{ else if eq $sortBy "lastmod_reverse" }}
|
||||
{{ $rangeBy = .ByLastmod.Reverse }}
|
||||
{{ end }}
|
||||
<ul class="gdoc-nav__list">
|
||||
{{ $sortBy := (default "title" .current.Site.Params.GeekdocFileTreeSortBy | lower) }}
|
||||
{{ range .sect.GroupBy "Weight" }}
|
||||
{{ $rangeBy := .ByTitle }}
|
||||
|
||||
{{ range $rangeBy }}
|
||||
{{ if not .Params.GeekdocHidden }}
|
||||
{{ if eq $sortBy "title" }}
|
||||
{{ $rangeBy = .ByTitle }}
|
||||
{{ else if eq $sortBy "linktitle" }}
|
||||
{{ $rangeBy = .ByLinkTitle }}
|
||||
{{ else if eq $sortBy "date" }}
|
||||
{{ $rangeBy = .ByDate }}
|
||||
{{ else if eq $sortBy "publishdate" }}
|
||||
{{ $rangeBy = .ByPublishDate }}
|
||||
{{ else if eq $sortBy "expirydate" }}
|
||||
{{ $rangeBy = .ByExpiryDate }}
|
||||
{{ else if eq $sortBy "lastmod" }}
|
||||
{{ $rangeBy = .ByLastmod }}
|
||||
{{ else if eq $sortBy "title_reverse" }}
|
||||
{{ $rangeBy = .ByTitle.Reverse }}
|
||||
{{ else if eq $sortBy "linktitle_reverse" }}
|
||||
{{ $rangeBy = .ByLinkTitle.Reverse }}
|
||||
{{ else if eq $sortBy "date_reverse" }}
|
||||
{{ $rangeBy = .ByDate.Reverse }}
|
||||
{{ else if eq $sortBy "publishdate_reverse" }}
|
||||
{{ $rangeBy = .ByPublishDate.Reverse }}
|
||||
{{ else if eq $sortBy "expirydate_reverse" }}
|
||||
{{ $rangeBy = .ByExpiryDate.Reverse }}
|
||||
{{ else if eq $sortBy "lastmod_reverse" }}
|
||||
{{ $rangeBy = .ByLastmod.Reverse }}
|
||||
{{ end }}
|
||||
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ $isParent := and (ne $numberOfPages 0) (not .Params.GeekdocFlatSection) }}
|
||||
{{ $isCurrent := eq $current . }}
|
||||
{{ $isAncestor := .IsAncestor $current }}
|
||||
{{ $id := substr (sha1 .Permalink) 0 8 }}
|
||||
{{ $doCollapse := and $isParent (or .Params.GeekdocCollapseSection (default false .Site.Params.GeekdocCollapseAllSections)) }}
|
||||
{{ range $rangeBy }}
|
||||
{{ if not .Params.GeekdocHidden }}
|
||||
|
||||
<li>
|
||||
{{ if $doCollapse }}
|
||||
<input type="checkbox" id="{{ printf "navtree-%s" $id }}" class="gdoc-nav__toggle" {{ if or $isCurrent $isAncestor }}checked{{ end }}>
|
||||
<label for="{{ printf "navtree-%s" $id }}" class="flex justify-between">
|
||||
{{ end }}
|
||||
{{ if or .Content .Params.GeekdocFlatSection }}
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ $isParent := and (ne $numberOfPages 0) (not .Params.GeekdocFlatSection) }}
|
||||
{{ $isCurrent := eq $current . }}
|
||||
{{ $isAncestor := .IsAncestor $current }}
|
||||
{{ $id := substr (sha1 .Permalink) 0 8 }}
|
||||
{{ $doCollapse := and $isParent (or .Params.GeekdocCollapseSection (default false .Site.Params.GeekdocCollapseAllSections)) }}
|
||||
|
||||
|
||||
<li>
|
||||
<input
|
||||
type="checkbox"
|
||||
{{ if $doCollapse }}
|
||||
class="gdoc-nav__toggle" id="{{ printf "navtree-%s" $id }}"
|
||||
{{ if or $isCurrent $isAncestor }}checked{{ end }}
|
||||
{{ else }}
|
||||
class="hidden"
|
||||
{{ end }}
|
||||
/>
|
||||
<label
|
||||
{{ if $doCollapse }}
|
||||
for="{{ printf "navtree-%s" $id }}" class="flex justify-between"
|
||||
{{ end }}
|
||||
>
|
||||
{{ if or .Content .Params.GeekdocFlatSection }}
|
||||
<span class="flex">
|
||||
<a href="{{ .RelPermalink }}" class="gdoc-nav__entry {{ if eq $current . }}is-active{{ end }}">
|
||||
{{ partial "title" . }}
|
||||
</a>
|
||||
<a
|
||||
href="{{ .RelPermalink }}"
|
||||
class="gdoc-nav__entry {{ if eq $current . }}is-active{{ end }}"
|
||||
>
|
||||
{{ partial "title" . }}
|
||||
</a>
|
||||
</span>
|
||||
{{ else }}
|
||||
{{ else }}
|
||||
<span class="flex">{{ partial "title" . }}</span>
|
||||
{{ end }}
|
||||
{{ if $doCollapse }}
|
||||
<svg class="icon gdoc_keyborad_arrow_left"><use xlink:href="#gdoc_keyborad_arrow_left"></use></svg>
|
||||
<svg class="icon gdoc_keyborad_arrow_down"><use xlink:href="#gdoc_keyborad_arrow_down"></use></svg>
|
||||
{{ end }}
|
||||
{{ if $doCollapse }}
|
||||
<svg class="icon gdoc_keyborad_arrow_left">
|
||||
<use xlink:href="#gdoc_keyborad_arrow_left"></use>
|
||||
</svg>
|
||||
<svg class="icon gdoc_keyborad_arrow_down">
|
||||
<use xlink:href="#gdoc_keyborad_arrow_down"></use>
|
||||
</svg>
|
||||
{{ end }}
|
||||
</label>
|
||||
{{ end }}
|
||||
|
||||
{{ if $isParent }}
|
||||
{{ template "tree-nav" dict "sect" .Pages "current" $current}}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ template "tree-nav" dict "sect" .Pages "current" $current }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue