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:
Robert Kaussow 2022-01-06 13:58:10 +01:00 committed by GitHub
parent 2ac2a9faab
commit 5c5e2d59cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
122 changed files with 18705 additions and 5208 deletions

View file

@ -1,5 +1,7 @@
{{- $showAnchor := (and (default true .Page.Params.GeekdocAnchor) (default true .Page.Site.Params.GeekdocAnchor)) -}}
<!-- prettier-ignore-start -->
{{- if $showAnchor -}}
<div class="gdoc-page__anchorwrap">
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
@ -16,3 +18,4 @@
</h{{ .Level }}>
</div>
{{- end -}}
<!-- prettier-ignore-end -->

View file

@ -1,2 +1,6 @@
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
<img
src="{{ .Destination | safeURL }}"
alt="{{ .Text }}"
{{ with .Title }}title="{{ . }}"{{ end }}
/>
{{- /* Drop trailing newlines */ -}}

View file

@ -1,3 +1,8 @@
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
<a class="gdoc-markdown__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
<a
class="gdoc-markdown__link{{ if $raw }}--raw{{ end }}"
href="{{ .Destination | safeURL }}"
{{ with .Title }}title="{{ . }}"{{ end }}
>{{ .Text | safeHTML }}</a
>
{{- /* Drop trailing newlines */ -}}

View file

@ -1,9 +1,10 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}" class="color-toggle-hidden">
<head>
<head>
{{ partial "head/meta" . }}
<title>{{ if not (eq .Kind "home") }}{{ partial "title" . }} | {{ end }}{{ .Site.Title }}</title>
<title>
{{ if not (eq .Kind "home") }}{{ partial "title" . }} |{{ end }}{{ .Site.Title }}
</title>
{{ partial "head/favicons" . }}
{{ partial "head/rel-me" . }}
@ -11,33 +12,38 @@
{{ partial "head/others" . }}
{{ partial "head/schema" . }}
{{ partial "head/custom" . }}
</head>
</head>
<body itemscope itemtype="https://schema.org/WebPage">
<body itemscope itemtype="https://schema.org/WebPage">
{{ partial "svg-icon-symbols" . }}
<div class="wrapper {{ if default false .Site.Params.GeekdocDarkModeDim }}dark-mode-dim{{ end }}">
<input type="checkbox" class="hidden" id="menu-control" />
<input type="checkbox" class="hidden" id="menu-header-control" />
{{ $navEnabled := default true .Page.Params.GeekdocNav }}
{{ partial "site-header" (dict "Root" . "MenuEnabled" $navEnabled) }}
<main class="container flex flex-even">
{{ if $navEnabled }}
<aside class="gdoc-nav">
{{ partial "menu" . }}
</aside>
{{ end }}
<div
class="wrapper {{ if default false .Site.Params.GeekdocDarkModeDim }}dark-mode-dim{{ end }}"
>
<input type="checkbox" class="hidden" id="menu-control" />
<input type="checkbox" class="hidden" id="menu-header-control" />
{{ $navEnabled := default true .Page.Params.GeekdocNav }}
{{ partial "site-header" (dict "Root" . "MenuEnabled" $navEnabled) }}
<div class="gdoc-page">
{{ template "main" . }}
{{ partial "page-footer" . }}
</div>
</main>
{{ partial "site-footer" . }}
<main class="container flex flex-even">
{{ if $navEnabled }}
<aside class="gdoc-nav">
{{ partial "menu" . }}
</aside>
{{ end }}
<div class="gdoc-page">
{{ template "main" . }}
{{ partial "page-footer" . }}
</div>
</main>
{{ partial "site-footer" . }}
</div>
{{ partial "foot" . }}
</body>
</body>
</html>

View file

@ -1,8 +1,11 @@
{{ define "main" }}
{{ partial "page-header" . }}
{{ partial "page-header" . }}
<article class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}">
<h1>{{ partial "title" . }}</h1>
{{ partial "content" . }}
</article>
<article
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}"
>
<h1>{{ partial "title" . }}</h1>
{{ partial "content" . }}
</article>
{{ end }}

View file

@ -0,0 +1,7 @@
{{- $searchDataFile := printf "%s.searchdata.json" .Language.Lang -}}
{{- $searchData := resources.Get "search/searchdata.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify -}}
{
"dataFile": {{ $searchData.RelPermalink | jsonify }},
"indexConfig": {{ .Site.Params.GeekdocSearchConfig | jsonify }},
"showParent": {{ if .Site.Params.GeekdocSearchShowParent }}true{{ else }}false{{ end }}
}

View file

@ -1,8 +1,11 @@
{{ define "main" }}
{{ partial "page-header" . }}
{{ partial "page-header" . }}
<article class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}">
<h1>{{ partial "title" . }}</h1>
{{ partial "content" . }}
</article>
<article
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}"
>
<h1>{{ partial "title" . }}</h1>
{{ partial "content" . }}
</article>
{{ end }}