Newer
Older
{{- $block_class := partial "GetBlockClass" .block -}}
{{- $options := dict
"hide_image" .hide_image
"hide_summary" .hide_summary
"hide_category" .hide_category
"hide_author" .hide_author
"hide_date" .hide_date
-}}
{{- $term = site.GetPage (printf "/posts_categories%s" .category) -}}
<div itemscope itemtype="http://schema.org/Blog" class="{{ $block_class }} {{ if $term }} term-{{ replace $term.Slug "/" "" }} {{- end -}}">
{{ if $block.title -}}
{{ $link := false }}
{{- if $term }}
{{ $link = $term.Permalink }}
{{- else if .all -}}
{{ $posts_page := site.GetPage "/posts" }}
{{ $link = $posts_page.Permalink }}
{{- end -}}
{{ partial "blocks/top.html" (dict
"title" $block.title
{{ if eq .mode "categories" }}
<ul class="categories categories--grid">
<a href="{{ .Page.Permalink }}" class="title" aria-label="{{ i18n "commons.more_aria" (dict "Title" .Page.Title) }}">{{ partial "PrepareHTML" .Page.Title }}</a>
<p>{{ i18n "blocks.categories.items.count" ( len . ) }}</p>
</li>
{{ end }}
</ul>
{{ else if .posts }}
{{ partial (printf "blocks/templates/posts/%s.html" $layout) (dict
"posts" .posts
"heading_level" $block.ranks.children