Merge remote-tracking branch 'upstream/main' into upstream
This commit is contained in:
commit
95632a5aff
44 changed files with 2699 additions and 1489 deletions
|
@ -1,4 +1,4 @@
|
|||
{{- $showAnchor := (and (default true .Page.Params.GeekdocAnchor) (default true .Page.Site.Params.GeekdocAnchor)) -}}
|
||||
{{- $showAnchor := (and (default true .Page.Params.geekdocAnchor) (default true .Page.Site.Params.geekdocAnchor)) -}}
|
||||
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html
|
||||
lang="{{ .Site.Language.Lang }}"
|
||||
class="color-toggle-hidden"
|
||||
{{ if default false .Site.Params.GeekdocDarkModeCode }}code-theme="dark"{{ end }}
|
||||
{{ if default false .Site.Params.geekdocDarkModeCode }}code-theme="dark"{{ end }}
|
||||
>
|
||||
<head>
|
||||
{{ partial "head/meta" . }}
|
||||
|
@ -33,7 +33,7 @@
|
|||
>
|
||||
<input type="checkbox" class="hidden" id="menu-control" />
|
||||
<input type="checkbox" class="hidden" id="menu-header-control" />
|
||||
{{ $navEnabled := default true .Page.Params.GeekdocNav }}
|
||||
{{ $navEnabled := default true .Page.Params.geekdocNav }}
|
||||
{{ partial "site-header" (dict "Root" . "MenuEnabled" $navEnabled) }}
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
<article
|
||||
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}"
|
||||
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.geekdocAlign | lower) }}"
|
||||
>
|
||||
<h1>{{ partial "utils/title" . }}</h1>
|
||||
{{ partial "utils/content" . }}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
<article
|
||||
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}"
|
||||
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.geekdocAlign | lower) }}"
|
||||
>
|
||||
<h1>{{ partial "utils/title" . }}</h1>
|
||||
{{ partial "utils/content" . }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ if default true .Site.Params.GeekdocSearch }}
|
||||
{{ if default true .Site.Params.geekdocSearch }}
|
||||
<script defer src="{{ index (index .Site.Data.assets "search.js") "src" | relURL }}"></script>
|
||||
{{- $searchConfigFile := printf "search/%s.config.json" .Language.Lang -}}
|
||||
{{- $searchConfig := resources.Get "search/config.json" | resources.ExecuteAsTemplate $searchConfigFile . | resources.Minify -}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{- if default true .Site.Params.GeekdocDarkModeToggle }}
|
||||
{{- if default true .Site.Params.geekdocDarkModeToggle }}
|
||||
<script src="{{ index (index .Site.Data.assets "colortheme.js") "src" | relURL }}"></script>
|
||||
{{- end }}
|
||||
<script src="{{ index (index .Site.Data.assets "main.js") "src" | relURL }}"></script>
|
||||
|
@ -66,7 +66,7 @@
|
|||
{{ printf `<link href=%q rel=%q type=%q />` .Permalink .Rel .MediaType.Type | safeHTML }}
|
||||
{{- end }}
|
||||
|
||||
{{- if (default false $.Site.Params.GeekdocOverwriteHTMLBase) }}
|
||||
{{- if (default false $.Site.Params.geekdocOverwriteHTMLBase) }}
|
||||
<base href="{{ .Site.BaseURL }}" />
|
||||
{{- end }}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
{{ $isCurrent := eq $current $this }}
|
||||
{{ $isAncestor := $this.IsAncestor $current }}
|
||||
{{ $id := substr (sha1 $this.Permalink) 0 8 }}
|
||||
{{ $doCollapse := and (isset . "sub") (or $this.Params.GeekdocCollapseSection (default false .Site.Params.GeekdocCollapseAllSections)) }}
|
||||
{{ $doCollapse := and (isset . "sub") (or $this.Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }}
|
||||
|
||||
{{ $anchor := default "" .anchor }}
|
||||
{{ if $anchor }}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
|
||||
<ul class="gdoc-nav__list">
|
||||
{{ $sortBy := (default "title" .current.Site.Params.GeekdocFileTreeSortBy | lower) }}
|
||||
{{ $sortBy := (default "title" .current.Site.Params.geekdocFileTreeSortBy | lower) }}
|
||||
{{ range .sect.GroupBy "Weight" }}
|
||||
{{ $rangeBy := .ByTitle }}
|
||||
|
||||
|
@ -39,13 +39,13 @@
|
|||
{{ end }}
|
||||
|
||||
{{ range $rangeBy }}
|
||||
{{ if not .Params.GeekdocHidden }}
|
||||
{{ if not .Params.geekdocHidden }}
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ $isParent := and (ne $numberOfPages 0) (not .Params.GeekdocFlatSection) }}
|
||||
{{ $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)) }}
|
||||
{{ $doCollapse := and $isParent (or .Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }}
|
||||
|
||||
|
||||
<li>
|
||||
|
@ -63,7 +63,7 @@
|
|||
for="{{ printf "navtree-%s" $id }}" class="flex justify-between align-center"
|
||||
{{ end }}
|
||||
>
|
||||
{{ if or .Content .Params.GeekdocFlatSection }}
|
||||
{{ if or .Content .Params.geekdocFlatSection }}
|
||||
<span class="flex">
|
||||
<a
|
||||
href="{{ .RelPermalink }}"
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $showPrevNext := (and (default true .Site.Params.GeekdocNextPrev) .Site.Params.GeekdocMenuBundle) }}
|
||||
{{ $showPrevNext := (and (default true .Site.Params.geekdocNextPrev) .Site.Params.geekdocMenuBundle) }}
|
||||
{{ if $showPrevNext }}
|
||||
<span class="gdoc-page__nav">
|
||||
{{ with ($current.Scratch.Get "prevPage") }}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
{{ end }}
|
||||
</section>
|
||||
|
||||
{{ if and (in (slice "posts" "tags") .Section) (default false .Site.Params.GeekdocTagsToMenu) }}
|
||||
{{ if and (in (slice "posts" "tags") .Section) (default false .Site.Params.geekdocTagsToMenu) }}
|
||||
<section class="gdoc-nav--tags">
|
||||
<h2>{{ i18n "nav_tags" }}</h2>
|
||||
<ul class="gdoc-nav__list">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{{- with partial "utils/featured" . }}
|
||||
"thumbnailUrl": {{ . }},
|
||||
{{- end }}
|
||||
{{- with .Site.Params.GeekdocContentLicense }}
|
||||
{{- with .Site.Params.geekdocContentLicense }}
|
||||
"license": "{{ .name }}",
|
||||
{{- end }}
|
||||
"inLanguage": {{ .Lang }}
|
||||
|
@ -37,7 +37,7 @@
|
|||
"thumbnailUrl": {{ . }},
|
||||
{{- end }}
|
||||
"wordCount" : "{{ .WordCount }}",
|
||||
{{- with .Site.Params.GeekdocContentLicense }}
|
||||
{{- with .Site.Params.geekdocContentLicense }}
|
||||
"license": "{{ .name }}",
|
||||
{{- end }}
|
||||
"inLanguage": {{ .Lang }},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ $geekdocRepo := default (default false .Site.Params.GeekdocRepo) .Page.Params.GeekdocRepo }}
|
||||
{{ $geekdocEditPath := default (default false .Site.Params.GeekdocEditPath) .Page.Params.GeekdocEditPath }}
|
||||
{{ $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 (path.Join (default "content" .Site.Params.contentDir) .File.Path) .Page.Params.GeekdocFilePath) }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" (default (strings.TrimPrefix hugo.WorkingDir .File.Filename) .Page.Params.geekdocFilePath) }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" false }}
|
||||
{{ end }}
|
||||
|
@ -18,7 +18,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $showBreadcrumb := (and (default true .Page.Params.GeekdocBreadcrumb) (default true .Site.Params.GeekdocBreadcrumb)) }}
|
||||
{{ $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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ if default true .Site.Params.GeekdocSearch }}
|
||||
{{ if default true .Site.Params.geekdocSearch }}
|
||||
<div class="gdoc-search flex align-center">
|
||||
<svg class="gdoc-icon gdoc_search"><use xlink:href="#gdoc_search"></use></svg>
|
||||
<input
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.GeekdocPrivacyPolicy }}
|
||||
{{ with .Site.Params.geekdocPrivacyPolicy }}
|
||||
<span class="gdoc-footer__item gdoc-footer__item--row">
|
||||
<a href="{{ . | relURL }}" class="gdoc-footer__link">
|
||||
{{ i18n "footer_privacy_policy" }}
|
||||
|
@ -17,7 +17,7 @@
|
|||
</span>
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ with .Site.Params.GeekdocContentLicense }}
|
||||
{{ with .Site.Params.geekdocContentLicense }}
|
||||
<section class="flex flex-wrap align-center">
|
||||
<span class="gdoc-footer__item">
|
||||
{{ i18n "footer_content_license_prefix" }}
|
||||
|
@ -26,7 +26,7 @@
|
|||
</section>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if (default true .Site.Params.GeekdocBackToTop) }}
|
||||
{{ if (default true .Site.Params.geekdocBackToTop) }}
|
||||
<div class="flex flex-25 justify-end">
|
||||
<span class="gdoc-footer__item text-right">
|
||||
<a class="gdoc-footer__link fake-link" href="#" aria-label="{{ i18n "nav_top" }}">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<span class="flex align-center">
|
||||
<img
|
||||
class="gdoc-brand__img"
|
||||
src="{{ (default "brand.svg" .Root.Site.Params.GeekdocLogo) | relURL }}"
|
||||
src="{{ (default "brand.svg" .Root.Site.Params.geekdocLogo) | relURL }}"
|
||||
alt=""
|
||||
/>
|
||||
<span class="gdoc-brand__title">{{ .Root.Site.Title }}</span>
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
</label>
|
||||
<input id="{{ $id }}-{{ .Ordinal }}" type="checkbox" class="gdoc-expand__control hidden" />
|
||||
<div class="gdoc-markdown--nested gdoc-expand__content">
|
||||
{{ .Inner | $.Page.RenderString | htmlUnescape | safeHTML }}
|
||||
{{ .Inner | $.Page.RenderString }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }}
|
||||
{{- $customAlt := .Get "alt" }}
|
||||
{{- $customSize := .Get "size" | lower }}
|
||||
{{- $lazyLoad := default (default true $.Site.Params.GeekdocImageLazyLoading) (.Get "lazy") }}
|
||||
{{- $lazyLoad := default (default true $.Site.Params.geekdocImageLazyLoading) (.Get "lazy") }}
|
||||
{{- $data := newScratch }}
|
||||
|
||||
{{- with $source }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{- $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }}
|
||||
{{- $tocLevels := default (default 6 .Site.Params.geekdocToC) .Page.Params.geekdocToC }}
|
||||
|
||||
{{- if $tocLevels }}
|
||||
<div class="gdoc-toc gdoc-toc__level--{{ $tocLevels }}">
|
||||
|
@ -12,23 +12,25 @@
|
|||
<ul>
|
||||
{{- range .sect.GroupBy "Weight" }}
|
||||
{{- range .ByTitle }}
|
||||
{{- if or (not .Params.GeekdocHidden) (not (default true .Params.GeekdocHiddenTocTree)) }}
|
||||
{{- if or (not .Params.geekdocHidden) (not (default true .Params.geekdocHiddenTocTree)) }}
|
||||
<li>
|
||||
{{- if or .Content .Params.GeekdocFlatSection }}
|
||||
{{- if or .Content .Params.geekdocFlatSection }}
|
||||
<span>
|
||||
<a href="{{ .RelPermalink }}" class="gdoc-toc__entry">
|
||||
{{- partial "utils/title" . }}{{ with .Params.GeekdocDescription }}:{{ end }}
|
||||
{{- partial "utils/title" . }}{{ with .Params.geekdocDescription }}:{{ end }}
|
||||
</a>
|
||||
{{- with .Params.GeekdocDescription }}{{ . }}{{ end }}
|
||||
{{- with .Params.geekdocDescription }}{{ . }}{{ end }}
|
||||
</span>
|
||||
{{- else -}}
|
||||
<span>
|
||||
{{- partial "utils/title" . }}{{ with .Params.GeekdocDescription }}: {{ . }}{{ end }}
|
||||
{{- partial "utils/title" . }}{{ with .Params.geekdocDescription }}
|
||||
: {{ . }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- $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 }}
|
||||
{{- end }}
|
||||
</li>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- $format := default "html" (.Get "format") }}
|
||||
{{- $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 not (eq ($format | lower) "raw") -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue