Skip to content
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

Bookmark feature #63

Merged
merged 2 commits into from
Jan 21, 2018
Merged

Bookmark feature #63

merged 2 commits into from
Jan 21, 2018

Conversation

tsanie
Copy link
Contributor

@tsanie tsanie commented Jan 21, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes have been added (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs have been added / updated (for bug fixes / features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the new behavior?

Bookmark is a plugin that allow the users save their reading position. (using window.localStorage)

The users could just click the bookmark icon (like 🔖) in left-top of the page to save the position.

And when they visit your blog in the next time, they can continue the last reading position by clicking the bookmark icon from the home page.

  • Screens with this changes:
    On the left-top of the page: image → mouse over → image

    When you click it:

    • In the post page: it will save the current scroll position of the current page. (If the bookmark.save have been set to 'auto', it is no need to manual click it.)

    • In the other page: it will take you to the last page you have read, and scroll to the last reading position.

    The icon will not appear in the mobile layout, but the function is well working: if you enter a page, the reading position will be automatically loaded.

  • Link to demo site with this changes: https://tsanie.us

How to use?

In NexT _config.yml:

bookmark:
  enable: true
  save: auto # or manual

Does this PR introduce a breaking change?

  • Yes.
  • No.

@ivan-nginx ivan-nginx added this to the v6.0.3 milestone Jan 21, 2018
@ivan-nginx ivan-nginx merged commit 613370d into theme-next:master Jan 21, 2018
@tsanie tsanie deleted the bookmark-feature branch January 21, 2018 05:10
@sli1989
Copy link
Collaborator

sli1989 commented Jan 21, 2018

May I ask what's the difference between bookmark and save_scroll: true?

@tsanie
Copy link
Contributor Author

tsanie commented Jan 21, 2018

@sli1989 feature acts the same thing. There is a little difference between them such as localStorage/cookie, and allow you to choose auto or manual save the scroll position by click the bookmark icon.

@ivan-nginx
Copy link
Member

We talk about it with @tsanie and i think save_scroll will be removed in next versions.

@stevenjoezhang
Copy link
Contributor

save_scoll refactored in #1049
Now they both use localStorage and have almost the same feature.
Maybe we can combine these two plugins - or make bookmark a built-in component of NexT

tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants