{{- /* File: gallary.html Description: Alle Bilder anzeigen Parameter: 1 Parametertype: Name Parametername 1: relpath requires: Verzeichnis ./image returns: notice: example: 1. wenn das Verzeichnis image existiert {{}} 2. mit relativen Path {{}} {{}} */ -}} {{- if eq .Page.BundleType "leaf" -}} {{ $.Scratch.Set "RelPathIs" "/" }} {{- else -}} {{ $.Scratch.Set "RelPathIs" "" }} {{- end -}} {{- if .Get "relpath" -}} {{- with .Get "relpath" -}} {{ $.Scratch.Add "RelPathIs" . }} {{- end -}} {{- else -}} {{- $.Scratch.Add "RelPathIs" "image" -}} {{- end -}} {{- $.Scratch.Set "Path_URL" (strings.TrimRight (.Page.File.BaseFileName) (strings.TrimRight "/" (.Page.Permalink))) -}} {{- $.Scratch.Add "Path_URL" ($.Scratch.Get "RelPathIs") -}} {{- $.Scratch.Add "Path_URL" "/" -}} {{- $.Scratch.Set "Path_Files" (path.Join "content" .Page.File.Dir ($.Scratch.Get "RelPathIs") ) -}} {{ $.Scratch.Set "Path_Files_exist" "true" }} {{- if not (os.FileExists ($.Scratch.Get "Path_Files") ) -}}
Error - Path nicht korrekt: {{ $.Scratch.Get "Path_Files" }}
{{ $.Scratch.Set "Path_Files_exist" "false" }} {{- end -}} {{ "" }}
{{ if eq ($.Scratch.Get "Path_Files_exist") "true" }} {{- if eq .Page.BundleType "leaf" -}} {{- $.Scratch.Set "tempXX" (strings.TrimLeft "/" ($.Scratch.Get "RelPathIs")) -}} {{- $.Scratch.Add "tempXX" "/**.jpg" -}} {{- $image := .Page.Resources.Match ($.Scratch.Get "tempXX") -}} {{- with $image -}}
{{- range $image -}}
no Image {{- with .Exif -}}
    {{ with .Date }}
  • Date: {{ .Format "January 02, 2006" }}
  • {{ end }} {{ with .Tags.ApertureValue }}
  • Aperture: {{ lang.FormatNumber 2 . }}
  • {{ end }} {{ with .Tags.BrightnessValue }}
  • Brightness: {{ lang.FormatNumber 2 . }}
  • {{ end }} {{ with .Tags.ExposureTime }}
  • Exposure Time: {{ . }}
  • {{ end }} {{ with .Tags.FNumber }}
  • F Number: {{ . }}
  • {{ end }} {{ with .Tags.FocalLength }}
  • Focal Length: {{ . }}
  • {{ end }} {{ with .Tags.ISOSpeedRatings }}
  • ISO Speed Ratings: {{ . }}
  • {{ end }} {{ with .Tags.LensModel }}
  • Lens Model: {{ . }}
  • {{ end }}
{{- end -}}
{{- end -}}
{{- end -}} {{- else -}} {{- $files := readDir ($.Scratch.Get "Path_Files") -}}
{{- range $files -}} {{- if or (eq (path.Ext .Name) ".png") (eq (path.Ext .Name) ".jpg") (eq (path.Ext .Name) ".jpeg") }}
no Image
{{- end -}} {{- end -}}
{{- end -}} {{- end -}} {{ "" }}
{{ "" }}