diff --git a/exampleSite/content/home/tags.md b/exampleSite/content/home/tags.md index 4ad29fe5..56c048c0 100644 --- a/exampleSite/content/home/tags.md +++ b/exampleSite/content/home/tags.md @@ -7,4 +7,8 @@ weight = 120 # Order that this section will appear. title = "Popular Topics" subtitle = "" + +[content] + # Choose how many tags you would like to display (0 = all tags) + count = 20 +++ diff --git a/layouts/partials/widgets/tag_cloud.html b/layouts/partials/widgets/tag_cloud.html index 6bf26106..af8b82ce 100644 --- a/layouts/partials/widgets/tag_cloud.html +++ b/layouts/partials/widgets/tag_cloud.html @@ -1,26 +1,34 @@ {{ $ := .root }} -{{ $page := .page }} +{{ $st := .page }} + +{{ $items_count := $st.Params.content.count }} +{{ if eq $items_count 0 }} + {{ $items_count = 65535 }} +{{ else }} + {{ $items_count = $items_count | default 20 }} +{{ end }}
{{ . | markdownify | emojify }}
{{ end }} +{{ . | markdownify | emojify }}
{{ end }}