GoBlog/templates/photos.gohtml

31 lines
903 B
Plaintext

{{ define "title" }}
{{ if .Blog.Photos.Title }}
<title>{{ .Blog.Photos.Title }} - {{ .Blog.Title }}</title>
{{ else }}
<title>{{ .Blog.Title }}</title>
{{ end }}
{{ end }}
{{ define "main" }}
<main>
{{ with .Blog.Photos.Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Blog.Photos.Description }}{{ md . }}{{ end }}
{{ if (or .Blog.Photos.Title .Blog.Photos.Description) }}
<hr>
{{ end }}
{{ $blog := .Blog }}
{{ range $i, $post := .Data.Posts }}
{{ include "photosummary" $blog $post }}
{{ end }}
{{ if .Data.HasPrev }}
<p><a href="{{ .Data.Prev }}">{{ string .Blog.Lang "prev" }}</a></p>
{{ end }}
{{ if .Data.HasNext }}
<p><a href="{{ .Data.Next }}">{{ string .Blog.Lang "next" }}</a></p>
{{ end }}
</main>
{{ end }}
{{ define "photos" }}
{{ template "base" . }}
{{ end }}