initial commit

This commit is contained in:
2025-02-19 00:16:57 +01:00
parent 1d9cd91fcd
commit d89698593b
1293 changed files with 55933 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
{{- partial "topbar/button/edit.html" (dict
"page" .
)}}
{{- partial "topbar/button/source.html" (dict
"page" .
)}}
{{- partial "topbar/button/markdown.html" (dict
"page" .
)}}
{{- partial "topbar/button/print.html" (dict
"page" .
)}}
{{- partial "topbar/button/prev.html" (dict
"page" .
)}}
{{- partial "topbar/button/next.html" (dict
"page" .
)}}
{{- partial "topbar/button/more.html" (dict
"page" .
)}}

View File

@@ -0,0 +1,6 @@
{{- partial "topbar/button/sidebar.html" (dict
"page" .
)}}
{{- partial "topbar/button/toc.html" (dict
"page" .
)}}

View File

@@ -0,0 +1,35 @@
{{- $onwidths := cond (isset . "onwidths") .onwidths "area-more" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $show := .File }}
{{- if $show }}
{{- $show = not (partial "_relearn/pageIsSpecial.gotmpl" .) }}
{{- end }}
{{- if $show }}
{{- $filePath := printf "%s%s" (strings.TrimLeft "/" (replace .File.Dir "\\" "/")) .File.LogicalName }}
{{- $href := "" }}
{{- if .Site.Params.editURL }}
{{- $href = .Site.Params.editURL }}
{{- if not (strings.Contains $href "${FilePath}") }}
{{- $href = printf "%s%s" $href "${FilePath}" }}
{{- end }}
{{- end }}
{{- if isset .Params "editurl" }}
{{- $href = .Params.editURL }}
{{- end }}
{{- $href = strings.Replace $href "${FilePath}" $filePath }}
{{- if $href }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-edit"
"href" $href
"icon" "pen"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (printf "%s (CTRL+ALT+w)" (T "Edit-this-page"))
)}}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,22 @@
{{- $onwidths := cond (isset . "onwidths") .onwidths "area-more" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $format := .OutputFormats.Get "markdown" }}
{{- $show := and $format (not (.Param "disableMarkdownButton")) }}
{{- if $show }}
{{- $show = not (partial "_relearn/pageIsSpecial.gotmpl" .) }}
{{- end }}
{{- if $show }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-markdown"
"href" $format.RelPermalink
"icon" "fa-fw fab fa-markdown"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (T "Show-Markdown")
)}}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,14 @@
{{- $onempty := cond (isset . "onempty") .onempty "hide" }}
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- partial "topbar/func/area-button.html" (dict
"page" .page
"area" "more"
"icon" "ellipsis-v"
"onempty" $onempty
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (printf "%s" (T "More-action"))
)}}

View File

@@ -0,0 +1,24 @@
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $show := not (.Param "disableNextPrev") }}
{{- if $show }}
{{- $endarrow := "🡒" }}
{{- if eq (.Language.LanguageDirection | default (T "Reading-direction") | default "ltr") "rtl" }}
{{- $endarrow = "🡐" }}
{{- end }}
{{- $next := partialCached "_relearn/pageNext.gotmpl" . .Path }}
{{- $nextTitle := partial "title.gotmpl" (dict "page" $next "outputFormat" "html") }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-next"
"href" (partial "permalink.gotmpl" (dict "to" $next))
"icon" "chevron-right"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (printf "%s (%s)" $nextTitle ($endarrow | safeHTML))
)}}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,24 @@
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $show := not (.Param "disableNextPrev") }}
{{- if $show }}
{{- $startarrow := "🡐" }}
{{- if eq (.Language.LanguageDirection | default (T "Reading-direction") | default "ltr") "rtl" }}
{{- $startarrow = "🡒" }}
{{- end }}
{{- $prev := partialCached "_relearn/pagePrev.gotmpl" . .Path }}
{{- $prevTitle := partial "title.gotmpl" (dict "page" $prev "outputFormat" "html") }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-prev"
"href" (partial "permalink.gotmpl" (dict "to" $prev))
"icon" "chevron-left"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (printf "%s (%s)" $prevTitle ($startarrow | safeHTML))
)}}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,22 @@
{{- $onwidths := cond (isset . "onwidths") .onwidths "area-more" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $format := .OutputFormats.Get "print" }}
{{- $show := and $format (not (.Param "disablePrintButton")) }}
{{- if $show }}
{{- $show = not (partial "_relearn/pageIsSpecial.gotmpl" .) }}
{{- end }}
{{- if $show }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-print"
"href" $format.RelPermalink
"icon" "print"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (printf "%s (CTRL+ALT+p)" (T "Print-this-chapter"))
)}}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "hide" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "hide" }}
{{- with .page }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-sidebar"
"href" "javascript:toggleNav()"
"icon" "bars"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (printf "%s (CTRL+ALT+n)" (T "Navigation-toggle"))
)}}
{{- end }}

View File

@@ -0,0 +1,22 @@
{{- $onwidths := cond (isset . "onwidths") .onwidths "area-more" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $format := .OutputFormats.Get "source" }}
{{- $show := and $format (not (.Param "disableSourceButton")) }}
{{- if $show }}
{{- $show = and (not (partial "_relearn/pageIsSpecial.gotmpl" .)) .File .File.Filename }}
{{- end }}
{{- if $show }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-source"
"href" $format.RelPermalink
"icon" "code"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (T "Show-source")
)}}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,28 @@
{{- $onempty := cond (isset . "onempty") .onempty "hide" }}
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $show := not (.Param "disableToc") }}
{{- if $show }}
{{- $content := partial "toc-class.html" . }}
{{- $hascontent := not (eq 0 (int (len (trim ($content | plainify) "\n\r\t ")))) }}
{{- if not $hascontent }}
{{- $content = " " }}
{{- else }}
{{- $content = (print "\n" $content) | safeHTML }}
{{- end }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-toc"
"href" "javascript:toggleTopbarFlyout(this)"
"icon" "list-alt"
"onempty" $onempty
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (printf "%s (CTRL+ALT+t)" (T "Toc-toggle"))
"content" $content
)}}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,24 @@
{{- $area := .area }}
{{- $icon := .icon }}
{{- $hint := .hint }}
{{- $title := .title }}
{{- $onempty := cond (isset . "onempty") .onempty "disable" }}
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $content := printf "\n <div class=\"topbar-area topbar-area-%s\" data-area=\"%s\">%s\n </div>" $area $area (partial (printf "topbar/area/%s.html" $area) .) | safeHTML }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" (printf "topbar-button-%s" $area)
"href" "javascript:toggleTopbarFlyout(this)"
"icon" $icon
"onempty" $onempty
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"title" $title
"hint" $hint
"content" $content
)}}
{{- end }}

View File

@@ -0,0 +1,56 @@
{{- $page := .page }}
{{- $class := .class | default "" }}
{{- $href := (trim .href " ") | default "" }}
{{- $onempty := cond (isset . "onempty") .onempty "disable" }}
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- $target := .target | default "" }}
{{- $type := .type | default "" }}
{{- $isDisabled := not $href }}
{{- $isButton := false }}
{{- if or (not $href) (strings.HasPrefix $href "javascript:") }}
{{- $isButton = true }}
{{- $href = substr $href (len "javascript:") }}
{{- if not $type }}
{{- $type = "button" }}
{{- end }}
{{- else if and (eq (len $target) 0) (or (strings.HasPrefix $href "http://") (strings.HasPrefix $href "https://") ) }}
{{- $target = "_blank" }}
{{- if isset $page.Site.Params "externallinktarget" }}
{{- $target = $page.Site.Params.externalLinkTarget }}
{{- end }}
{{- end }}
{{- $title := (trim .title " ") | default "" }}
{{- $hint := (trim .hint " ") | default "" }}
{{- $icon := (trim .icon " ") | default "" }}
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
{{- end }}
{{- $content := .content }}
<div class="topbar-button {{ $class }}" data-content-empty="{{ $onempty }}" data-width-s="{{ $onwidths }}" data-width-m="{{ $onwidthm }}" data-width-l="{{ $onwidthl }}">
{{- if $isDisabled -}}
<span class="topbar-control">
{{- else if $isButton -}}
<button class="topbar-control"{{ if $href }} onclick="{{ $href | safeJS }}"{{ end }}{{ if gt (len $type) 0 }} type="{{ $type }}"{{ end }} title="{{ $hint }}">
{{- else -}}
<a class="topbar-control"{{ if $href }} href="{{ $href }}"{{ if gt (len $target) 0 }} target="{{ $target }}"{{ end }}{{ end }} title="{{ $hint }}">
{{- end }}
{{- if and $icon }}<i class="{{ $icon }}"></i>{{ end }}
{{- if and $icon $title }} {{ end }}
{{- if $title }}<span class="title">{{- $title | safeHTML }}</span>{{ end }}
{{- if $isDisabled -}}
</span>
{{- else if $isButton -}}
</button>
{{- else -}}
</a>
{{- end }}
{{- if $content }}
<div class="topbar-content">
<div class="topbar-content-wrapper">
{{- $content }}
</div>
</div>
{{- end }}
</div>