mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2025-12-04 14:50:24 +00:00
Limit number of tags shown
This commit is contained in:
parent
fd4db04d3a
commit
56de4bacdb
1 changed files with 4 additions and 0 deletions
|
|
@ -31,11 +31,15 @@
|
||||||
<div class="bloglist-item">
|
<div class="bloglist-item">
|
||||||
<p><a href="{{ .Permalink }}">{{ .Title }}</a></p>
|
<p><a href="{{ .Permalink }}">{{ .Title }}</a></p>
|
||||||
<p class="bloglist-item-tag">
|
<p class="bloglist-item-tag">
|
||||||
|
{{ $tag_count := 0 }}
|
||||||
{{ range .Params.tags }}
|
{{ range .Params.tags }}
|
||||||
|
{{ if lt $tag_count 2 }}
|
||||||
{{ $name := . }}
|
{{ $name := . }}
|
||||||
{{ with $.Site.GetPage (printf "/tags/%s" (. | urlize)) }}
|
{{ with $.Site.GetPage (printf "/tags/%s" (. | urlize)) }}
|
||||||
<span><a href="{{ .Permalink }}">#{{ $name }}</a> </span>
|
<span><a href="{{ .Permalink }}">#{{ $name }}</a> </span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ $tag_count = add $tag_count 1 }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue