diff options
Diffstat (limited to 'layouts/index.html')
-rw-r--r-- | layouts/index.html | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/layouts/index.html b/layouts/index.html index 45cd857..3ddc6dd 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -9,13 +9,34 @@ {{ partial "header.html" . }} <div class="main"> <ul id="og-grid" class="og-grid"> - {{ range $.Site.Data.items.items }} + {{ range $page := sort (where .Site.RegularPages "Type" "photo") ".Dir" }} + {{ range $index, $image := sort ($page.Resources.ByType "image") "Params.order" }} <li> - <a href="{{.url}}" data-largesrc="{{.image}}" data-title="{{.title}}" data-description="{{.description }}" data-buttontext="{{.buttontext}}"> - <img src="{{.thumb}}" alt="{{.alt}}"/> + <a href="{{ if isset $image.Params "button_url" }}{{ $image.Params.button_url }}{{ else }}#{{ end }}" data-largesrc="{{ $image.RelPermalink }}" + data-title="{{ $image.Name }}" + data-description="{{ $image.Params.description | markdownify }}" + {{ if isset $image.Params "button_text" }}data-buttontext="{{ $image.Params.button_text }}"{{ end }} data-collection="{{ $page.Title }}" + data-exif="{{- with $image.Exif -}} + {{- with .Tags -}} + <li>{{- if isset . "Model" }}{{ if not (hasPrefix (lower .Model) (lower .Make)) }}{{ .Make }} {{ end }}{{ .Model }} + {{- else }}{{ if isset $image.Params "composite" }}{{ $image.Params.composite }} + {{- else }}Composite Photo{{ end }}{{ end }}</li> + {{- if isset . "LensModel" }} + <li>{{- if not (hasPrefix (lower .LensModel) (lower .Make)) }}{{ .LensModel }} + {{- else }}{{ substr .LensModel (len .Make)}}{{ end }} @ {{ .FocalLength }}mm</li> + {{- end }} + {{- with .ExposureTime }}<li>S.S. {{ . }}s</li>{{ end }} + {{- with .FNumber }}<li>A. f/{{ . }}</li>{{ end }} + {{- with .ISOSpeedRatings }}<li>ISO {{ . }}</li>{{ end }} + {{ end -}} + <li>Taken at {{ if isset $image.Params "timestamp" }} {{ $image.Params.timestamp }} {{ else }}{{ .Date.Format "2006-1-2 15:04" }}{{ end }}</li> + {{ end }}"> + {{ $.Scratch.Set "thumbnail" ($image.Resize "x250") }} + <img class="lazy" data-src="{{ ($.Scratch.Get "thumbnail").RelPermalink }}" style="width:{{ ($.Scratch.Get "thumbnail").Width }}px;" alt="Thumbnail of {{ $image.Name }}"/> </a> </li> {{ end }} + {{ end }} </ul> {{ partial "footer.html" . }} </div> |