amehime / hexo-theme-shoka

Just For https://shoka.lostyu.me/
MIT License
849 stars 200 forks source link

(已解决)网页显示内容极其残缺,请问大神们这是怎么一回事 #95

Open ZhugeJunyao opened 1 year ago

ZhugeJunyao commented 1 year ago

如下图所示,我的网页搭建完后极其残缺。有谁知道是怎么回事吗? image 报错情况在下面


INFO  minify the html: index.html [ 15.93% saved]
ERROR Asset render failed: css/app.css
TypeError: D:/hexo_web/hexo/hexo/blog/themes/shoka/source/css/_common/outline/sidebar/social.styl:45:44
   41|
   42|     $social = hexo-config('social');
   43|
   44|     for type in $social {
   45|       for i in split(" || ", slice(type, 1)) {
--------------------------------------------------^
   46|           color = slice(i, 1, -1)
   47|       }
   48|

Cannot read properties of undefined (reading 'split')
    at ".item " (D:/hexo_web/hexo/hexo/blog/themes/shoka/source/css/_common/outline/sidebar/social.styl:4:22)
    at ".social " (D:/hexo_web/hexo/hexo/blog/themes/shoka/source/css/_common/outline/sidebar/social.styl:64:2)

    at Evaluator.split (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\functions\index.js:1088:33)
    at Evaluator.invokeBuiltin (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:1033:30)
    at Evaluator.visitCall (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:498:16)
    at Visitor.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\index.js:28:40)
    at Evaluator.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:153:18)
    at Evaluator.visitExpression (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:626:26)
    at Visitor.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\index.js:28:40)
    at Evaluator.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:153:18)
    at Evaluator.visitEach (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:398:32)
    at Visitor.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\index.js:28:40)
    at Evaluator.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:153:18)
    at Evaluator.visitBlock (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:702:39)
    at Visitor.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\index.js:28:40)
    at Evaluator.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:153:18)
    at visitBody (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:415:17)
    at Evaluator.visitEach (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:431:7)
    at Visitor.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\index.js:28:40)
    at Evaluator.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:153:18)
    at Evaluator.visitBlock (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:702:39)
    at Visitor.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\index.js:28:40)
    at Evaluator.visit (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:153:18)
    at Evaluator.visitGroup (D:\hexo_web\hexo\hexo\blog\node_modules\stylus\lib\visitor\evaluator.js:243:22)
llxlr commented 1 year ago

social这个应该是没配置对,看主题example目录下的示例yaml。为什么残缺,不知道,因人而异,可能有啥地方没配好。

ZhugeJunyao commented 1 year ago

social这个应该是没配置对,看主题example目录下的示例yaml。为什么残缺,不知道,因人而异,可能有啥地方没配好。

感谢你的提示,确实是没配置好,最关键的点在于themes/shoka下的_config.yml里的menu那一栏没有取消注释。其实很早就看到了你的提示,想着解决完全部bug再回复,但是一个新的bug却让我困扰了很久。现在在localhost中能正常显示图片,但是当我上传到我的githubpages时,图片却无法显示,想问问您知道怎么解决吗?再次向您表示感谢。 local时: image 上传到网页时: image

ZhugeJunyao commented 1 year ago

问题已解决,我发现在我上传了其他博客以后,网站上的全部图片都能够正常显示了。