Closed 9monsters closed 5 years ago
@yunsu2 Thank you for report me in detail. Sonrry , I tried to occur same problem. but it did'nt occur. The environment I tried is as follows.
$ nvm install v9.4.0
$ nvm use v9.4.0
$ npm install hexo-cli
$ hexo new hexo94
$ cd hexo94
$ npm uninstall hexo --save
$ npm install hexo@3.4.4 --save
$ npm install hexo-related-popular-posts --save
$ git clone https://github.com/MOxFIVE/hexo-theme-yelee.git themes/yelee
Next , I edited theme (article.ejs) as follows.
<article id="<%= post.layout %>-<%= post.slug %>" class="article article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<%if(post.noDate != "true"){%>
<div class="article-meta">
<%- partial('post/date', {class_name: 'article-date', date_format: null}) %>
</div>
<%}%>
<div class="article-inner">
<% if (theme.fancybox){ %>
<input type="hidden" class="isFancy" />
<% } %>
<% if (post.link || post.title){ %>
<header class="article-header">
<%- partial('post/title', {class_name: 'article-title'}) %>
</header>
<% if (!index){ %>
<div class="article-info article-info-post">
<%- partial('post/category') %>
<%- partial('post/tag') %>
<div class="clearfix"></div>
</div>
<% } %>
<% } %>
<div class="article-entry" itemprop="articleBody">
<% if (index && (post.description || post.excerpt)){ %>
<% if (post.description){ %>
<%- post.description %>
<% } else { %>
<%- post.excerpt %>
<% } %>
<% } else { %>
<% if (is_page()){ %>
<%- partial('_partial/page') %>
<% } %>
<%- post.content %>
<% } %>
</div>
<!-- I added plugin's code as follows -->
<div>
<%-
popular_posts( {} , post )
%>
</div>
<% if (index){ %>
<div class="article-info article-info-index">
<%if(post.top){%>
<div class="article-pop-out tagcloud">
<a class="">置顶</a>
</div>
<% } %>
<%- partial('post/category') %>
<%- partial('post/tag') %>
<% if (index && (post.description || post.excerpt)){ %>
<p class="article-more-link">
<a href="<%- url_for(post.path) %>#more"><%= __('index.more') %> >></a>
</p>
<% } %>
<div class="clearfix"></div>
</div>
<% } %>
</div>
<% if (!index){ %>
<%- partial('post/nav') %>
<% } %>
</article>
<%- partial('_partial/toc') %>
<% if (!index && theme.share.on && (post.share != false || post.share)){ %>
<%- partial('post/share') %>
<% } %>
<% if (!index && post.comments){ %>
<% if (theme.duoshuo.on) { %>
<%- partial('comments/duoshuo', {
key: post.path,
title: post.title,
url: config.url+url_for(post.path),
}) %>
<% } else if (theme.youyan.on) { %>
<%- partial('comments/youyan') %>
<% } else if (theme.disqus.on) { %>
<%- partial('comments/disqus', {
shortname: theme.disqus.shortname
}) %>
<% } else if (config.disqus_shortname) { %>
<%- partial('comments/disqus', {
shortname: config.disqus_shortname
}) %>
<% } %>
<% } %>
<%- partial('_partial/post-nav-button') %>
<% if (!index) { %>
<script>
<% if (post.fancybox === false){ %>
yiliaConfig.fancybox = false;
<% } %>
</script>
<% } %>
Finally , I created a new article or edited else article.
I'll take a closer look at it. Can you recover with the next command for the time being ?
$ hexo clean
$ hexo s
Also , errors occurred in the following position. https://github.com/tea3/hexo-related-popular-posts/blob/master/lib/collector.js#L192
If errors occur, please tell me the detailed information with the following code.
console.log(`gaData[i]:`)
console.log(gaData[i])
console.log(`post:`)
console.log(post)
Thank you, I check my config and done well
For BUG
BUG description when this bug occured, the page was not render again, only stop
Ctrl + c
and rerunhexo s
the way to reproduce when use
hexo s
and any article was updated, what the console print as below.log with hexo
Environment Info
OS version
Node version(
node -v
)Your site
_config.yml
Your theme
_config.yml
Plugin version(
npm ls --depth 0
)