feat: use calculated integrity hashes for local vendor plugins#947
Open
pivaldi wants to merge 3 commits intonext-theme:masterfrom
Open
feat: use calculated integrity hashes for local vendor plugins#947pivaldi wants to merge 3 commits intonext-theme:masterfrom
pivaldi wants to merge 3 commits intonext-theme:masterfrom
Conversation
When `vendors.plugins` is set to `local`, integrity hashes are now computed from the actual local files via `@next-theme/plugins` `getLocalIntegrity()` rather than using the hardcoded CDN hashes from `_vendors.yml`. This fixes SRI (Subresource Integrity) validation failures that caused browsers to block all vendor assets when self-hosting, resulting in blank pages. CDN mode is unaffected: hardcoded hashes from `_vendors.yml` are still used when `plugins` is not `local`. Depends on: next-theme/plugins#347
|
|
Add configurable lazy loading for non-critical CSS files (FontAwesome, Fancybox, KaTeX) to improve Lighthouse performance scores by reducing render-blocking resources. The feature uses the modern preload + onload technique to load CSS asynchronously while maintaining a noscript fallback for users without JavaScript. Main theme CSS remains render-blocking to prevent FOUC (Flash of Unstyled Content). Changes: - Add performance.lazy_css config option in _config.yml (default: false) - Update next_vendors helper to accept optional lazy flag - Modify head.njk to pass lazy: true for FontAwesome and Fancybox - Modify katex.njk to pass lazy: true for KaTeX CSS - Preserve SRI integrity hashes for security Benefits: - Reduces render-blocking CSS from 4-5 files to 1-2 files - Improves Largest Contentful Paint (LCP) by 100-300ms - Fully backward compatible (disabled by default) - Works without JavaScript via noscript fallback Closes: (add issue number if applicable)
|
This pull request contains changes to the configuration file. Please make sure the documentation in NexT website is changed or added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
When
vendors.pluginsis set tolocal, integrity hashes are now computed from the actual local files via@next-theme/pluginsgetLocalIntegrity()rather than using the hardcoded CDN hashes from_vendors.yml.This fixes SRI (Subresource Integrity) validation failures that caused browsers to block all vendor assets when self-hosting, resulting in blank pages.
CDN mode is unaffected: hardcoded hashes from
_vendors.ymlare still used whenpluginsis notlocal.Depends on: next-theme/plugins#347