配置Hexo主题之Melody

遇到问题

使用Hexo的data file特性新建Melody主题的melody.yml配置文件后,
将个人博客部署到本地,输入本地URL后,浏览器没有响应,提示代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Unhandled rejection TypeError: /home/hgneer/Hexo/themes/melody/layout/includes/layout.pug:31
29| each url in theme.stylesheets
30| link(rel='stylesheet', href=url_for(url) + '?version=' + version())
> 31| each item in theme.cdn.css
32| if item !== undefined
33| link(rel='stylesheet', href=item + '?version=' + version())
34| include ./head.pug

Cannot read property 'css' of undefined
at eval (eval at wrap (/home/hgneer/Hexo/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:80:25)
at eval (eval at wrap (/home/hgneer/Hexo/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:102:4)
at template (eval at wrap (/home/hgneer/Hexo/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:1657:72)
at Theme._View.View._compiled.locals [as _compiled] (/home/hgneer/Hexo/node_modules/hexo/lib/theme/view.js:125:48)
at Theme._View.View.View.render (/home/hgneer/Hexo/node_modules/hexo/lib/theme/view.js:30:15)
at route.set (/home/hgneer/Hexo/node_modules/hexo/lib/hexo/index.js:394:29)
at tryCatcher (/home/hgneer/Hexo/node_modules/bluebird/js/release/util.js:16:23)
at /home/hgneer/Hexo/node_modules/bluebird/js/release/method.js:15:34
at RouteStream._read (/home/hgneer/Hexo/node_modules/hexo/lib/hexo/router.js:134:3)
at RouteStream.Readable.read (_stream_readable.js:452:10)
at resume_ (_stream_readable.js:899:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

解决办法

需要复制到Hexo/source/_data下的_config.yml是melody主题目录下的而非Hexo目录下的。

待用特性

  • Slide页面(利用reveal.js)
  • 相册页面
文章作者: 红发
文章链接: https://AIpynux.github.io/2019/02/03/配置Hexo主题之Melody/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 红发