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,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 -->
|
||||
|
|
|
@ -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 */ -}}
|
||||
|
|
|
@ -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 */ -}}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 }}
|
||||
|
|
7
layouts/_default/list.search.json
Normal file
7
layouts/_default/list.search.json
Normal 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 }}
|
||||
}
|
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue