hide featured articles container if disabled, made featured articles into a partial
This commit is contained in:
parent
13bb88e93a
commit
8b85e7c51f
|
@ -8,32 +8,9 @@
|
|||
{{ if .Site.Params.enableFeatured | default false }}
|
||||
{{ $featuredPostsList = where $allPostsList "Params.featured" true }}
|
||||
{{ $postsList = union (where $allPostsList "Params.featured" false) (where $allPostsList "Params.featured" nil) }}
|
||||
{{- partial "featured_articles.html" $featuredPostsList -}}
|
||||
{{ end }}
|
||||
|
||||
<div class="featured postlist gridView">
|
||||
{{ range $featuredPostsList }}
|
||||
<a class="featuredCardLink" href="{{ .Permalink }}">
|
||||
<article class="featuredCard {{ if .Site.Params.discreteCards }}discrete{{ end }}"
|
||||
style="background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 59%, rgba(0, 0, 0, 0.7) 100%), url('{{ .Params.Image }}');">
|
||||
<div class="contentArea">
|
||||
<h2>{{ .Title }}</h2>
|
||||
<p class="date">
|
||||
<span title="Date"> </span>
|
||||
{{ .Date.Format "2006-01-02" }}
|
||||
{{ if .Params.tags }}
|
||||
<br />
|
||||
<span title="Tags"> </span>
|
||||
{{ range .Params.tags }}
|
||||
#{{ . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{/* pagination */}}
|
||||
<div class="postlist {{ if .Site.Params.gridView }}gridView{{ end }}" id="postlist">
|
||||
{{ range (.Paginate $postsList).Pages }}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<div class="featured postlist gridView">
|
||||
{{ range . }}
|
||||
<a class="featuredCardLink" href="{{ .Permalink }}">
|
||||
<article class="featuredCard {{ if .Site.Params.discreteCards }}discrete{{ end }}"
|
||||
style="
|
||||
background-image: linear-gradient(to bottom,
|
||||
rgba(0, 0, 0, 0) 0%,
|
||||
rgba(0, 0, 0, 0) 59%,
|
||||
rgba(0, 0, 0, 0.7) 100%
|
||||
), url('{{ .Params.Image }}');
|
||||
">
|
||||
<div class="contentArea">
|
||||
<h2>{{ .Title }}</h2>
|
||||
<p class="date">
|
||||
<span title="Date"> </span>
|
||||
{{ .Date.Format "2006-01-02" }}
|
||||
{{ if .Params.tags }}
|
||||
<br />
|
||||
<span title="Tags"> </span>
|
||||
{{ range .Params.tags }}
|
||||
#{{ . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
Loading…
Reference in New Issue