下载
首先到 https://github.com/robbyedwards/octopress-tag-pages 和 https://github.com/robbyedwards/octopress-tag-cloud 下载这两个项目的代码。
octopress-tag-pages
把里面的文件复制到相应位置,之前已有的文件,看代码,把需要的代码加上去,.md文件先不用管
octopress-tag-cloud
1 . 将 octopress-tag-cloud\plugins 路径里面的 tag_cloud.rb 文件复制到 octopress\plugins\ 文件夹里面。
2 . 将下面的代码复制到 octopress\source\_includes\custom\asides\tags.html。(这个文件需要自己新建。)
注意: 去掉 % 前面的反斜杠\。
1 2 3 4 5 6 | |
解释:
tag_cloud 的参数中, font-size 指定 tag 的大小范围;limit 限定 20 个 tag 。
3 . 在 octopress\_config.yml 中的 default_asides 中添加 custom/asides/tags.html,注意相应的位置。
1
| |
博文写标签:
1
| |
rake generate 出现问题:
1
| |
解决
octopress\plugins\tag_cloud.rb 第74行:
1 2 3 4 5 6 | |
weighted = weighted[0,@limit] 应该是取指定数目的标签。如果标签数量少于 @limit ,会报错。
修改第74行为:
1
| |
修改第95行为:
1
| |
rake generate ,不再出现错误
出现另一警告:
rake preview ,标签云成功添加:
解决 Build Warning: Layout 'nil' requested in tags/标签名/atom.xml does not exist. 警告问题
将 octopress\source\_includes\custom\tag_feed.xml 文件里面 nil 改为 null :
1 2 3 | |