在 freemarker 中,我如何遍历所有带有特定标签的博客文章,例如标签“算法”?
<#assign relatedBlogs = ...>
<#if relatedBlogs?size > 0>
<h2>Related blog posts</h2>
<ul>
<#list relatedBlogs as blog>
<li>
<a href="${content.rootpath}${blog.uri}">${blog.title}</a>
</li>
</#list>
</ul>
</#if>
这对我不起作用:
<#assign relatedBlogs = tagged_posts["algorithms"]>
这也不起作用:
<#assign relatedBlogs = tags["algorithms"].tagged_posts>