Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装插件以后,必须要有一篇文章top: true #3

Closed
lyh543 opened this issue Jun 24, 2019 · 1 comment
Closed

安装插件以后,必须要有一篇文章top: true #3

lyh543 opened this issue Jun 24, 2019 · 1 comment

Comments

@lyh543
Copy link

lyh543 commented Jun 24, 2019

如题,安装了插件以后,如果没有文章是top: true的,在hexo g时就会报错。

$ hexo g && hexo s
INFO  Start processing
INFO  Files loaded in 38 s
INFO  Deleted: categories/博客/index.html
INFO  Deleted: tags/HEXO/index.html
INFO  Deleted: tags/NPM/index.html
INFO  Deleted: tags/MARKDOWN/index.html
ERROR /mnt/c/Users/lyh/OneDrive/lyh543.github.io/themes/material/layout/index.ejs:13
    11|     <% if(typeof hasposttop === 'function') { %>
    12|         <% if(hasposttop(site.posts)) { %>
 >> 13|             <% getposttop(site.posts).each(function(toppost){ %>
    14|                 <% if(theme.scheme === 'Paradox'){ %>
    15|                     <!-- Paradox Thumbnail -->
    16|                     <%- partial('_partial/Paradox-post_entry', { post: toppost, index: true, pin: true }) %>

Cannot read property 'each' of null
TypeError: /mnt/c/Users/lyh/OneDrive/lyh543.github.io/themes/material/layout/index.ejs:13
    11|     <% if(typeof hasposttop === 'function') { %>
    12|         <% if(hasposttop(site.posts)) { %>
 >> 13|             <% getposttop(site.posts).each(function(toppost){ %>
    14|                 <% if(theme.scheme === 'Paradox'){ %>
    15|                     <!-- Paradox Thumbnail -->
    16|                     <%- partial('_partial/Paradox-post_entry', { post: toppost, index: true, pin: true }) %>

Cannot read property 'each' of null

目前临时解决办法是在不需要该插件的时候就删除该插件。

(当然这个小bug也可以不用修复)

@stevenjoezhang
Copy link

hexo-generator-index 已支持文章置顶: hexojs/hexo-generator-index#51

@lyh543 lyh543 closed this as completed Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants