Skip to content
Snippets Groups Projects
Commit ada3edbf authored by alexisben's avatar alexisben
Browse files

handle categories in block post

parent a6094906
No related branches found
No related tags found
No related merge requests found
......@@ -206,3 +206,18 @@
margin-right: auto
.post
width: col(4, 10)
// Move this part to blocks/categories when categories block is ready
.block-posts
.categories--grid
li
background: $color-background-alt
padding: $spacing1
position: relative
a
@include h3
font-weight: bold
text-decoration: none
@include stretched-link
p
display: block
\ No newline at end of file
ul.categories
@include list-section
li
a:first-child
& + p
text-align: right
white-space: nowrap
&:not(.categories--grid)
@include list-section
li
a:first-child
& + p
text-align: right
white-space: nowrap
&--grid
@include list-reset
@include grid(1)
@include grid(4, md)
.categories__term
main
......
blocks:
call_to_action:
title: Call to action
categories:
title: Catégories
items:
count: "{{ .Count }} articles"
chapter:
title: Chapter
contact:
......
blocks:
call_to_action:
title: Appel à actions
categories:
title: Catégories
items:
count:
one: "1 article"
other: "{{ .Count }} articles"
chapter:
title: Chapitre
contact:
......
......@@ -26,10 +26,22 @@
)}}
{{- end }}
{{ partial (printf "blocks/templates/posts/%s.html" $layout) (dict
"posts" .posts
"heading_level" $block.ranks.children
)}}
{{ if eq .mode "categories" }}
<ul class="categories categories--grid">
{{ range site.Taxonomies.categories }}
<li data-title="{{ .Page.Title }}">
{{ partial "categories/category.html" .Page }}
<p>{{ i18n "blocks.categories.items.count" (dict "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
)}}
{{ end }}
</div>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment