|
30 | 30 | {{ . }} |
31 | 31 | </div> |
32 | 32 | {{- end }} |
33 | | - |
34 | | - {{- $paginator := .Paginate (where .Data.Pages "Type" "in" .Site.Params.mainSections) }} |
35 | | - {{- if gt (len $paginator.Pages) 0 }} |
36 | | - <hr /> |
37 | | - {{- range $paginator.Pages }} |
38 | | - <section class="post"> |
39 | | - <div class="row"> |
40 | | - <div class="col-md-4"> |
41 | | - <div class="image"> |
42 | | - <a href="{{ .RelPermalink }}"> |
43 | | - {{/* Get banner image if existing, placeholder as fallback, scale 4:3 */}} |
44 | | - {{- $img := ""}}{{ with .Params.banner.image }}{{ $img = . }}{{ else }}{{ $img = "images/placeholder.png" }}{{ end }} |
45 | | - {{- $img = (resources.Get $img).Fill "400x300 center" }} |
46 | | - <img src="{{ $img.RelPermalink }}" class="img-responsive" alt="" /> |
47 | | - </a> |
48 | | - </div> |
49 | | - </div> |
50 | | - <div class="col-md-8"> |
51 | | - <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2> |
52 | | - <div class="clearfix"> |
53 | | - <p class="author-category"> |
54 | | - {{- if isset .Params "authors" }} |
55 | | - {{- i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf " %s/%s" ("authors" | relLangURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }} |
56 | | - {{- end }} |
57 | | - {{- if isset .Params "categories" }} |
58 | | - {{- if gt (len .Params.categories) 0 }} |
59 | | - in |
60 | | - {{- range $index, $category := .Params.categories }}{{ if $index }}, {{ end }} |
61 | | - <a href="{{ " categories/" | relLangURL }}{{ . | urlize | lower }}">{{ $category }}</a>{{ end }} |
62 | | - {{- end }} |
63 | | - {{- end }} |
64 | | - |
65 | | - </p> |
66 | | - {{- if isset .Params "date" }} |
67 | | - |
68 | | - {{- $createdAt := .Date.Format .Site.Params.date_format }} |
69 | | - {{- range $index, $month := slice "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December" }} |
70 | | - {{- $createdAt = replace $createdAt $month (i18n $month) }} |
71 | | - {{- end }} |
72 | | - |
73 | | - <p class="date-comments"> |
74 | | - <a href="{{ .RelPermalink }}"><i class="far fa-calendar"></i> {{ $createdAt }}</a> |
75 | | - </p> |
76 | | - {{- end }} |
77 | | - </div> |
78 | | - {{- if not .Site.Params.recent_posts.hide_summary }} |
79 | | - <p class="intro">{{ .Summary }}</p> |
80 | | - <p class="read-more"><a href="{{ .RelPermalink }}" class="btn btn-template-main">{{ i18n "continueReading" }}</a> |
81 | | - </p> |
82 | | - {{- end }} |
83 | | - </div> |
84 | | - </div> |
85 | | - </section> |
86 | | - {{- end }} |
87 | | - |
88 | | - <ul class="pager"> |
89 | | - {{- if .Paginator.HasPrev }} |
90 | | - <li class="previous"><a href="{{ .Paginator.Prev.URL | relURL }}">← {{ i18n "newer" }}</a></li> |
91 | | - {{- else }} |
92 | | - <li class="previous disabled"><a href="#">← {{ i18n "newer" }}</a></li> |
93 | | - {{- end }} |
94 | | - |
95 | | - {{- if .Paginator.HasNext }} |
96 | | - <li class="next"><a href="{{ .Paginator.Next.URL | relURL }}">{{ i18n "older" }} →</a></li> |
97 | | - {{- else }} |
98 | | - <li class="next disabled"><a href="#">{{ i18n "older" }} →</a></li> |
99 | | - {{- end }} |
100 | | - </ul> |
101 | | - {{- end }} |
102 | 33 | </div> |
103 | 34 | <!-- /.col-md-9 --> |
104 | 35 |
|
|
0 commit comments