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

list-json.js)The theme you are using doesn't support "post" data. P lease set the data manually #18

Open jerryc127 opened 5 years ago

jerryc127 commented 5 years ago

Before you submit your issue, please tell me your environment info. Also , if you occur ERROR Plugin load failed: , please reinstall hexo and npm as follows, for example.

$ nvm install v6.10.1
$ nvm use v6.10.1
$ npm install -g npm
$ npm install -g hexo-cli
$ hexo init hexo6101
$ cd hexo6101
$ npm install
$ npm install hexo-related-popular-posts --save

Also , if you occur DTraceProviderBindings.node error , please see issue#1. https://github.com/tea3/hexo-related-popular-posts/issues/1

For BUG

For question

just push question

For feature request

just push feature request

Environment Info

OS version

Node version(node -v)

v6.10.1

Your site _config.yml

# Hexo Configuration
...

Your theme _config.yml

# Hexo Configuration
...

Plugin version(npm ls --depth 0)

hexo-vanilla-site@0.0.0 ~/hexo-vanilla-site
├── hexo@3.1.1
├── hexo-generator-archive@0.1.4
├── hexo-generator-category@0.1.3
├── hexo-generator-index@0.2.0
├── hexo-generator-tag@0.2.0
├── hexo-renderer-ejs@0.1.1
├── hexo-renderer-marked@0.2.10
├── hexo-renderer-stylus@0.3.1
└── hexo-server@0.1.3

[23:31:46.396] [hexo-related-popular-posts] error:  (list-json.js)The theme you are using doesn't support "post" data. P lease set the data manually. (e.g. <%- popular_posts( {} , post ) %> )                                                   For detail , please see this url.                                                                                        https://github.com/tea3/hexo-related-popular-posts/issues?utf8=%E2%9C%93&q=Cannot%20read%20property%20%27tags%27%20of%20 undefined                                                                                                                [23:31:46.500] [hexo-related-popular-posts] error:  (list-json.js)The theme you are using doesn't support "post" data. P lease set the data manually. (e.g. <%- popular_posts( {} , post ) %> )                                                   For detail , please see this url.                                                                                        https://github.com/tea3/hexo-related-popular-posts/issues?utf8=%E2%9C%93&q=Cannot%20read%20property%20%27tags%27%20of%20 undefined                                                                                                                [23:31:46.508] [hexo-related-popular-posts] error:  (list-json.js)The theme you are using doesn't support "post" data. P lease set the data manually. (e.g. <%- popular_posts( {} , post ) %> )                                                   For detail , please see this url.                                                                                        https://github.com/tea3/hexo-related-popular-posts/issues?utf8=%E2%9C%93&q=Cannot%20read%20property%20%27tags%27%20of%20 undefined                                                                                                                [23:31:46.515] [hexo-related-popular-posts] error:  (list-json.js)The theme you are using doesn't support "post" data. P lease set the data manually. (e.g. <%- popular_posts( {} , post ) %> )                                                   For detail , please see this url.                                                                                        https://github.com/tea3/hexo-related-popular-posts/issues?utf8=%E2%9C%93&q=Cannot%20read%20property%20%27tags%27%20of%20 undefined                                                                                                                [23:31:46.519] [hexo-related-popular-posts] error:  (list-json.js)The theme you are using doesn't support "post" data. P lease set the data manually. (e.g. <%- popular_posts( {} , post ) %> )                                                   For detail , please see this url.                                                                                        https://github.com/tea3/hexo-related-popular-posts/issues?utf8=%E2%9C%93&q=Cannot%20read%20property%20%27tags%27%20of%20 undefined                                                                                                                [23:31:46.540] [hexo-related-popular-posts] error:  (list-json.js)The theme you are using doesn't support "post" data. P lease set the data manually. (e.g. <%- popular_posts( {} , post ) %> )                                                   For detail , please see this url.                                                                                        https://github.com/tea3/hexo-related-popular-posts/issues?utf8=%E2%9C%93&q=Cannot%20read%20property%20%27tags%27%20of%20 undefined                                                                                                                [23:31:46.553] [hexo-related-popular-posts] error:  (list-json.js)The theme you are using doesn't support "post" data. P lease set the data manually. (e.g. <%- popular_posts( {} , post ) %> )                                                   For detail , please see this url.                                                                                        https://github.com/tea3/hexo-related-popular-posts/issues?utf8=%E2%9C%93&q=Cannot%20read%20property%20%27tags%27%20of%20 undefined
--

how to solve this problem?

tea3 commented 5 years ago

@jerryc127 What are you using the theme ? Some of the themes are out of support because they operate out of specification.

crezenity commented 5 years ago

Hey can you fix this plugin for this theme Matery Theme? There is no show up when i apply your code.. post content is HERE

gregor77 commented 4 years ago

@jerryc127

You might have noticed that the following message was printed. "(list-json.js)The theme you are using doesn't support "post" data. Please set the data manually. (e.g. <%- popular_posts( {} , post ) %> )"

popular_posts function is need to params (options and post). so you change code bellow in article.ejs file

-- before <%- popular_posts () %> -- to-be <%- popular_posts ({}, { post: post }) %>

you can check popular_posts function spec to node_modules/hexo-related-popular-posts/lib/helper.js