Welcome to mirror list, hosted at ThFree Co, Russian Federation.

list.html « _default « layouts - github.com/yihui/hugo-xmag.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ffb7215c1346212443b44c155cbf92dc76770637 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{{ partial "header.html" . }}

<div class="container">
<main class="list">
{{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }}
{{ range $paginator.Pages }}
<section class="article-list">
  {{ with .Params.categories }}
  {{ range first 1 . }}
  <div class="categories">
    <a href="{{ relURL (print "/categories/" . | urlize) }}">{{ . }}</a>
  </div>
  {{ end }}
  {{ end }}
  <h1><a href="{{ .URL }}">{{ .Title }}</a></h1>
  <div>
    <span>{{ .Date.Format "2006/01/02" }}</span>
    {{ with .Params.author }}<span>{{ . }}</span>{{ end }}
  </div>
  <div class="summary">
    <a href="{{ .URL }}">
    {{ 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 }}
    {{ if and .Description (or .Params.use_description .Site.Params.use_description) }}
    {{ $.Scratch.Set "summary" .Description }}
    {{ else }}
    {{ $.Scratch.Set "summary" (delimit (.Content | findRE "<p.*?>(.|\n)*?</p>") "[&hellip;] ") }}
    {{ end }}
    {{ ($.Scratch.Get "summary") | plainify | truncate (default 200 .Site.Params.summary_length) | replaceRE "&amp;" "&" | safeHTML }}
    </a>
  </div>
</section>
{{ end }}
</main>
<nav>{{ template "_internal/pagination.html" . }}</nav>
</div>

{{ partial "footer.html" . }}