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

Add preload tag for main.css #577

Merged
merged 3 commits into from
Oct 25, 2022
Merged

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Oct 15, 2022

Improve performance. In addition, CloudFlare has supported early hints with this tag.
See https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload
See also https://blog.cloudflare.com/early-hints-on-cloudflare-pages/

PR Checklist

  • The commit message follows guidelines for NexT.
  • 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 features).

PR Type

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

What is the current behavior?

Issue resolved:

What is the new behavior?

  • Link to demo site with this changes:
  • Screenshots with this changes:

How to use?

preconnect: true

@coveralls
Copy link

coveralls commented Oct 15, 2022

Pull Request Test Coverage Report for Build 3318360491

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 97.614%

Totals Coverage Status
Change from base Build 3174130733: 0.0%
Covered Lines: 394
Relevant Lines: 399

💛 - Coveralls

@stevenjoezhang
Copy link
Member

Does this feature need to be associated with the preconnect option in _config.yml?

hexo-theme-next/_config.yml

Lines 339 to 341 in 1e0f28d

# Preconnect CDN for fonts and plugins.
# For more information: https://www.w3.org/TR/resource-hints/#preconnect
preconnect: false

@stevenjoezhang stevenjoezhang added this to the 8.13.2 milestone Oct 21, 2022
@njzjz
Copy link
Member Author

njzjz commented Oct 24, 2022

Does this feature need to be associated with the preconnect option in _config.yml?

Done. For compatibility, I don't change the option name.

@stevenjoezhang stevenjoezhang merged commit 110cb84 into next-theme:master Oct 25, 2022
@njzjz njzjz deleted the preload_link branch October 25, 2022 08:51
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