GeekaholicLin / hexo-theme-ylion

:blush: 说不定是一个让你感到惊喜的hexo主题 :beers: :candy:
http://blog.geekaholic.cn
MIT License
120 stars 30 forks source link

hexo g "color is required!" error #53

Closed mosdeo closed 6 years ago

mosdeo commented 6 years ago

hexo g 每一篇文章會出現如下錯誤

ERROR /home/LKY/mosdeo_github_io/themes/ylion/layout/layout.ejs:7
    5|     <%- partial('_partial/header') %>
    6|     <div id="container">
 >> 7|         <%- partial('_partial/sidebar', null, {cache: !config.relative_link}) %>
    8|         <%- body %>
    9|     </div>
    10|     <%- partial('_partial/footer', null, {cache: !config.relative_link}) %>

/home/LKY/mosdeo_github_io/themes/ylion/layout/_partial/sidebar.ejs:4
    2| <ul id="sidebar">
    3|     <% theme.widgets.forEach(function(widget){ %>
 >> 4|     <%- partial('_widget/' + widget) %>
    5|     <% }) %>
    6| </ul>
    7| 

/home/LKY/mosdeo_github_io/themes/ylion/layout/_widget/tagcloud.ejs:6
    4|   <div class="tagcloud-content">
    5|     <% var tagcloud_config = theme.tagcloud_config;%>
 >> 6|       <%-tagcloud({
    7|           min_font: tagcloud_config.min_font,
    8|           max_font: tagcloud_config.max_font,
    9|           unit: tagcloud_config.unit,

color is required!
TypeError: /home/LKY/mosdeo_github_io/themes/ylion/layout/layout.ejs:7
    5|     <%- partial('_partial/header') %>
    6|     <div id="container">
 >> 7|         <%- partial('_partial/sidebar', null, {cache: !config.relative_link}) %>
    8|         <%- body %>
    9|     </div>
    10|     <%- partial('_partial/footer', null, {cache: !config.relative_link}) %>

/home/LKY/mosdeo_github_io/themes/ylion/layout/_partial/sidebar.ejs:4
    2| <ul id="sidebar">
    3|     <% theme.widgets.forEach(function(widget){ %>
 >> 4|     <%- partial('_widget/' + widget) %>
    5|     <% }) %>
    6| </ul>
    7| 

/home/LKY/mosdeo_github_io/themes/ylion/layout/_widget/tagcloud.ejs:6
    4|   <div class="tagcloud-content">
    5|     <% var tagcloud_config = theme.tagcloud_config;%>
 >> 6|       <%-tagcloud({
    7|           min_font: tagcloud_config.min_font,
    8|           max_font: tagcloud_config.max_font,
    9|           unit: tagcloud_config.unit,

color is required!
    at new Color (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/plugins/helper/tagcloud.js:241:11)
    at Object.tagcloudHelper (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/plugins/helper/tagcloud.js:182:18)
    at Object.wrapper [as tagcloud] (/home/LKY/mosdeo_github_io/node_modules/lodash/lodash.js:4941:19)
    at eval (eval at compile (/home/LKY/mosdeo_github_io/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:584:12), <anonymous>:18:16)
    at returnedFn (/home/LKY/mosdeo_github_io/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:615:17)
    at Theme._View.View._compiledSync.locals [as _compiledSync] (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/theme/view.js:120:22)
    at Theme._View.View.View.renderSync (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/theme/view.js:48:23)
    at Object.partial (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/plugins/helper/partial.js:39:15)
    at Object.wrapper [as partial] (/home/LKY/mosdeo_github_io/node_modules/lodash/lodash.js:4941:19)
    at eval (eval at compile (/home/LKY/mosdeo_github_io/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:584:12), <anonymous>:15:17)
    at Array.forEach (<anonymous>)
    at eval (eval at compile (/home/LKY/mosdeo_github_io/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:584:12), <anonymous>:12:22)
    at returnedFn (/home/LKY/mosdeo_github_io/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:615:17)
    at Theme._View.View._compiledSync.locals [as _compiledSync] (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/theme/view.js:120:22)
    at Theme._View.View.View.renderSync (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/theme/view.js:48:23)
    at fragment_cache (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/plugins/helper/partial.js:36:52)
    at Object.fragmentCache (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/plugins/helper/fragment_cache.js:9:32)
    at Object.wrapper [as fragment_cache] (/home/LKY/mosdeo_github_io/node_modules/lodash/lodash.js:4941:19)
    at Object.partial (/home/LKY/mosdeo_github_io/node_modules/hexo/lib/plugins/helper/partial.js:36:17)
    at Object.wrapper [as partial] (/home/LKY/mosdeo_github_io/node_modules/lodash/lodash.js:4941:19)
    at eval (eval at compile (/home/LKY/mosdeo_github_io/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:584:12), <anonymous>:21:17)
    at returnedFn (/home/LKY/mosdeo_github_io/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:615:17)

看起來應該是 _config.yml 裡面的 tagcloud_config 區塊有錯,不過這邊我都沒動過,都照你原版的。也做過 YAML check 通過。所以想不到還有哪裡可能出錯?

GeekaholicLin commented 6 years ago

@mosdeo 方便放一下你的yaml配置文件?

mosdeo commented 6 years ago

https://gist.github.com/mosdeo/d4e2b2cb862202fa72baaba587c892c7

GeekaholicLin commented 6 years ago

目测漏了一个start_color,你可以加上看看?

mosdeo commented 6 years ago

搞定了。應該是我不小心手殘刪到那一行,感謝大大幫 debug。