+ add training page (add admonition shortcode)

+ Finish translation
+ clean unused asset
This commit is contained in:
2025-01-23 16:48:37 +01:00
parent f91aba8329
commit fc87d59dbb
33 changed files with 468 additions and 93 deletions

View File

@@ -0,0 +1,3 @@
{{- partial "plugin/admonitionPre.html" (dict "Type" .AlertType "Title" (.AlertTitle | default (strings.FirstUpper .AlertType)) "Open" (not (eq .AlertSign "-"))) -}}
{{- .Text -}}
{{- partial "plugin/admonitionPost.html" -}}

View File

@@ -0,0 +1,6 @@
{{- $destination := .Destination -}}
{{- with dict "Path" $destination "Resources" .Page.Resources | partial "function/resource.html" -}}
{{- $destination = .RelPermalink -}}
{{- end -}}
{{- $options := dict "Destination" $destination "Title" .Title "Content" .Text -}}
{{- partial "plugin/link.html" $options -}}

View File

@@ -101,22 +101,18 @@
</div>
</div>
<div id="site-head-content" class="inner">
<div id="site-head-content" class="inner">
{{ if .Site.Params.title_guard }}<div class="title-and-description-guard">{{ end }}
{{ with .Params.header_subheadline }}<h2 class="blog-description">{{ . | safeHTML }}</h2>{{ end }}
{{ with .Params.header_subsubheadline }}<h3 class="blog-description">{{ . | safeHTML }}</h3>{{ end }}
{{ if .Site.Params.title_guard }}</div>{{ end }}
{{ with (index $content 0) }}
{{ $first_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $first_title = . }}{{ end }}
<a id='header-arrow' href="#{{- anchorize $first_title -}}" aria-label="Go to first section"><i class="fa fa-angle-down"></i></a>
{{ end }}
</div>
{{ if .Site.Params.title_guard }}<div class="title-and-description-guard">{{ end }}
{{ with resources.Get .Params.header_logo }}<img id="blog-logo" alt="" src="{{ .RelPermalink }}" />{{ end }}
{{ with .Params.header_subheadline }}<h2 class="blog-description">{{ . | safeHTML }}</h2>{{ end }}
{{ with .Params.header_subsubheadline }}<h3 class="blog-description">{{ . | safeHTML }}</h3>{{ end }}
{{ if .Site.Params.title_guard }}</div>{{ end }}
{{ with (index $content 0) }}
{{ $first_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $first_title = . }}{{ end }}
<a id='header-arrow' href="#{{- anchorize $first_title -}}" aria-label="Go to first section"><i class="fa fa-angle-down"></i></a>
{{ end }}
</div>
</div>
</header>

View File

@@ -0,0 +1 @@
{{- return and (not (eq .Scheme "")) .Host -}}

View File

@@ -0,0 +1,17 @@
{{- $resource := 0 -}}
{{- $url := urls.Parse .Path -}}
{{- if not (partial "function/isUrlRemote.html" $url) -}}
{{- $dest := strings.TrimPrefix "./" $url.Path -}}
{{- if .Resources -}}
{{- with .Resources.GetMatch $dest -}}
{{- $resource = . -}}
{{- end -}}
{{- end -}}
{{- if not $resource -}}
{{- with resources.Get $dest -}}
{{- $resource = . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- return $resource -}}

View File

@@ -0,0 +1 @@
</div></div></div>

View File

@@ -0,0 +1,39 @@
{{- $iconMap := dict "note" ("pencil-alt") -}}
{{- $iconMap = dict "abstract" ("list-ul") | merge $iconMap -}}
{{- $iconMap = dict "info" ("info-circle") | merge $iconMap -}}
{{- $iconMap = dict "tip" ("lightbulb") | merge $iconMap -}}
{{- $iconMap = dict "success" ("check-circle") | merge $iconMap -}}
{{- $iconMap = dict "question" ("question-circle") | merge $iconMap -}}
{{- $iconMap = dict "warning" ("exclamation-triangle") | merge $iconMap -}}
{{- $iconMap = dict "failure" ("times-circle") | merge $iconMap -}}
{{- $iconMap = dict "danger" ("skull-crossbones") | merge $iconMap -}}
{{- $iconMap = dict "bug" ("bug") | merge $iconMap -}}
{{- $iconMap = dict "example" ("list-ol") | merge $iconMap -}}
{{- $iconMap = dict "quote" ("quote-right") | merge $iconMap -}}
{{- $iconMap = dict "important" ("exclamation") | merge $iconMap -}}
{{- $iconMap = dict "caution" ("exclamation-circle") | merge $iconMap -}}
{{/*
This partial is used to render an admonition block.
The following parameters are available:
- Inner: The content of the admonition block.
- Type: The type of the admonition block. The default value is "note".
- Title: The title of the admonition block. The default value is the translated value of the type.
- Open: A boolean value to determine whether the admonition block is open. The default value is true.
Usage example:
{{- dict "Inner" $inner "Type" "note" "Title" "title" "Open" false | partial "plugin/admonition.html" -}}
*/}}
{{- $type := .Type | default "note" -}}
{{- $title := .Title | default (T $type) -}}
{{- $open := .Open | default true -}}
<div class="details admonition {{ $type }}{{ if $open | ne false }} open{{ end }}">
<div class="details-summary admonition-title">
<span class="icon"><i class="fa fa-{{ index $iconMap $type | default (index $iconMap "note") }}"></i>
<!--{ {- partial "plugin/fontawesome.html" (index $iconMap $type | default (index $iconMap "note")) -}}-->
</span>
</div>
<div class="details-content">
<div class="admonition-content">

View File

@@ -0,0 +1,9 @@
{{- $rel := "" -}}
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if (urls.Parse .Destination).Host | or .Newtab }}{{ $rel = "noopener noreferrer" }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .Rel }} {{ . }}{{ end }}"{{ with .Class }} class="{{ . }}"{{ end }}>
{{- with .Icon -}}
{{- partial "plugin/icon.html" . -}}
{{- end -}}
{{- with .Content -}}
{{- . | safeHTML -}}
{{- end -}}
</a>

View File

@@ -0,0 +1,6 @@
{{- $type := cond .IsNamedParams (.Get "type") (.Get 0) | default "note" -}}
{{- $title := cond .IsNamedParams (.Get "title") (.Get 1) | default (T $type) -}}
{{- $open := cond .IsNamedParams (.Get "open") (.Get 2) -}}
{{- partial "plugin/admonitionPre.html" (dict "Type" $type "Title" $title "Open" $open) -}}
{{- .Inner | .Page.RenderString -}}
{{- partial "plugin/admonitionPost.html" -}}