diff options
Diffstat (limited to 'internal/web/templates/partials/postlist.html')
| -rw-r--r-- | internal/web/templates/partials/postlist.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/web/templates/partials/postlist.html b/internal/web/templates/partials/postlist.html index b1e43c6..91e248c 100644 --- a/internal/web/templates/partials/postlist.html +++ b/internal/web/templates/partials/postlist.html @@ -7,7 +7,7 @@ {{if .Image}}<a class="post-thumb" href="/{{.PageSlug}}/{{.Slug}}"><img src="/media/{{.Image}}" alt=""></a>{{end}} <h2 class="post-title"><a href="/{{.PageSlug}}/{{.Slug}}">{{.Title}}</a></h2> {{if $.Data.theme.ShowDates}}<p class="post-date">{{postdate $.Data.theme.DateFormat .CreatedAt}}</p>{{end}} - {{template "posttags" .Tags}} + {{template "posttags" (dict "tags" .Tags "hash" $.Data.theme.TagHash)}} <div class="post-body">{{html .Excerpt}}</div> {{if .HasMore}}<p class="read-more"><a href="/{{.PageSlug}}/{{.Slug}}">{{t "Read more"}} →</a></p>{{end}} </article> @@ -21,4 +21,5 @@ {{end}} {{end}} -{{define "posttags"}}{{if .}}<p class="post-tags">{{range .}}<a href="/tag/{{.Slug}}">{{.Name}}</a> {{end}}</p>{{end}}{{end}} +{{/* .tags and .hash (the theme's TagHash: list them as #name) */}} +{{define "posttags"}}{{if .tags}}<p class="post-tags">{{range .tags}}<a href="/tag/{{.Slug}}">{{if $.hash}}#{{end}}{{.Name}}</a> {{end}}</p>{{end}}{{end}} |
