fluid-dev / hexo-theme-fluid

:ocean: 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo
https://hexo.fluid-dev.com/
GNU General Public License v3.0
7.25k stars 1.13k forks source link

配置关于页图标出现的问题 #304

Closed DogeLasVegas closed 4 years ago

DogeLasVegas commented 4 years ago

请确认

问题描述

当我把关于页配置下面的icon全部注释掉之后会报错,页面也打不开,但是如果保留一个icon就不会报错。 配置内容如下:

icons: # 更多图标可从 https://hexo.fluid-dev.com/docs/icon/ 查找,class 代表图标的 css class
    # - { class: 'iconfont icon-github-fill', link: 'https://github.com', tip: 'GitHub' }
    # - { class: 'iconfont icon-douban-fill', link: 'https://douban.com', tip: '豆瓣' }
    # - { class: 'iconfont icon-wechat-fill', qrcode: '/img/favicon.png' }  # 添加 qrcode 后,点击不再跳转,而是悬浮二维码,需要指定 image

报错信息:

theme.about.icons is not iterable
    at eval (G:\temp\hexo-blog-source\themes\fluid\layout\about.ejs:25:38)
    at about (G:\temp\hexo-blog-source\node_modules\ejs\lib\ejs.js:682:17)
    at viewFn._compiled (G:\temp\hexo-blog-source\node_modules\hexo\lib\theme\view.js:136:48)
    at viewFn.View.render (G:\temp\hexo-blog-source\node_modules\hexo\lib\theme\view.js:41:15)
    at G:\temp\hexo-blog-source\node_modules\hexo\lib\hexo\index.js:61:21
    at tryCatcher (G:\temp\hexo-blog-source\node_modules\bluebird\js\release\util.js:16:23)
    at G:\temp\hexo-blog-source\node_modules\bluebird\js\release\method.js:15:34
    at RouteStream._read (G:\temp\hexo-blog-source\node_modules\hexo\lib\hexo\router.js:126:3)
    at RouteStream.Readable.read (_stream_readable.js:468:10)
    at resume_ (_stream_readable.js:982:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Unhandled rejection TypeError: G:\temp\hexo-blog-source\themes\fluid\layout\about.ejs:15
    13|     <div class="about-intro"><%- theme.about.introduce %></div>
    14|     <div class="about-icons">
 >> 15|       <% for(const each of theme.about.icons) { %>
    16|         <% if (!each.class) continue; %>
    17|         <% var cls = each.class %>
    18|         <% var isQr = each.qrcode %>

theme.about.icons is not iterable
    at eval (G:\temp\hexo-blog-source\themes\fluid\layout\about.ejs:25:38)
    at about (G:\temp\hexo-blog-source\node_modules\ejs\lib\ejs.js:682:17)
    at viewFn._compiled (G:\temp\hexo-blog-source\node_modules\hexo\lib\theme\view.js:136:48)
    at viewFn.View.render (G:\temp\hexo-blog-source\node_modules\hexo\lib\theme\view.js:41:15)
    at G:\temp\hexo-blog-source\node_modules\hexo\lib\hexo\index.js:61:21
    at tryCatcher (G:\temp\hexo-blog-source\node_modules\bluebird\js\release\util.js:16:23)
    at G:\temp\hexo-blog-source\node_modules\bluebird\js\release\method.js:15:34
    at RouteStream._read (G:\temp\hexo-blog-source\node_modules\hexo\lib\hexo\router.js:126:3)
    at RouteStream.Readable.read (_stream_readable.js:468:10)
    at resume_ (_stream_readable.js:982:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

尝试过clean并generate,但并不起作用,并且在hexo g #的时候也会报错,报错信息与前面相同,我在另一个已经关闭的issue #154 也看到了相同的问题,他的解决办法也是保留一个icon,但我现在并不想保留任何icon,求教其他解决办法,谢谢。

zkqiang commented 4 years ago

可以先写成 icon: [] 报错下个版本修复

DogeLasVegas commented 4 years ago

可以先写成 icon: [] 报错下个版本修复

好的,谢谢

haozhenHG commented 1 month ago

你好,请问我的二维码{ class: "iconfont icon-wechat-fill", qrcode: "/img/wechat.png" }和关于页面的头像 avatar: /img/lufei.png设置了没有显示出来 是什么原因呢?