A bug about scroll_to_more feature in Chinese environment
I agree and want to create new issue
- [X] Yes, I was on Hexo Docs page, especially on Templates, Variables, Helpers and Troubleshooting.
- [X] Yes, I was on NexT Documentation Site.
- [X] And yes, I already searched for current issues and this is not help to me.
Expected behavior
When set the scroll_to_more to true in next's _config.yml, it was expected to automatically scroll page to section which is under <!-- more --> mark when clicked the read more button of a post on index page.
Actual behavior
In fact, this feature works well in english environment (when I set my hexo language to en). But when I set my hexo language to chinese, it just won't work. It always starts the page from the top rather than the section under <!-- more --> mark.
Steps to reproduce the behavior
- Set the hexo language to Chinese in hexo's _config.yml
- Set the scroll_to_more to true in next's _config.yml
- Add a <!-- more --> tag in the post
- Run the server. Click the post's Read more button on index page, and you will find out that this feature does not function
In fact, I've already found a workaround, here is my solution: Set the attribute "more: 更多" to "more: more" in the Chinese language file would fix the problem. But I believe this is not what the designer meant to be.
As far as I see, the problem may caused by:
the html anchor on the post page is #more, but the js code to scroll to the anchor is:
bookmark.scrollToMark('auto', "#更多");
it's doesn't match the anchor, so it won't get scrolled.
when I change the attribute "more: 更多" to "more: more" in the Chinese language file, the js code becomes:
bookmark.scrollToMark('auto', "#more");
this time the anchor matchs, so it's works well.
Hope this helps 😄
At last, thank you guys for such a great theme, I've been enjoyed it a lot.
- Link to demo site with this issue:
- Link(s) to source code or any usefull link(s): N/A
Node.js and NPM Information
Package dependencies Information
Hexo Information
Hexo version
Hexo Configuration
NexT Information
NexT Version:
- [X] Latest Master branch
- [ ] Latest Release version
- [ ] Old version
NexT Scheme:
- [ ] All schemes
- [ ] Muse
- [ ] Mist
- [ ] Pisces
- [X] Gemini
NexT Configuration:
Other Information
@Devtunes can u confirm what #226 is releated issue?
Fixed in #293
This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.