{{- $block := .block -}} {{- $block_class := partial "GetBlockClass" .block -}} {{- $term := false -}} {{- $layout := .block.data.layout | default "grid" -}} {{/* Waiting for data fix https://github.com/osunyorg/admin/issues/2060 */}} {{ if eq .block.data.mode "categories" }} {{ $block_class = replace $block_class (printf "block-posts--%s" $layout) " " }} {{ end }} {{- with .block.data }} {{ $options := .options }} {{ if .category }} {{- $term = site.GetPage (printf "/posts_categories%s" .category) -}} {{ end }}
{{ partial "blocks/top.html" $block.top }} {{ if eq .mode "categories" }} {{ else if .posts }} {{ partial (printf "blocks/templates/posts/%s.html" $layout) (dict "posts" .posts "heading_level" $block.ranks.children "options" $options )}} {{ end }}
{{ end -}}