Skip to content

Load quicklink on demand #637

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

Merged
merged 1 commit into from
Mar 2, 2019
Merged

Load quicklink on demand #637

merged 1 commit into from
Mar 2, 2019

Conversation

1v9
Copy link
Member

@1v9 1v9 commented Mar 2, 2019

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?

If enable quciklink then quicklink will load globally and prefetch current page's URL, this is a waste of resources.

What is the new behavior?

Good

  • Load quicklink on demand or globally.
  • Current page's URL will be ignored forever.
  • Choose to enable or disable delay.

Bad

Everything is under control except load on demand.
when set per_page: true:

  • Home page will load quicklink forever, maybe not bad?
  • Archive page can't load quicklink on demand, how to set front matter for archive page?

How to use?

In NexT _config.yml:

  • on demand and enable delay
...
quicklink:
  enable: true
  per_page: true
  delay: true
...
# Add `quicklink: true` to front matter which page you want
  • globally and disable delay
...
quicklink:
  enable: true
  per_page: false
  delay: false
...

Does this PR introduce a breaking change?

  • Yes.
  • No.

* Add per_page and delay option

* quicklink.swig -> quicklink/*.swig
@1v9 1v9 merged commit a2a7e55 into theme-next:master Mar 2, 2019
@1v9 1v9 deleted the quicklink branch March 2, 2019 04:53
@stevenjoezhang stevenjoezhang added this to the v7.0.2 milestone Mar 2, 2019
@ivan-nginx
Copy link
Member

@1v9 add docs with usage this feature on website, please. Thank's.

@1v9
Copy link
Member Author

1v9 commented Mar 2, 2019

@1v9 add docs with usage this feature on website, please. Thank's.

I will do it.

@1v9 1v9 restored the quicklink branch March 3, 2019 10:13
@1v9 1v9 deleted the quicklink branch March 3, 2019 10:13
@1v9 1v9 mentioned this pull request Mar 3, 2019
15 tasks
1v9 added a commit that referenced this pull request Mar 3, 2019
* Remove per_page option (#637 )

* Add home and archive option
@liolok liolok changed the title Refactor: Load quicklink on demand and improve it Load quicklink on demand and improve it Mar 31, 2019
@liolok liolok changed the title Load quicklink on demand and improve it Load quicklink on demand Mar 31, 2019
tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
* Add per_page and delay option

* quicklink.swig -> quicklink/*.swig
tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
* Remove per_page option (theme-next#637 )

* Add home and archive option
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.

3 participants