show recents
This commit is contained in:
parent
2adfc5b384
commit
39cadd7479
1 changed files with 18 additions and 0 deletions
18
layouts/_partials/docs/inject/content-after.html
Normal file
18
layouts/_partials/docs/inject/content-after.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{{ if .IsHome }}
|
||||
{{ $posts := where site.RegularPages "Section" "docs" }}
|
||||
{{ $posts = where $posts "Params.bookHidden" "ne" true }}
|
||||
{{ $posts = $posts.ByDate.Reverse }}
|
||||
{{ if $posts }}
|
||||
<article class="markdown book-article">
|
||||
<h2>Recent Posts</h2>
|
||||
<ul>
|
||||
{{ range first 10 $posts }}
|
||||
<li>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{ with .Date }}<small style="opacity: 0.6; margin-left: 0.5em;">— {{ .Format "January 2, 2006" }}</small>{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Loading…
Reference in a new issue