Closed richardmyu closed 6 years ago
按照操作,“hexo d”以后,在标签页就可以看到标签云了
但是,在其他页,比如about,categories等也会出现标签云,并且在标签页点击标签跳转以后,也会出现标签云
next/layout/_macro/sidebar.swig
补充:tag canvas.js和tagcloud.js文件都已经导入,在public中也有(非手动导入)
(The version of the project, operating system, hardware etc.) hexo: 3.7.0 hexo-cli: 1.1.0 os: Windows_NT 10.0.14393 win32 x64 http_parser: 2.7.0 node: 8.9.0 v8: 6.1.534.46 uv: 1.15.0 zlib: 1.2.11 ares: 1.10.1-DEV modules: 57 nghttp2: 1.25.0 openssl: 1.0.2l icu: 59.1 unicode: 9.0 cldr: 31.0.1 tz: 2017b
我想,是不是可以在if里面再添加一个判断条件,即只有在有标签和当前页为标签页时,才渲染canvas,让标签云显现???
模板设计上的逻辑是 sidebar.swig 作为通用的模块,所有页面需要保持一致。这是正常行为。
建议,自行修改 if 判断。
好的,谢谢你
next 主题的话,看看修改 tag.swig 这个文件怎么样?这样的话应该只会在 tag 页面显示了。
这个我想过,试过并没有显示,还是增加一条判断语句实现的
Expected Behavior
按照操作,“hexo d”以后,在标签页就可以看到标签云了
Actual Behavior
但是,在其他页,比如about,categories等也会出现标签云,并且在标签页点击标签跳转以后,也会出现标签云
Steps to Reproduce the Problem
next/layout/_macro/sidebar.swig
内添加代码补充:tag canvas.js和tagcloud.js文件都已经导入,在public中也有(非手动导入)
Specifications
(The version of the project, operating system, hardware etc.) hexo: 3.7.0 hexo-cli: 1.1.0 os: Windows_NT 10.0.14393 win32 x64 http_parser: 2.7.0 node: 8.9.0 v8: 6.1.534.46 uv: 1.15.0 zlib: 1.2.11 ares: 1.10.1-DEV modules: 57 nghttp2: 1.25.0 openssl: 1.0.2l icu: 59.1 unicode: 9.0 cldr: 31.0.1 tz: 2017b