【发布时间】:2017-07-15 10:39:02
【问题描述】:
我尝试在我的 jekyll 博客中显示标签云,如下所示
https://superdevresources.com/tag-cloud-jekyll/
但是,我无法访问 tag.tags.size
这是sidebar.html的代码
{% assign tags = site.tags | sort %}
{% for tag in tags %}
<span>
<a href="/tags/{{ tag.slug }}" class="tag-reverse">
<span>{{ tag.name }}</span>
<span>({{ tag.tags.size }})</span>
^ This is always null
</a>{% unless forloop.last %}{% endunless %}
</span>
{% endfor %}
我认为tag.tags 中的size 代表特定标签中的帖子数。但是null总是来的,即使标签里有帖子
仅供参考,这是_config.xml的一些内容
# Tags
collections:
tags:
output: true
permalink: /tags/:path/
defaults:
- scope:
path: ''
type: tags
values:
layout: tag
你可以通过https://github.com/closer27/closer27.github.io访问我的博客仓库
谢谢你帮助我
【问题讨论】: