jlelse
/
Indieroad
Archived
1
Fork 0

Add layout for photos page

This commit is contained in:
Jan-Lukas Else 2020-02-13 08:09:33 +01:00
parent d76eb85f1d
commit 41a5632d4d
3 changed files with 36 additions and 0 deletions

View File

@ -952,4 +952,9 @@ textarea {
margin: 0;
cursor: pointer;
}
}
/* Photo summary */
.photosummary img {
width: 100%;
}

View File

@ -0,0 +1,10 @@
<article class="list-item h-entry photosummary">
<div class="list-excerpt">
{{ range .Params.images }}
<p><figure><img src="{{ . | safeURL }}"></figure></p>
{{ end }}
</div>
<div class="list-footer">
<a class="read-more u-url" href="{{ .RelPermalink }}">{{ T "read_more" }}</a>
</div>
</article>

21
layouts/photos/list.html Normal file
View File

@ -0,0 +1,21 @@
{{ define "main" }}
<main class="main list">
{{- with .Title }}
<header class="main-header">
<h1 class="main-title">{{ . }}</h1>
</header>
{{- end }}
{{- with .Content }}
<div class="main-content">
{{ . }}
</div>
{{- end }}
{{- $photoSections := (.Site.Param "photoSections" | default (slice "posts")) }}
{{- $paginator := .Paginate ( where ( where .Site.RegularPages "Type" "in" $photoSections ) "Params.images" "!=" nil ) 5 }}
{{- range $paginator.Pages }}
{{- .Render "photosummary" }}
{{- end }}
{{ partial "authorbox.html" . }}
</main>
{{ partial "pagination.html" . }}
{{ end }}