tea3 / hexo-related-popular-posts

A hexo plugin that generates a list of links to related posts and popular posts. Also , this plugin can get Visitor Counts (PV) on posts.
MIT License
109 stars 14 forks source link

one problem with Next theme #16

Closed chinobing closed 5 years ago

chinobing commented 5 years ago

I am using Next theme with your plugin and it works like a charm with your method. But the problem is the popular posts almost show up on the homepage followed with every singe post. How can I remove it? here is my blog: https://www.cnvar.cn/

@myjeshurun I tried this plugin in the hexo-theme-next. hexo-theme-next and Swig seems to be a special case. In the new plug-in version, it have supported to hexo-theme-next. Please update this plugin and add the following code to the template.

  1. Update version
$ npm uninstall hexo-related-popular-posts --save
$ npm install hexo-related-popular-posts --save
  1. Add code

For example , Add popular_posts( {} , post ) to the following location. https://github.com/iissnan/hexo-theme-next/blob/master/layout/_macro/post.swig#L313

...
</div>

{{ popular_posts( {} , post ) }}

{#####################}
{### END POST BODY ###}
{#####################}
...

Please tell me whether this issue can be solved .

Originally posted by @tea3 in https://github.com/tea3/hexo-related-popular-posts/issues/4#issuecomment-320916516