abdd02ed |
1 | {{ define "category-list" }} |
2 | <section id="one"> |
3 | <div class="inner"> |
4 | <header class="major"> |
5 | <h2>Category: {{ .Title }}</h2> |
6 | </header> |
7 | <p>Here you'll find all my articles related to {{ .Title }}. Enjoy.</p> |
8 | </div> |
9 | </section> |
10 | <section id="two" class="spotlights"> |
11 | <!-- Ranges through content/articles/*.md --> |
12 | {{ range .Paginator.Pages }} |
13 | <section> |
14 | <a class="image" href="{{.Permalink}}"> |
15 | {{ if isset .Params "featured_image" }} |
16 | <img src="{{ .Params.featured_image | absURL}}" data-position="center center" alt="{{.Title}}"> |
17 | {{ else }} |
18 | {{ $default_image := resources.Get "img/default_article.jpg" }} |
19 | <img src="{{ $default_image.Permalink }}" data-position="center center" alt="{{.Title}}"> |
20 | {{ end }} |
21 | </a> |
22 | <div class="content"> |
23 | <div class="inner"> |
24 | <header class="major"> |
25 | <h3> |
26 | {{ if gt (len .Title) 40 }} |
27 | {{ $first50 := ( substr .Title 0 40 ) }} |
28 | {{ $lastChars := ( substr .Title 40 ) }} |
29 | {{ $newLine := "<br>" }} |
30 | {{ $newTitle := ( printf "%s" $lastChars | printf "%s%s" $newLine | printf "%s%s" $first50 ) }} |
31 | {{ $newTitle | safeHTML }} |
32 | {{ else }} |
33 | {{ .Title }} |
34 | {{ end }} |
35 | </h3> |
36 | </header> |
37 | <p>{{ .Params.excerpt }}</p> |
38 | <ul class="actions"> |
39 | <li><a href="{{.Permalink}}" class="button">Read More</a></li> |
40 | </ul> |
41 | </div> |
42 | </div> |
43 | </section> |
44 | {{ end }} |
45 | </section> |
46 | <section id="three"> |
47 | <div class="inner"> |
48 | {{ partial "pagination.html" . }} |
49 | </div> |
50 | </section> |
51 | {{ end }} |