Closed xaoxuu closed 3 years ago
@xaoxuu
Please specify eyeCatchImage
and description in frontmatter of markdown file. It is explained in detail issue #13.
Please see the follow about frontmatter. https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#customize-html
Can I change the eyeCatchImage
attribute in the blog's _config.yml
? Because the theme already uses other attributes, I have to duplicate the image link.
headimg: https://gitee.com/xaoxuu/cdn-assets/raw/master/blog/2019-0827a@2x.jpg
eyeCatchImage: https://gitee.com/xaoxuu/cdn-assets/raw/master/blog/2019-0827a@2x.jpg
This attribute may be different in different themes, such as header_img:
or cover_img:
...
It would be great if it can be customized. π
@xaoxuu
I'm sorry. It cannot be specified in _config.xml
. This attribute is a value specified for each article.
https://github.com/tea3/hexo-related-popular-posts/issues/13#issuecomment-430496487
What I mean is, allow users to change eyeCatchImage
to other attribute names to suit the user's hexo theme, for example:
Edit in blog/_config.yml
:
popularPosts:
eyeCatchImageAttributeName: themeHeaderImage
So users can write in front-matter like this:
---
title: xxx
themeHeaderImage: https://xxx.png
---
Instead of having to write both:
---
title: xxx
themeHeaderImage: https://xxx.png
eyeCatchImage: https://xxx.png
---
@xaoxuu
I see. Actually , this plugin supports the postImage
and ampSettings
attributes in addition to eyeCatchImage
. Can't be customized, but can these attributes use?
https://github.com/tea3/hexo-related-popular-posts/blob/5f782be6d13008eedd862049689df0a014dbfdb3/lib/collector.js#L50
I submitted a pr about this, you can see if it works.
@xaoxuu Thank you for suggestion. I want to merge tonight or tomorrow. Please wait for ππ»
Thank you π€
Hello, I found that the
img
obtained byhexo-related-popular-posts
can only be automatically read from within the article. May I ask you to add a configuration item according to one of the front-matter How about a custom value such asheadimg
as the summary image of the article?For example, in "Article 1", the header image of "Article 2" is not perfect. What we want is A, but actually B: