D0n9X1n / hexo-tag-cloud

Yet, just another tag cloud plugin for hexo.
https://www.npmjs.com/package/hexo-tag-cloud
MIT License
147 stars 27 forks source link

非标签页也会出现标签云 #16

Closed richardmyu closed 6 years ago

richardmyu commented 6 years ago

Expected Behavior

按照操作,“hexo d”以后,在标签页就可以看到标签云了

Actual Behavior

但是,在其他页,比如about,categories等也会出现标签云,并且在标签页点击标签跳转以后,也会出现标签云

Steps to Reproduce the Problem

  1. npm install --save hexo-tag-cloud
  2. next/layout/_macro/sidebar.swig内添加代码
  3. hexo cl;hexo g;hexo s,等到标签页出现标签云时,同时也发现了上述问题

补充: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

richardmyu commented 6 years ago

我想,是不是可以在if里面再添加一个判断条件,即只有在有标签和当前页为标签页时,才渲染canvas,让标签云显现???

D0n9X1n commented 6 years ago

模板设计上的逻辑是 sidebar.swig 作为通用的模块,所有页面需要保持一致。这是正常行为。

建议,自行修改 if 判断。

richardmyu commented 6 years ago

好的,谢谢你

D0n9X1n commented 6 years ago

next 主题的话,看看修改 tag.swig 这个文件怎么样?这样的话应该只会在 tag 页面显示了。

richardmyu commented 6 years ago

这个我想过,试过并没有显示,还是增加一条判断语句实现的