jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
6.82k stars 1.24k forks source link

fix: string inject html error #1391

Closed imba97 closed 8 months ago

imba97 commented 8 months ago

修复字符串类型 inject html 的报错

data.join is not a function
Snipaste_2023-10-13_23-09-23
jerryc127 commented 8 months ago

你是不是这样写了?

head; xxxxx bottom: xxxx

主题本来就不支持这种写法

imba97 commented 8 months ago

@jerryc127 我是整个写成了个字符串

inject:
  head: '
    <style>
    /* ... */
    </style>
  '

  bottom: '
    <script>
    // ...
    </script>
  '

得改成数组形式的吗,支持字符串也可以吧我感觉

而且比较奇怪的的是,我配置是同步 git 的,同样的配置一台电脑不报错,一台报错

jerryc127 commented 8 months ago

只支持

head:
  - xxx
  - xxxx

这种格式

imba97 commented 8 months ago

@jerryc127 考虑支持 string 吗,也没坏处

jerryc127 commented 8 months ago

@jerryc127 考虑支持 string 吗,也没坏处

不考虑了 既然一早就是不支持 string 那就按规定来 不然这个配置要改支持string 那个配置要支持 string 结果就是主题里一堆要判断

imba97 commented 8 months ago

@jerryc127 好嘞