hexo-theme-next icon indicating copy to clipboard operation
hexo-theme-next copied to clipboard

A bug about scroll_to_more feature in Chinese environment

Open hyperscalar opened this issue 8 years ago • 3 comments

I agree and want to create new issue


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

  1. Set the hexo language to Chinese in hexo's _config.yml
  2. Set the scroll_to_more to true in next's _config.yml
  3. Add a <!-- more --> tag in the post
  4. 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

hyperscalar avatar Apr 29 '18 16:04 hyperscalar

@Devtunes can u confirm what #226 is releated issue?

ivan-nginx avatar Apr 29 '18 16:04 ivan-nginx

Fixed in #293

sli1989 avatar May 15 '18 10:05 sli1989

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.

lock[bot] avatar Mar 27 '20 08:03 lock[bot]