-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Feature: related posts, according to #67 #109
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide i18n for Related Posts field.
padding: 0; | ||
|
||
&:before { | ||
content: hexo-config('related_posts.title') || 'Related Posts'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to provide i18n
for the Related Posts(ie. Related Posts -> 相关文章 in language zh-CN
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i think so too.
@tsanie there are similar issues:
|
…home page, and add support to i18n.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a switch related_posts.display_in_home
to determine whether related posts will be shown in the home page.
And a language item post.related_posts
, need to sync to crowdin and translate it.
Live demo updated: https://tsanie.us (the configure related_posts.display_in_home
is setting to false, now it will be only shown in the post page)
margin-left: 2em; | ||
.popular-posts-title { | ||
display: block; | ||
h3 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
H3 here? And if will seo
false and then main title will H1 and no headers will used — H1-H3 space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivan-nginx It is generated by the plugin (https://github.com/theme-next/hexo-theme-next/pull/109/files#diff-0e030eb6dd7b9d25bfcba06bc8ea5609R337), otherwise, do we need to custom the template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
H3 in the bottom bad for SEO. For example, if SEO
will true
and we will have:
H1 (site_subtitle)
H2 (title)
H3
H4
H5
H3
H4
H3 (related_posts)
It's already fine with SEO. But if SEO
false
, then we can get fine result:
H1 (title)
H2
H3 (related_posts)
But we also may get bad result:
H1 (title)
???
H3 (related_posts)
So, with SEO
disabled & releated_posts
enabled user can totally break his seo.
Headers can go forward only seriatim. And can go back with any new position (header reseting). They can't go forward bigger then 1 or more step (e.g. H4 header and after H6).
hexo-theme-next/source/css/_schemes/Gemini/index.styl
Lines 131 to 160 in 82ac7af
.post-body { | |
h1 { | |
font-size: 1.6em; | |
border-bottom: 1px solid $body-bg-color; | |
} | |
h2 { | |
font-size: 1.45em; | |
border-bottom: 1px solid $body-bg-color; | |
} | |
h3 { | |
font-size: 1.3em; | |
if use_seo { | |
border-bottom: 1px solid $body-bg-color; | |
} else { | |
border-bottom: 1px dotted $body-bg-color; | |
} | |
} | |
h4 { | |
font-size: 1.2em; | |
if use_seo { | |
border-bottom: 1px dotted $body-bg-color; | |
} | |
} | |
h5 { | |
font-size: 1.07em; | |
} | |
h6 { | |
font-size: 1.03em; | |
} | |
} |
@@ -332,6 +332,30 @@ | |||
{{ post.content }} | |||
{% endif %} | |||
</div> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So many for now. oO Mb move to external swig
file?
Like post-copyright.swig
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivan-nginx OK, seems now it need to be move to the single file.
use the custom template to generate the output, removal the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is fine.
Except for the i18n
translations, we could use the crowdin to fix it.
|
@sli1989 Of course, need to follow the dependencies described in the _config.yml |
Feature: related posts, according to theme-next#67
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Not an issue but according to the feature in roadmap.
By using the hexo-related-popular-posts that mentioned in the iissnan/hexo-theme-next#1130
Issue Number(s): #67
What is the new behavior?
When the user have enable the feature, the related posts will be shown in the bottom of the post.
Screens with this changes:
Link to demo site with this changes: https://tsanie.us/2018/01/07/replace-destiny-child-character-next/
How to use?
In NexT
_config.yml
:Does this PR introduce a breaking change?