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

Usage of back2top button #657

Merged
merged 6 commits into from
Mar 6, 2019
Merged

Usage of back2top button #657

merged 6 commits into from
Mar 6, 2019

Conversation

stevenjoezhang
Copy link
Contributor

@stevenjoezhang stevenjoezhang commented Mar 6, 2019

Breaking Change

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes was maked (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs in NexT website have been added / updated (for new 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 current behavior?

Issue resolved: N/A

What is the new behavior?

  • Screenshots with this changes: N/A
  • Link to demo site with this changes: N/A

How to use?

In NexT _config.yml:

sidebar:
-  # Back to top in sidebar.
-  b2t: false
-  # Scroll percent label in b2t button.
-  scrollpercent: false
+back2top:
+  enable: true
+  # Back to top in sidebar.
+  sidebar: false
+  # Scroll percent label in b2t button.
+  scrollpercent: false

Does this PR introduce a breaking change?

  • Yes.
  • No.

@@ -5,7 +5,7 @@
@import "pagination";
@import "comments";
@import "tag-cloud";
@import hexo-config('sidebar.b2t') ? "back-to-top-sidebar" : "back-to-top";
@import hexo-config('back2top.sidebar') ? "back-to-top-sidebar" : "back-to-top";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add if hexo-config('back2top.enable')?

@import hexo-config('back2top.sidebar') ? "back-to-top-sidebar" : "back-to-top" if hexo-config('back2top.enable');

@stevenjoezhang
Copy link
Contributor Author

@1v9 @jiangtj Updated

@theme-next theme-next deleted a comment Mar 6, 2019
@theme-next theme-next deleted a comment Mar 6, 2019
@jiangtj
Copy link
Member

jiangtj commented Mar 6, 2019

@theme-next theme-next deleted a comment Mar 6, 2019
@stevenjoezhang
Copy link
Contributor Author

Should work fine now..

Copy link
Member

@jiangtj jiangtj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

back2top:
  enable: true
  # Back to top in sidebar.
  sidebar: false
  # Scroll percent label in b2t button.
  scrollpercent: true

😂
image

@stevenjoezhang
Copy link
Contributor Author

Ahh... I forgot something ... Updated again

@theme-next theme-next deleted a comment Mar 6, 2019
@jiangtj
Copy link
Member

jiangtj commented Mar 6, 2019

image
Breaking change... may need add describe in PR.

@stevenjoezhang stevenjoezhang merged commit ae28443 into theme-next:master Mar 6, 2019
@ivan-nginx ivan-nginx mentioned this pull request Mar 6, 2019
72 tasks
@stevenjoezhang stevenjoezhang deleted the back2top branch March 6, 2019 06:32
@stevenjoezhang stevenjoezhang added this to the v7.1.0 milestone Mar 6, 2019
@ivan-nginx
Copy link
Member

ivan-nginx commented Mar 6, 2019

@stevenjoezhang see how to add readme when breaking changes exists.
And this is Feature, not Optimization. Because new option exists.


Also, don't forgot to update docs on website.
image

@stevenjoezhang
Copy link
Contributor Author

@ivan-nginx I know, docs have already been added

@ivan-nginx
Copy link
Member

@stevenjoezhang I mean – don't forget to set checkbox if docs already added.

@stevenjoezhang
Copy link
Contributor Author

Sorry, I'll check again

@ivan-nginx ivan-nginx changed the title Refactor back2top button Refactored back2top button Mar 7, 2019
@liolok liolok changed the title Refactored back2top button Refactor back2top button Mar 31, 2019
@liolok liolok changed the title Refactor back2top button Usage of back2top button Mar 31, 2019
@ivan-nginx ivan-nginx mentioned this pull request Apr 4, 2019
11 tasks
@@ -107,6 +107,8 @@
scheme: '{{ theme.scheme }}',
version: '{{ version }}',
sidebar: {{ theme.sidebar | json_encode }},
back2top: {{ theme.back2top.enable }},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to refactor this under json, no need both back2top and back2top_sidebar parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's a good idea. You can do it.

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.

None yet

3 participants