MOxFIVE / hexo-theme-yelee

简而不减 Hexo 双栏博客主题; Another simple and elegant theme for Hexo.
http://moxfive.xyz/
1.38k stars 328 forks source link

在所有文章列表中有文章,但是首页确不显示 #206

Open heartinfei opened 7 years ago

heartinfei commented 7 years ago

建议阅读:在 Stack Overflow 提问的检查表 Recommended Reading: STACK OVERFLOW QUESTION CHECKLIST

Mondobongoo commented 7 years ago

我也是这样,不知道为什么首页什么文章都显示不出来

Gabrielkaliboy commented 7 years ago

最近更新博客,也有这个问题,原来没有这毛病啊

kinoko3 commented 7 years ago

我找了一下,发现是layout/_partial/head.ejs中的这段代码的search: <%= theme.search.on %>定义有问题

<script>
    var yiliaConfig = {
        fancybox: <%=theme.fancybox%>,
        animate: <%=theme.animate%>,
        isHome: <%=is_home()%>,
        isPost: <%=is_post()%>,
        isArchive: <%=is_archive()%>,
        isTag: <%=is_tag()%>,
        isCategory: <%=is_category()%>,
        fancybox_js: "<%- theme.CDN.fancybox_js %>",
        scrollreveal: "<%- theme.CDN.scrollreveal %>",
        search: <%= theme.search.on %>
    }
</script>

而在_config.xml的默认设置是search:onload:false,这里写的是onload而不是on,导致Uncaught ReferenceError: yiliaConfig is not defined,把两边的变量名改成一样就可以了,比如_config.xml里面的search:onload false改成search:on false,这样就正常运行了

gaoyanliang commented 6 years ago

请问一下,为什么我的鸟屋没起作用?

ZhuoyaYang commented 6 years ago

@gyl-coder 在_config.xml 里 search:onload false改成search:on false