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,48 +1,57 @@
|
|||
{{ $geekdocRepo := default (default false .Site.Params.GeekdocRepo) .Page.Params.GeekdocRepo }}
|
||||
{{ $geekdocEditPath := default (default false .Site.Params.GeekdocEditPath) .Page.Params.GeekdocEditPath }}
|
||||
{{ if .File }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" (default .File.Path .Page.Params.GeekdocFilePath) }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" (default .File.Path .Page.Params.GeekdocFilePath) }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" false }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" false }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "breadcrumb" }}
|
||||
{{ $parent := .page.Parent }}
|
||||
{{ if $parent }}
|
||||
{{ $name := (partial "title" $parent) }}
|
||||
{{ $position := (sub .position 1) }}
|
||||
{{ $value := (printf "<li itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'><a itemscope itemtype='https://schema.org/WebPage' itemprop='item' itemid='%s' href='%s'><span itemprop='name'>%s</span></a><meta itemprop='position' content='%d' /></li><li> / </li>%s" $parent.RelPermalink $parent.RelPermalink $name $position .value) }}
|
||||
{{ template "breadcrumb" dict "page" $parent "value" $value "position" $position }}
|
||||
{{ else }}
|
||||
{{ .value | safeHTML }}
|
||||
{{ end }}
|
||||
{{ $parent := .page.Parent }}
|
||||
{{ if $parent }}
|
||||
{{ $name := (partial "title" $parent) }}
|
||||
{{ $position := (sub .position 1) }}
|
||||
{{ $value := (printf "<li itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'><a itemscope itemtype='https://schema.org/WebPage' itemprop='item' itemid='%s' href='%s'><span itemprop='name'>%s</span></a><meta itemprop='position' content='%d' /></li><li> / </li>%s" $parent.RelPermalink $parent.RelPermalink $name $position .value) }}
|
||||
{{ template "breadcrumb" dict "page" $parent "value" $value "position" $position }}
|
||||
{{ else }}
|
||||
{{ .value | safeHTML }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $showBreadcrumb := (and (default true .Page.Params.GeekdocBreadcrumb) (default true .Site.Params.GeekdocBreadcrumb)) }}
|
||||
{{ $showEdit := (and ($.Scratch.Get "geekdocFilePath") $geekdocRepo $geekdocEditPath) }}
|
||||
<div class="gdoc-page__header flex flex-wrap
|
||||
{{ if $showBreadcrumb }} justify-between {{ else }} justify-end {{ end }}
|
||||
{{ if not $showEdit }} hidden-mobile {{ end }}
|
||||
{{ if (and (not $showBreadcrumb) (not $showEdit)) }} hidden {{ end }}" itemprop="breadcrumb">
|
||||
{{if $showBreadcrumb }}
|
||||
<div
|
||||
class="gdoc-page__header flex flex-wrap
|
||||
{{ if $showBreadcrumb }}
|
||||
justify-between
|
||||
{{ else }}
|
||||
justify-end
|
||||
{{ end }}
|
||||
{{ if not $showEdit }}hidden-mobile{{ end }}
|
||||
{{ if (and (not $showBreadcrumb) (not $showEdit)) }}hidden{{ end }}"
|
||||
itemprop="breadcrumb"
|
||||
>
|
||||
{{ if $showBreadcrumb }}
|
||||
<div>
|
||||
<svg class="icon gdoc_path hidden-mobile"><use xlink:href="#gdoc_path"></use></svg>
|
||||
<ol class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">
|
||||
{{ $position := sub (len (split .RelPermalink "/")) 1 }}
|
||||
{{ $name := (partial "title" .) }}
|
||||
{{ $value := (printf "<li itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'><span itemprop='name'>%s</span><meta itemprop='position' content='%d' /></li>" $name $position ) }}
|
||||
{{ template "breadcrumb" dict "page" . "value" $value "position" $position }}
|
||||
</ol>
|
||||
<svg class="icon gdoc_path hidden-mobile"><use xlink:href="#gdoc_path"></use></svg>
|
||||
<ol class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">
|
||||
{{ $position := sub (len (split .RelPermalink "/")) 1 }}
|
||||
{{ $name := (partial "title" .) }}
|
||||
{{ $value := (printf "<li itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'><span itemprop='name'>%s</span><meta itemprop='position' content='%d' /></li>" $name $position ) }}
|
||||
{{ template "breadcrumb" dict "page" . "value" $value "position" $position }}
|
||||
</ol>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if $showEdit }}
|
||||
{{ end }}
|
||||
{{ if $showEdit }}
|
||||
<div>
|
||||
<span class="editpage">
|
||||
<svg class="icon gdoc_code"><use xlink:href="#gdoc_code"></use></svg>
|
||||
<a href="{{ $geekdocRepo }}/{{ path.Join $geekdocEditPath ($.Scratch.Get "geekdocFilePath") }}">
|
||||
Edit this page
|
||||
</a>
|
||||
</span>
|
||||
<span class="editpage">
|
||||
<svg class="icon gdoc_code"><use xlink:href="#gdoc_code"></use></svg>
|
||||
<a
|
||||
href="{{ $geekdocRepo }}/{{ path.Join $geekdocEditPath ($.Scratch.Get "geekdocFilePath") }}"
|
||||
>
|
||||
Edit this page
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue