Browse Source

Add recommended section

test
Alex Barilaro 2 years ago
parent
commit
107f739939
  1. 1
      archetypes/posts.md
  2. 13
      layouts/posts/list.html

1
archetypes/posts.md

@ -4,5 +4,6 @@ date: {{ .Date }}
status: []
tags: []
categories: []
recommended: false
---

13
layouts/posts/list.html

@ -1,6 +1,17 @@
{{ define "main" }}
{{ if .Params.landing }}
<h2>latest posts</h2>
<h2>recommended</h2>
<div class='block fade'>
{{ range first 3 (shuffle (where .Site.RegularPages "Params.recommended" "==" true)) }}
<div class='entry'>
<h3><a href="{{.RelPermalink}}">{{.Title}}</a></h3>
{{ range .Params.categories }}<a class='category' href='/categories/{{.}}'>{{.}}</a>{{ end }}
<p><span class='date'>{{ dateFormat "Jan 02, 2006" .Date}}</span></p>
</div>
{{ end }}
</div>
<h2>new</h2>
<div class='block fade'>
{{ range first 3 .Site.RegularPages }}
<div class='entry'>

Loading…
Cancel
Save