{{ $param := .Get "param" }} {{ $type := .Get "type" }} {{- if eq $type "NewTable" -}}
Neue Tabelle Ergebnis
{{- "{{" -}} $xzx := (string "Hello, world") {{- "}}" -}}{{- $xzx := (string "Hello, world") -}}{{ $xzx }}
{{ end }} {{- if eq $type ".Site.Menus" -}} {{- range sort .Site.Menus.main -}} {{- if .HasChildren -}}

        {{ .Name -}} {{- range .Children -}}
                {{ .Name -}} {{- if eq .Pre "submenu" -}} {{- range (readDir (printf "./content%s" .URL)) -}} {{- if .IsDir -}}
                                {{- .Name -}} {{- end -}} {{- end -}} {{/* - partial "submenu" (slice .URL ) - */}} {{- end -}} {{- end -}} {{- else -}}

        {{ .Name -}} {{- end -}} {{- end -}} {{- end -}} {{- if eq $type ".Site" -}}
Aufruf in *.html Ergebnis
{{- "{{" -}} .Site.AllPages {{- "}}" -}} {{- .Site.AllPages -}}
{{- "{{" -}} .Site.BaseURL {{- "}}" -}} {{- .Site.BaseURL -}}
{{- "{{" -}} .Site.BuildDrafts {{- "}}" -}} {{- .Site.BuildDrafts -}}
{{- "{{" -}} .Site.Copyright {{- "}}" -}} {{- .Site.Copyright -}}
{{- "{{" -}} .Site.Data {{- "}}" -}} {{- .Site.Data -}}
{{- "{{" -}} .Site.Home {{- "}}" -}} {{- .Site.Home -}}
{{- "{{" -}} .Site.Language {{- "}}" -}} {{- .Site.Language -}}
{{- "{{" -}} .Site.Language.Lang {{- "}}" -}} {{- .Site.Language.Lang -}}
{{- "{{" -}} .Site.Language.LanguageName {{- "}}" -}} {{- .Site.Language.LanguageName -}}
{{- "{{" -}} .Site.Language.Weight {{- "}}" -}} {{- .Site.Language.Weight -}}
{{- "{{" -}} .Site.Lastmod {{- "}}" -}} {{- .Site.Lastmod -}}
{{- "{{" -}} .Site.Pages {{- "}}" -}} {{- .Site.Pages -}}
{{- "{{" -}} .Site.RegularPages {{- "}}" -}} {{- .Site.RegularPages -}}
{{- "{{" -}} .Site.Sections {{- "}}" -}} {{- .Site.Sections -}}
{{- "{{" -}} .Site.Taxonomies {{- "}}" -}} {{- .Site.Taxonomies -}}
{{- "{{" -}} .Site.Title {{- "}}" -}} {{- .Site.Title -}}
{{- "{{" -}} .Site.Params {{- "}}" -}} {{- .Site.Params -}}
{{- "{{" -}} .Site.Params.mainSections {{- "}}" -}} {{- .Site.Params.mainSections -}}
{{- "{{" -}} .Site.Menus {{- "}}" -}} {{- .Site.Menus -}}
{{ end }} {{- if eq $type "findRE_Sample01" -}} {{ $findReturn := findRE `(.|\n)*?` (readFile "./themes/mab-3.0/layouts/partials/header.html" ) }}
Ergebnis Ausgabebeispiel 1 per index
{{ $out := index $findReturn 0 }} {{ $out }}
{{ $out := index $findReturn 1 }} {{ $out }}
{{ $out := index $findReturn 1 }} {{ $out }}

{{ range $element, $findReturn }} {{ end }}
Ergebnis Ausgabebeispiel 2 per range
{{ $element }}

{{ range $i, $element := $findReturn }} {{ end }}
Ergebnis Ausgabebeispiel 3 per range und increment
{{ $i }}{{ $element }}
{{ end }} {{- if eq $type "findRE_Sample02" -}} {{- $SuchString := "Erster Teil des Strings {Zweiter Teil des Strings}" -}} {{- $step1 := findRE `{[[:word:][:space:]]*}` $SuchString -}} {{- if ne (len $step1) 0 -}} {{- $step2 := index $step1 0 -}} {{- $step3 := trim $step2 "{}" -}}
SuchString = {{ $SuchString }}

Teil1 = {{ $step1 }}
Teil2 = {{ $step2 }}
Teil3 = {{ $step3 }}
{{- range $index, $value := split $step3 " " -}} {{- if ne $value "" -}}
Wert {{ $index }} = {{ $value }} {{- end -}} {{- end -}} {{- end -}} {{ end }} {{- if eq $type "resources.content" -}} {{- $image := resources.GetMatch "images/**d1**" -}} {{ with $image }} {{ $image := $image.Resize "200x" }} {{ $images := $image | images.Filter (images.Opacity 0.8) (images.Process "png") }} Beispiel_Daten_URI {{ end }} {{ end }} {{- if eq $type "resources.local" -}} {{- $image := .Page.Parent.Resources.Get "Blume.jpg" -}} {{- with $image -}} {{ $image := $image.Filter (images.Opacity 0.5) }} Beispiel_Daten_URI
{{ $image.Width }} x {{ $image.Height }}
{{ with $image.Exif }} {{ end }} {{- else -}} Bilddatei nicht vorhanden. {{- end -}} {{ end }} {{- if eq $type "resources" -}} {{ with resources.GetMatch "images/**.jpg" }} {{ $tmp := . }} {{ $.Scratch.Set "res" $tmp }} {{ end }} {{ $image := resources.GetMatch "images/**Bild2.jpg" }} {{ with $image }} {{ with $image.RelPermalink }}{{- end -}} {{ with $image.Exif }} {{ with .Tags.FNumber }}{{- end -}} {{ end }} {{ end }}
Aufruf in *.html Ergebnis
{{- "{{" -}} . {{- "}}" -}} {{- ($.Scratch.Get "res") -}}
{{- "{{" -}} .ResourceType {{- "}}" -}} {{- ($.Scratch.Get "res").ResourceType -}}
{{- "{{" -}} .Name {{- "}}" -}} {{- ($.Scratch.Get "res").Name -}}
{{- "{{" -}} .Title {{- "}}" -}} {{- ($.Scratch.Get "res").Title -}}
{{- "{{" -}} .Permalink {{- "}}" -}} {{- ($.Scratch.Get "res").Permalink -}}
{{- "{{" -}} .RelPermalink {{- "}}" -}} {{- ($.Scratch.Get "res").RelPermalink -}}
{{- "{{" -}} .MediaType {{- "}}" -}} {{- ($.Scratch.Get "res").MediaType -}}
{{- "{{" -}} .MediaType.MainType {{- "}}" -}} {{- ($.Scratch.Get "res").MediaType.MainType -}}
{{- "{{" -}} .MediaType.SubType {{- "}}" -}} {{- ($.Scratch.Get "res").MediaType.SubType -}}
{{- "{{" -}} .MediaType.Suffixes {{- "}}" -}} {{- ($.Scratch.Get "res").MediaType.Suffixes -}}
{{- "{{" -}} .RelPermalink {{- "}}" -}}{{- . -}}
{{- "{{" -}} .Tags.FNumber {{- "}}" -}}{{- . -}}
{{ end }} {{- if eq $type "Date.Format" -}}
Aufruf in *.html Ergebnis
{{- "{{" -}} .Page.Date {{- "}}" -}} {{- .Page.Date -}}
{{- "{{" -}} .Page.Date.Format "January 2, 2006" {{- "}}" -}} {{- .Page.Date.Format "January 2, 2006" -}}
{{- "{{" -}} .Page.Date.Format "02. Jan 2006 15:04" {{- "}}" -}} {{- .Page.Date.Format "02. Jan 2006 15:04" -}}
{{- "{{" -}} .Page.Date.Format "02012006 15:04" {{- "}}" -}} {{- .Page.Date.Format "02012006 15:04" -}}
{{- "{{" -}} .Page.Date.Format "20060102" {{- "}}" -}} {{- .Page.Date.Format "20060102" -}}
Ausgabe des Datums mit .now
{{- "{{" -}} .now.Format "20060102 15:04" {{- "}}" -}} {{- now.Format "20060102 15:04" -}}
{{ end }} {{- if eq $type "Date" -}}
Aufruf in *.html Ergebnis
{{- "{{" -}} .Page.Date {{- "}}" -}} {{- .Page.Date -}}
{{- "{{" -}} .Page.PublishDate {{- "}}" -}} {{- .Page.PublishDate -}}
{{- "{{" -}} .Page.Lastmod {{- "}}" -}} {{- .Page.Lastmod -}}
{{- "{{" -}} .Page.File.Path {{- "}}" -}} {{- .Page.File.Path -}}
{{- "{{" -}} $file := os.Stat (.Page.File.Path) {{- "}}" -}} {{- $file := os.Stat (.Page.File.Path) -}}
{{- "{{" -}} $file.ModTime {{- "}}" -}} {{ $file.ModTime }}
{{ end }} {{- if eq $type "os.Stat.ModTime" -}}
Aufruf in *.html Ergebnis
{{- "{{" -}} .Page.File.Path {{- "}}" -}} {{- .Page.File.Path -}}
{{- "{{" -}} $file := os.Stat (.Page.File.Path) {{- "}}" -}} {{- $file := os.Stat (.Page.File.Path) -}}
{{- "{{" -}} $file.ModTime {{- "}}" -}} {{ $file.ModTime }}
{{ end }} {{- if eq $type ".Scratch" -}} {{ $var01 := path.Dir .Page.File }} {{ $.Scratch.Set "XXX" $var01 }} {{ $.Scratch.Set "ZZZ" $var01 }} {{ $.Scratch.Add "ZZZ" "/image" }}
{{"{{"}} $.Scratch.Get "XXX" {{"}}"}} {{- $.Scratch.Get "XXX" -}}
{{"{{"}} $.Scratch.Get "ZZZ" {{"}}"}} {{- $.Scratch.Get "ZZZ" -}}
{{ end }} {{- if eq $type ".Page.xxx" -}}
Aufruf in *.html Ergebnis
{{"{{"}} .Page.Ancestors {{"}}"}} {{- .Page.Ancestors -}}
{{"{{"}} .Page.Aliases {{"}}"}} {{- .Page.Aliases -}}
{{"{{"}} .Page.IsHome {{"}}"}} {{- .Page.IsHome -}}
{{"{{"}} .Page.IsNode {{"}}"}} {{- .Page.IsNode -}}
{{"{{"}} .Page.IsPage {{"}}"}} {{- .Page.IsPage -}}
{{"{{"}} .Page.IsSection {{"}}"}} {{- .Page.IsSection -}}
{{"{{"}} .Page.BundleType {{"}}"}} {{- .Page.BundleType -}}
{{"{{"}} .Page.IsTranslated {{"}}"}} {{- .Page.IsTranslated -}}
{{"{{"}} .Page.Type {{"}}"}} {{- .Page.Type -}}
{{"{{"}} .Page.WordCount {{"}}"}} {{- .Page.WordCount -}}
{{"{{"}} .Page.Kind {{"}}"}} {{- .Page.Kind -}}
{{"{{"}} .Page.Language {{"}}"}} {{- .Page.Language -}}
{{"{{"}} .Page.Keywords {{"}}"}} {{- .Page.Keywords -}}
{{"{{"}} .Page.LinkTitle {{"}}"}} {{- .Page.LinkTitle -}}
{{"{{"}} .Page.Permalink {{"}}"}} {{- .Page.Permalink -}}
{{"{{"}} .Page.RelPermalink {{"}}"}} {{- .Page.RelPermalink -}}
{{"{{"}} .Page.PlainWords {{"}}"}} {{- .Page.PlainWords -}}
{{"{{"}} .Page.Resources {{"}}"}} {{- .Page.Resources -}}
{{"{{"}} .Page.Draft {{"}}"}} {{- .Page.Draft -}}
{{"{{"}} .Page.Date {{"}}"}} {{- .Page.Date -}}
{{"{{"}} .Page.Lastmod {{"}}"}} {{- .Page.Lastmod -}}
{{"{{"}} .Page.ExpiryDate {{"}}"}} {{- .Page.ExpiryDate -}}
{{"{{"}} .Page.PublishDate {{"}}"}} {{- .Page.PublishDate -}}
{{"{{"}} .Page.Section {{"}}"}} {{- .Page.Section -}}
{{"{{"}} .Page.Sections {{"}}"}} {{- .Page.Sections -}}
{{"{{"}} .Page.FirstSection {{"}}"}} {{- .Page.FirstSection -}}
{{"{{"}} .Page.CurrentSection {{"}}"}} {{- .Page.CurrentSection -}}
{{"{{"}} .Page.Parent {{"}}"}} {{- .Page.Parent -}}
{{- end -}} {{- if eq $type ".Page.Params" -}}
Ausgabe .Page.Params (einzeln) Ergebnis
{{"{{"}} .Page.Params.tags {{"}}"}} {{- .Page.Params.tags -}}
{{"{{"}} .Page.Params.type {{"}}"}} {{- .Page.Params.type -}}
{{"{{"}} .Page.Params.title {{"}}"}} {{- .Page.Params.title -}}
{{"{{"}} .Page.Params.submenu {{"}}"}} {{- .Page.Params.submenu -}}
usw.

{{ range $i, $element := $.Page.Params }} {{ end }}
Ausgabe per range)
{{ $i }}{{ $element }}

Ausgabe .Page.Params (zusammen)
{{ .Page.Params }}
{{- end -}} {{- if eq $type ".Page.GitInfo" -}}
Aufruf in *.html Ergebnis
{{- "{{" -}} .Page.GitInfo {{- "}}" -}} {{- .Page.GitInfo -}}
{{- "{{" -}} .Page.GitInfo.AbbreviatedHash {{- "}}" -}} {{- .Page.GitInfo.AbbreviatedHash -}}
{{- "{{" -}} .Page.GitInfo.AuthorName {{- "}}" -}} {{- .Page.GitInfo.AuthorName -}}
{{- "{{" -}} .Page.GitInfo.AuthorEmail {{- "}}" -}} {{- .Page.GitInfo.AuthorEmail -}}
{{- "{{" -}} .Page.GitInfo.AuthorDate {{- "}}" -}} {{- .Page.GitInfo.AuthorDate -}}
{{- "{{" -}} .Page.GitInfo.Hash {{- "}}" -}} {{- .Page.GitInfo.Hash -}}
{{- "{{" -}} .Page.GitInfo.Subject {{- "}}" -}} {{- .Page.GitInfo.Subject -}}
{{- "{{" -}} .Page.GitInfo.CommitDate {{- "}}" -}} {{- .Page.GitInfo.CommitDate -}}
{{- "{{" -}} .Page.GitInfo.Body {{- "}}" -}} {{- .Page.GitInfo.Body -}}
{{- end -}} {{- if eq $type ".Page.File" -}}
Aufruf in *.html Ergebnis
{{- "{{"}} .Page.File {{"}}" -}} {{- .Page.File -}}
{{- "{{"}} .Page.File.Path {{"}}" -}} {{- .Page.File.Path -}}
{{- "{{"}} .Page.File.Dir {{"}}" -}} {{- .Page.File.Dir -}}
{{- "{{"}} .Page.File.LogicalName {{"}}" -}} {{- .Page.File.LogicalName -}}
{{- "{{"}} .Page.File.BaseFileName {{"}}" -}} {{- .Page.File.BaseFileName -}}
{{- "{{"}} .Page.File.Ext {{"}}" -}} {{- .Page.File.Ext -}}
{{- "{{"}} .Page.Language.Lang {{"}}" -}} {{- .Page.Language.Lang -}}
{{"{{"}} .Page.File.UniqueID {{"}}"}} {{- .Page.File.UniqueID -}}
{{"{{"}} .Page.File.TranslationBaseName {{"}}"}} {{- .Page.File.TranslationBaseName -}}
{{"{{"}} .Page.File.ContentBaseName {{"}}"}} {{- .Page.File.ContentBaseName -}}
{{- end -}} {{- if eq $type "urls.Parse" -}} {{ $parse := urls.Parse $param }}
$parse.Scheme {{- $parse.Scheme -}}
$parse.Host {{- $parse.Host -}}
$parse.Path {{- $parse.Path -}}
$parse.Fragment {{- $parse.Fragment -}}
{{- end -}} {{- if eq $type "readDir" -}} {{- $files := readDir $param -}} {{- range $files -}} {{- end -}}
{{- .Name -}}
{{- end -}} {{- if eq $type "os.Stat" -}} {{- $docs := readDir $param -}} {{- range $docs -}} {{ end }}
.Name .IsDir .Size .Modtime (zuletzt geändert) {{"{{"}}path.Ext .Name {{"}}"}}
{{- .Name -}} {{- .IsDir -}} {{- .Size -}} {{- .ModTime -}} {{- path.Ext .Name -}}
{{- end -}} {{- if eq $type "path.xxx" -}}
Aufruf in *.html Ergebnis
{{- "{{" -}} .Page.File {{- "}}" -}} {{- .Page.File -}}
{{- "{{" -}} path.Base (.Page.File) {{- "}}" -}} {{- path.Base (.Page.File) -}}
{{- "{{" -}} path.Clean (.Page.File) {{- "}}" -}} {{- path.Clean (.Page.File) -}}
{{- "{{" -}} path.Clean "a\\b//x/zz/" {{- "}}" -}} {{- path.Clean "a\\b//x/zz/" -}}
{{- "{{" -}} path.Dir (.Page.File) {{- "}}" -}} {{- path.Dir (.Page.File) -}}
{{- "{{" -}} path.Ext (.Page.File) {{- "}}" -}} {{- path.Ext (.Page.File) -}}
{{- "{{" -}} path.Join "yyy" (.Page.File) {{- "}}" -}} {{- path.Join "yyy" (.Page.File) -}}
{{- end -}} {{- if eq $type "path.Split" -}}
Aufruf in *.html Ergebnis
{{- "{{" -}} .Page.File {{- "}}" -}} {{- .Page.File -}}
{{- "{{" -}} $dirFile := path.Split (.Page.File) {{- "}}" -}} {{- $dirFile := path.Split (.Page.File) -}}
{{- "{{" -}} $dirFile.Dir {{- "}}" -}} {{- $dirFile.Dir -}}
{{- "{{" -}} $dirFile.File {{- "}}" -}} {{- $dirFile.File -}}
{{- end -}} {{- if eq $type "sitemaps.xxx" -}}
Aufruf in *.html Ergebnis
{{"{{"}} .Page.Sitemap.Filename {{"}}"}} {{- .Page.Sitemap.Filename -}}
{{"{{"}} .Page.Sitemap.Priority {{"}}"}} {{- .Page.Sitemap.Priority -}}
{{"{{"}} .Page.Sitemap.ChangeFreq {{"}}"}} {{- .Page.Sitemap.ChangeFreq -}}
{{- end -}} {{- if eq $type "strings" -}}
TrimRight 1 Ergebnis
{{"{{"}} $var01 := .Page.Permalink {{"}}"}} {{- $var01 := .Page.Permalink -}}
{{"{{"}} $var01 {{"}}"}} {{- $var01 -}}
{{"{{"}} strings.TrimRight "tion/" $var01 {{"}}"}} {{- strings.TrimRight "tion/" $var01 -}}

TrimRight 2 Ergebnis
{{- "{{" -}} $var02 := .Page.File.BaseFileName {{- "}}" -}} {{- $var02 := .Page.File.BaseFileName -}}
{{- "{{" -}} $var02 {{- "}}" -}} {{- $var02 -}}
{{- "{{" -}} strings.TrimRight $var02 (strings.TrimRight "/" $var01) {{- "}}" -}} {{- strings.TrimRight $var02 (strings.TrimRight "/" $var01) -}}

String Count Ergebnis
{{- "{{" -}} "Hello, world" | strings.RuneCount {{- "}}" -}}{{- "Hello, world" | strings.RuneCount -}}
{{- "{{" -}} "Hello, world" | countrunes {{- "}}" -}}{{- "Hello, world" | countrunes -}}
{{- "{{" -}} "aaabaab" | strings.Count "a" {{- "}}" -}}{{- "aaabaab" | strings.Count "a" -}}
{{- "{{" -}} "aaabaab" | strings.Count "aa" {{- "}}" -}}{{- "aaabaab" | strings.Count "aa" -}}
{{- "{{" -}} "aaabaab" | strings.Count "aaa" {{- "}}" -}}{{- "aaabaab" | strings.Count "aaa" -}}
{{- "{{" -}} "aaabaab" | strings.Count "" {{- "}}" -}}{{- "aaabaab" | strings.Count "" -}}
{{- "{{" -}} "aaab aab" | strings.Count "" {{- "}}" -}}{{- "aaabaab" | strings.Count "" -}}

{{- end -}}