diff options
Diffstat (limited to 'themes/hugo-xmag/layouts/_default/list.html')
| -rw-r--r-- | themes/hugo-xmag/layouts/_default/list.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/themes/hugo-xmag/layouts/_default/list.html b/themes/hugo-xmag/layouts/_default/list.html new file mode 100644 index 0000000..5c1ac2c --- /dev/null +++ b/themes/hugo-xmag/layouts/_default/list.html @@ -0,0 +1,52 @@ +{{ partial "header.html" . }} + +<div class="container"> +<main class="list"> +{{ $pages := .Pages }} +{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }} +{{ $paginator := .Paginate (where $pages "Section" "!=" "") }} +{{ range $paginator.Pages }} +<section class="article-list"> + <div class="categories"> + {{ with .Params.categories }} + {{ range first 1 . }} + <a href="{{ relURL (print "/categories/" . | urlize) }}">{{ . }}</a> + {{ end }} + {{ else }} + <a>{{ default "Uncategorized" .Site.Params.text.uncategorized }}</a> + {{ end }} + </div> + <h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1> + <div class="date-author"> + {{ if .Params.author }}<span class="author">{{ partial "author_names.html" . }}</span> / {{ end }} + <span class="date">{{ .Date.Format "2006-01-02" }}</span> + </div> + <div class="summary"> + <a href="{{ .RelPermalink }}"> + {{ with .Resources.GetMatch (printf "%s" .Params.thumbnail) }} + <div class="thumbnail"><img src="{{ relURL .Permalink }}" alt="Thumbnail" /></div> + {{ else }} + {{ with .Params.thumbnail }} + <div class="thumbnail"><img src="{{ relURL .}}" alt="Thumbnail" /></div> + {{ else }} + {{ $img := findRE "<img src=\"[^\"]+\"" .Content 1 }} + {{ range $img }} + <div class="thumbnail">{{ (print . " alt=\"Thumbnail\" />") | safeHTML }}</div> + {{ end }} + {{ end }} + {{ end }} + {{ with .Description }} + {{ $.Scratch.Set "summary" (markdownify .) }} + {{ else }} + {{ $.Scratch.Set "summary" ((delimit (findRE "(<p.*?>(.|\n)*?</p>\\s*)+" .Content) "[…] ") | plainify | truncate (default 200 .Site.Params.summary_length) (default " …" .Site.Params.text.truncated ) | replaceRE "&" "&" | safeHTML) }} + {{ end }} + {{ $.Scratch.Get "summary" }} + </a> + </div> +</section> +{{ end }} +</main> +<nav>{{ template "_internal/pagination.html" . }}</nav> +</div> + +{{ partial "footer.html" . }} |
