文章目录
  1. 1. 问:hexo-tag-googlecharts失效怎么办?
  2. 2. 答:
    1. 2.1. 修改index.js
    2. 2.2. 范例的markdown部分
    3. 2.3. 注意事项

问:hexo-tag-googlecharts失效怎么办?

答:

插件未充分考虑加载不同图表的需要,例如,不能正常处理WordTree的显示。以下为安装插件后的手工修改过程。

修改index.js

进入博客目录下的node_modules\hexo-tag-googlecharts,在index.js中寻找代码: deps: ['corechart', 'geochart', 'table'], 根据实际使用的图表类型进行修改,如需WordTree图表,代码应相应修改为: deps: ['corechart', 'geochart', 'table', 'wordtree'],

范例的markdown部分

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{% googlecharts WordTree 600 500 %}
WordTree Example
{"wordtree": {"format": "implicit", "word": "cats"}}
'Phrases'
'cats are better than dogs'
'cats eat kibble'
'cats are better than hamsters'
'cats are awesome'
'cats are people too'
'cats eat mice'
'cats meowing'
'cats in the cradle'
'cats eat mice'
'cats in the cradle lyrics'
'cats eat kibble'
'cats for adoption'
'cats are family'
'cats eat mice'
'cats are better than kittens'
'cats are evil'
'cats are weird'
'cats eat mice'
{% endgooglecharts %}

注意事项

各行都不能有前置空格;图表类型(此处为WordTree)区分大小写,正确写法应仔细对照google给出的范例

返回
扫描最下方二维码关注“鸟儿问答”

文章目录
  1. 1. 问:hexo-tag-googlecharts失效怎么办?
  2. 2. 答:
    1. 2.1. 修改index.js
    2. 2.2. 范例的markdown部分
    3. 2.3. 注意事项