Files
hugo-cwpearson/themes/hugo-academic-master/layouts/partials/widgets/posts.html
Carl Pearson be45676d32 Initial commit
2017-03-12 21:27:57 -05:00

39 lines
1.3 KiB
HTML

{{ $ := .root }}
{{ $page := .page }}
{{ $posts_len := len (where (where $.Data.Pages "Type" "post") ".Params.notonhomepage" nil) }}
<!-- Blog Posts widget -->
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $posts_len $page.Params.count }}
<p class="view-all">
<a href="{{ "/post/" | relLangURL }}">
{{ i18n "more_posts" | markdownify }}
<i class="fa fa-angle-double-right"></i>
</a>
</p>
{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if $page.Params.tags }}
{{ range first $page.Params.count (where (where (where $.Data.Pages "Type" "post") ".Params.tags" "intersect" $page.Params.tags) ".Params.notonhomepage" nil) }}
{{ $params := dict "post" . "page" $page }}
{{ partial "post_li" $params }}
{{ end }}
{{ else }}
{{ range first $page.Params.count (where (where $.Data.Pages "Type" "post") ".Params.notonhomepage" nil) }}
{{ $params := dict "post" . "page" $page }}
{{ partial "post_li" $params }}
{{ end }}
{{ end }}
</div>
</div>