Performance Optimization
This page explains the blog’s performance optimization measures: image lazy loading, asset minification, CDN acceleration, image format optimization, and LCP (largest contentful paint) optimization principles. Most optimizations work out of the box — the key is understanding the layered strategy and not breaking it when adding resources.
How to read: each optimization gives the Effect first (what changes in the output/network/rendering, quantified where possible), then the corresponding config/source that produces it and the verification command.
1. Lazy Loading (lazyload)
Purpose: images and comment plugins outside the visible area aren’t loaded in advance, reducing first-screen requests and traffic. Config lives in the theme config (edit
userConfig/_config.tmp.ymlfor production).Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
1.1 How to enable
Effect: <img> tags outside the first screen send no image request on page load; the request fires only when scrolling within offset_factor × viewport height of the viewport. A placeholder (light/dark pair) shows while loading, so first-screen concurrent requests drop.
Corresponding config (theme config):
lazyload:
enable: true # true | false
loading_img: /medias_webp/loading2.svg # loading placeholder (light)
loading_img_dark: /medias_webp/loading2-dark.svg # placeholder (dark)
onlypost: false # true = lazy loading only on post pages
offset_factor: 2 # trigger offset multiplier (base = viewport height)Output: after building, image tags carry loading="lazy" lazyload and data-lazy-src-light/dark pointing at the placeholder — measured:
<img src="/medias_webp/cover/hexo.webp" width="1064" height="560"
data-lazy-src-light="/medias_webp/loading2.svg" loading="lazy" lazyload ...>1.2 Common options
① Skip first-screen images
Effect: images with the no-lazy class load immediately and show no placeholder — good for banners, logos and other first-screen elements.
Corresponding source (add the class in Markdown):
<img src="/medias_webp/banner.webp" class="no-lazy">② Lazy-load on post pages only
Effect: with onlypost: true, the home/standalone pages aren’t lazy-loaded and only post pages are; to opt a custom page in, write lazyload: true in its front-matter.
Corresponding config:
lazyload:
onlypost: true③ Tune the trigger distance
Effect: a larger offset_factor loads earlier (requests start well before reaching the bottom); smaller loads later and saves traffic; 2 means two viewport heights ahead.
Corresponding config:
lazyload:
offset_factor: 31.3 All tunable keys
| Key | Type | Default | Values / range | Purpose |
|---|---|---|---|---|
lazyload.enable | bool | true | true / false | master lazy-load switch |
lazyload.loading_img | string | /medias_webp/loading2.svg | image path | light placeholder |
lazyload.loading_img_dark | string | /medias_webp/loading2-dark.svg | image path | dark placeholder |
lazyload.onlypost | bool | false | true / false | post pages only |
lazyload.offset_factor | number | 2 | positive number (viewport multiples) | early trigger distance |
1.4 Boundaries & conflicts
- Adding the
no-lazyclass to an element skips lazy loading (e.g. a first-screen banner). - With
onlypost: falseit applies site-wide; a custom page can opt in by writinglazyload: truein front-matter. - Tune
offset_factorby deployment request speed: larger loads earlier (lazy loading kicks in nearer the bottom).
1.5 Summary
- Minimum viable:
enable: true - Placeholder flashes on the first screen: add
no-lazyto first-screen images - Too much traffic: lower
offset_factor(loads later)
2. Asset Minification (hexo-minify)
Purpose: minify JS/CSS/HTML at build time to reduce size. Root config
_config.yml.Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
2.1 How to enable
Effect: .js/.css/.html under public/ lose comments and redundant whitespace and shorten attribute quotes, so individual files shrink; local hexo server doesn’t minify because of preview: false, so compare using the output of npm run build.
Corresponding config (root _config.yml):
minify:
preview: false ## whether to minify during local preview (false = minify in production)
exclude: ['*.min.*'] # skip already-minified files
js: { enable: true } # JS minification
css: { enable: true } # CSS minification
html:
enable: true
options:
minifyJS: true # minify inline JS in HTML
minifyCSS: true # minify inline CSS in HTML
removeComments: true # strip comments
collapseWhitespace: true # strip extra whitespace
removeAttributeQuotes: true
image:
enable: false # image minification off by default (images have their own optimization, see section 4)Output: comments disappear from the built HTML and consecutive whitespace collapses; compare a file before/after with wc -c.
2.2 Common options
① Minify locally too (for debugging)
Effect: hexo server serves minified pages, making it easy to verify that styles/scripts still work after minification; the cost is harder-to-read local debugging.
Corresponding config:
minify:
preview: true② Exclude already-minified libraries
Effect: *.min.* is not minified a second time, avoiding damage to minified files and saving build time.
Corresponding config:
minify:
exclude: ['*.min.*']③ Minify HTML only
Effect: only HTML whitespace and comments collapse; JS/CSS files are output as-is (easier to inspect side by side).
Corresponding config:
minify:
js: { enable: false }
css: { enable: false }
html:
enable: true2.3 All tunable keys
| Key | Type | Default | Values / range | Purpose |
|---|---|---|---|---|
minify.preview | bool | false | true / false | minify during local preview |
minify.exclude | array | ['*.min.*'] | glob list | files to skip |
minify.js.enable | bool | true | true / false | JS minification |
minify.css.enable | bool | true | true / false | CSS minification |
minify.html.enable | bool | true | true / false | HTML minification |
minify.html.options.* | object | see above | html-minifier options | HTML minification details |
minify.image.enable | bool | false | true / false | image minification (off in this project) |
2.4 Boundaries & conflicts
preview: falsemeans localhexo serverdoesn’t minify; to verify minification usenpm run build(see the Deployment chapter).- The switches are controlled by
# minify-switchmarker lines in the root_config.yml;tools/cicd.shsed-switches them per build mode (-doff,-r/-c/-ton) and restores them automatically after the build. - Turning off HTML minification affects inline-script whitespace; if a page depends on inline-script formatting, disable
html.minifyJSalone first.
2.5 Summary
- Minimum viable: keep the defaults (js/css/html all on,
preview: false) - Debugging styles:
preview: true, or read the unminified output - Only shrink HTML: turn off the js/css items
3. CDN Acceleration
Purpose: static assets are served from jsDelivr’s global nodes, fetched from the nearest edge. The mechanism is placeholder injection: templates contain
{cdnPathVersion}, replaced with real CDN URLs at CI build time (see the CDN section of the Global Configuration chapter).Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
3.1 How to enable
Effect: after an -r build, theme asset URLs in the HTML change from in-site relative paths to https://cdn.jsdelivr.net/gh/...@<version>/..., so users fetch JS/CSS from the nearest node; a -d (debug) build clears the CDN placeholders and stays on the site’s own domain.
Corresponding config (template userConfig/_config.tmp.yml, injected into the theme config at build time):
# theme config
jsDelivr:
url: {cdnPathVersion} # versioned CDN path (replaced at build time)
latesturl: #{cdnPathLatest} # latest path (commented out, not enabled)
cdn:
url: "{cdnUrl}" # JS/CSS CDN URL
mediaUrl: "{mediaUrl}" # image/media CDN URL
resUrl: "{resUrl}" # resource CDN URLOutput: after tools/cicd.sh -r, cdn.url in themes/matery/_config.yml is already the real domain and <script src> in the built HTML points at the CDN; after -d, the same location holds an in-site path.
3.2 Common options
① Version number (the key to caching)
Effect: -r bumps tools/.VERSION and injects {urlVersion} (e.g. ?v={urlVersion}), which is what lets CDN and browser caches pick up new files; content-only -c doesn’t bump — the CDN hits the old version, which is fine since the content didn’t change.
Corresponding command:
tools/cicd.sh -r "feature" # bump version + CDN path
tools/purge-cdn.sh -a # flush CDN cache (auto-called in release mode)Output: the tools/.VERSION value grows; the ?v= in built URLs changes with it.
② Images on a separate CDN domain
Effect: image requests go through the {mediaUrl} domain, separated from JS/CSS so cache policies can be controlled independently.
Corresponding config:
cdn:
mediaUrl: "{mediaUrl}"3.3 All tunable keys
| Key | Type | Default | Values / range | Purpose |
|---|---|---|---|---|
jsDelivr.url | string | {cdnPathVersion} | placeholder | versioned CDN path |
jsDelivr.latesturl | string | commented | placeholder | latest path (not enabled) |
cdn.url | string | {cdnUrl} | placeholder/URL | JS/CSS CDN |
cdn.mediaUrl | string | {mediaUrl} | placeholder/URL | image/media CDN |
cdn.resUrl | string | {resUrl} | placeholder/URL | asset CDN |
-r version injection | command | — | — | {urlVersion} bump |
3.4 Boundaries & conflicts
- The version number is key: content-only changes with
-cdon’t bump it, so if you also changed static assets on the CDN (not post content), the cache won’t update — use-rfor that case. {cdnPathLatest}is commented out in the template and not actually enabled; referencinglatestbreaks the cache-invalidation strategy.-dbuilds clear the CDN config, so local preview can’t show the CDN effect; verify CDN using the output of-r/-c/-t.
3.5 Summary
- Minimum viable: release with
-r, the CDN is injected automatically - Changed but not updated: check whether the version number was bumped
- No CDN locally: expected,
-dclears it
4. Image Optimization (webp)
Purpose: images are the biggest chunk of this blog’s size. Site images are uniformly webp, far smaller than jpg/png, and distributed via CDN. webp files live in the theme source
themes/matery/source/medias_webp/(copied topublic/medias_webp/at build time; URLs use/medias_webp/...).Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
4.1 How to enable
Effect: all in-site image requests land on /medias_webp/*.webp (or .svg placeholders), transferring fewer bytes than same-size jpg/png; browsers decode webp directly with no extra JS.
Corresponding source (existing image library paths, examples):
# example: the featureimages library is all webp
/medias_webp/featureimages/0.webp
/medias_webp/avatar.webp
/medias_webp/loading2.svg # SVG placeholder (vector, tiny)Output: after building, public/medias_webp/ holds these files; the HTML src attributes point at them.
4.2 Common options
① Convert new images to webp before committing them
Effect: new images match the rest of the site — small, and handled correctly by lazy loading and the CDN.
Corresponding command (cwebp isn’t installed with the repo; the example is unverified — adjust the parameters to the actual image):
cwebp -q 82 input.jpg -o output.webpOutput: output.webp is produced and copied on build once placed in the image repo.
② Sync the image repos
Effect: images in the image repos (submodules) are synced before the build, and imgurl.sh processes the URLs so page references are correct.
Corresponding command:
tools/processRepo.sh # LFS checkout + sync cloudimg/cloudmediaOutput: userConfig/cloudimg/ and userConfig/cloudmedia/ hold the latest content; the build log shows no LFS errors.
4.3 All tunable keys
| Option | Location | Purpose |
|---|---|---|
/medias_webp/ | theme source/ | uniform in-site image path |
userConfig/cloudimg/ | submodule | image repo (synced by processRepo.sh) |
userConfig/cloudmedia/ | submodule | media repo |
minify.image.enable | root _config.yml | off in this project (webp is already the final form) |
4.4 Boundaries & conflicts
- New images should be converted to webp before committing: the image repo is the submodule
userConfig/cloudimg/(synced bytools/processRepo.sh), andimgurl.shprocesses URLs at build time. - Image loading follows §1 lazy loading + §3 CDN distribution, both layers stacking.
hexo-minify’simage.enableis off by default — in-site webp is already the final form and needs no second compression.- The old
medias/(jpg) library is deprecated; don’t reference.jpgpaths in new content.
4.5 Summary
- Minimum viable: convert new images to webp before putting them in the image repo
- Size comparison: same-size webp < jpg/png
- Don’t enable image minification: keep
minify.image.enableatfalse
5. LCP Optimization Principles (JS Layering)
Purpose: LCP (Largest Contentful Paint) is the key first-screen metric. A round of JS loading-strategy layering was completed on 2026-08-11; the principle is first-screen essentials synchronous, the rest defer, heavy items on demand.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
5.1 How to enable
Effect: only utils + colorSchema load synchronously on the first screen; the remaining scripts download in parallel with defer and don’t block parsing, and heavy libraries (mermaid/mathjax/echarts) are injected only on pages that need them. Measured LCP dropped from 4.2s to 1.8s (57% reduction).
Corresponding source (layout/_partial/common/scripts.ejs + head.ejs); the layering table follows.
| Layer | JS | Loading | Rationale |
|---|---|---|---|
| L0 critical sync | utils + colorSchema (+ export_config() / inline language injection) | synchronous (in head) | global namespace/config dependencies, needed for the first screen; jQuery already removed |
| L1 defer | materialize/masonry/imagesloaded/aos/events/plugins/lightgallery/search engines | defer | parallel download without blocking parsing; defer preserves execution order |
| L2 on-demand dynamic | typed/mermaid/mathjax/echarts/tocbot | conditional dynamic injection | zero first-screen cost |
| L3 async | umami/busuanzi etc. analytics | async | never blocks rendering |
5.2 Common options
① Three disciplines when adding your own JS
Effect: a new script doesn’t slow the first screen — it doesn’t block parsing, doesn’t disturb the global foundation, and heavy libraries never enter the site-wide bundle.
Corresponding source:
deferby default:<script src="..." defer></script>, never block synchronously- Don’t touch the L0 utils/colorSchema: they are the global namespace foundation; synchronous loading is a design decision
- Load heavy libraries on demand: libraries like mermaid/mathjax/echarts that only appear on specific pages shouldn’t be in the site-wide scripts — inject them on conditional trigger
② Verify that defer is in effect
Effect: the theme script tags in the built HTML carry defer, proving it hasn’t fallen back to synchronous blocking.
Corresponding command:
grep -o '<script[^>]*defer[^>]*>' public/index.html | head -3Output (measured):
<script defer src="/js/wiki.js?v=13.27" >
<script defer src="/js/search.js?v=13.27" >5.2.1 jQuery Removal & Script Layering Details (P4/P5 site-wide complete 2026-09-05)
The theme has removed jQuery site-wide, switching to native DOM APIs (querySelector / addEventListener / classList / getComputedStyle etc.). Current status of the jQuery-related items in themes/matery/_config.yml libs.js.* (sources: themes/matery/_config.yml, themes/matery/layout/_partial/common/scripts.ejs):
| Config item | Status | Basis |
|---|---|---|
libs.js.jquery | Disabled (commented out) | Comment: “2026-09-05 disabled: P4/P5 site-wide jQuery removal complete” |
libs.js.jqueryUI | Config key retained (_config.yml not commented), but the matching <script> in scripts.ejs is commented out → not actually loaded | the key still exists in _config.yml |
libs.js.jqueryBarrager | Disabled (commented out) | Disabled after the contact page was removed (jQuery barrage deprecated) |
libs.js.jqueryPjax | Config key retained | No references remain in layout/, scripts/, or source/js/ |
As a result, the L0 layer in the §5 table no longer includes jquery — the synchronous layer holds only
utils.js+color-schema.js.
Critical inline scripts must precede defer (sources: head.ejs, scripts.ejs):
head.ejssynchronously loadsutils+colorSchemaand synchronously runsexport_config()(injectswindow.CONFIG) — they must precede alldeferscripts so those can read the global namespace/config.- In
scripts.ejs, the multilingual configMATERY_LANGand i18n copyMATERY_I18Nare synchronous inline<script>tags, deliberately placed beforewiki.js(defer); the source comment reads “injected as synchronous script, guaranteed to execute before all defer scripts”.
Loading-method classification:
defer: materialize / masonry / imagesloaded / aos / events / plugins / search / scrollProgress / lightgallery / boot;instantpageistype="module"(module already implies defer semantics; nodeferattribute added).async: umami / busuanzi / tagCommon (analytics and comment helpers, non-render-blocking).- Conditional (specific pages/layouts only): typed / mermaid / mathjax / echarts / tocbot.
5.3 All tunable keys
| Option | Location | Values | Purpose |
|---|---|---|---|
| Script loading method | scripts.ejs / head.ejs | sync / defer / async / dynamic injection | whether first-screen parsing is blocked |
libs.js.jquery | themes/matery/_config.yml | commented (disabled) | jQuery already removed |
libs.js.instantpage | same as above | type="module" | module carries defer semantics |
| Conditional trigger list | corresponding templates | specific pages only | typed/mermaid/mathjax/echarts/tocbot |
5.4 Boundaries & conflicts
JS compatibility pitfall (2026-09-22): classList.add('a b') with a space-separated multi-class string throws InvalidCharacterError (DOMTokenList rejects spaces) — use classList.add('a', 'b') or split and add individually. The homepage once failed this way.
- Changing L0 scripts to
deferleaves other scripts unable to readwindow.CONFIG, causing a blank first screen orundefinederrors. - Adding a third-party library synchronously rolls LCP back — prefer on-demand injection.
5.5 Summary
- Minimum viable: every new script uses
defer - Changing L0: first check which scripts depend on
window.CONFIG - Heavy libraries: inject on conditional trigger, never in the site-wide bundle
- Multiple classes:
classList.add('a','b'), no spaces
6. Page Preloading (instantpage)
Purpose: preload the target page when the user hovers a link, making clicks open almost instantly.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
6.1 How to enable
Effect: a few tens of milliseconds after hovering an in-site link, the Network panel shows a prefetch request for the target page; clicking renders from cache, which feels faster. Mobile has no hover, so no preloading happens there.
Corresponding config (theme config):
instantpage:
enable: trueOutput: the page loads the instantpage script (type="module", equivalent to defer), and that <script> is visible in the output.
6.2 Common options
① Turn it off
Effect: no more hover prefetch requests, saving traffic; clicking loads the target page normally.
Corresponding config:
instantpage:
enable: false6.3 All tunable keys
| Key | Type | Default | Values / range | Purpose |
|---|---|---|---|---|
instantpage.enable | bool | true | true / false | hover preload switch |
6.4 Boundaries & conflicts
- Built on instant.page; with
enable: trueit applies site-wide, and on mobile (no hover) it degrades automatically without preloading. - Prefetching only happens for in-site links; external links are unaffected.
6.5 Summary
- Minimum viable:
enable: true - Traffic-sensitive: turn it off and load on click
7. Dark Feature Images (darkFeatureImages)
Purpose: the feature image library for dark mode — the dark counterpart of
featureimages, used for random picks in dark mode.Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
7.1 How to enable
Effect: in dark mode the banner/cover picks images from the dark/ directory, and switching back to light picks from the original library; the same title still maps to a stable image by hash.
Corresponding config (theme config):
darkFeatureImages:
- /medias_webp/featureimages/dark/0.webp
- /medias_webp/featureimages/dark/1.webp
- /medias_webp/featureimages/dark/2.webp
# ... more dark imagesOutput: in dark mode the img/background addresses become /medias_webp/featureimages/dark/N.webp.
7.2 Common options
① Add more dark images
Effect: more candidates in the dark library, so different posts are more likely to get different images.
Corresponding config: append paths to the list (images go in themes/matery/source/medias_webp/featureimages/dark/).
7.3 All tunable keys
| Key | Type | Default | Values / range | Purpose |
|---|---|---|---|---|
darkFeatureImages | array | — | list of image paths | random image pool for dark mode |
7.4 Boundaries & conflicts
- Corresponds to the light
featureimageslibrary; in dark mode, banner/cover random picks come from this list. Images go inthemes/matery/source/medias_webp/featureimages/dark/. - A missing file makes the dark image request 404, and the page falls back to the placeholder/default image.
7.5 Summary
- Minimum viable: list a few
dark/N.webpentries - Wrong image: confirm the file really is in the
dark/directory
8. Image Size Plugin (image_size_plugin)
Purpose: automatically add
width/heightattributes to images at build time to prevent layout shift (CLS); supports mapping local images to online CDN paths.Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
8.1 How to enable
Effect: built <img> tags gain width="1064" height="560" (measured on the homepage cover), so the browser reserves space before the image downloads and CLS drops.
Corresponding config (theme config):
image_size_plugin:
enable: true
proxy_url: # image proxy address (e.g. http://xray:10089)
debug: true # true | false print switch
onlypost: false # true = only process post images
# local image paths (array: theme assets + site post images)
local_path:
- themes/matery/source
- source
# local path index for mapping to online paths
map_paths:
- userConfig/cloudmedia
- userConfig/cloudimg
- themes/matery/source
# local-to-online path mapping
map_paths_web_root:
userConfig/cloudmedia: https://cdn.17lai.site
userConfig/cloudimg: https://cimg1.17lai.siteOutput: after building, <img> carries width/height; with debug: true the build log prints the processed images.
8.2 Common options
① Skip processing
Effect: images with the no-size class, or that already carry width/height, are output as-is without rewriting.
Corresponding source (Markdown):
<img src="/medias_webp/xxx.webp" class="no-size">② Map local paths to the CDN
Effect: local image paths matching map_paths are replaced with the online addresses configured in map_paths_web_root, so no local path appears in the output.
Corresponding config:
image_size_plugin:
map_paths:
- userConfig/cloudimg
map_paths_web_root:
userConfig/cloudimg: https://cimg1.17lai.site8.3 All tunable keys
| Key | Type | Default | Values / range | Purpose |
|---|---|---|---|---|
image_size_plugin.enable | bool | true | true / false | master switch for adding dimensions |
image_size_plugin.proxy_url | string | empty | proxy address | proxy for probing remote images |
image_size_plugin.debug | bool | true | true / false | print processing logs |
image_size_plugin.onlypost | bool | false | true / false | post pages only |
image_size_plugin.local_path | array | see above | directory list | local image lookup roots |
image_size_plugin.map_paths | array | see above | directory list | local path mapping sources |
image_size_plugin.map_paths_web_root | map | see above | directory → URL | online address mapping |
8.4 Boundaries & conflicts
- Images with the
no-sizeclass, or that already carrywidth/height, are skipped;map_paths+map_paths_web_rootreplace local image paths with online CDN addresses (images in the image-repo submodulesuserConfig/cloudimg,userConfig/cloudmediago through this mapping). - Remote images need
proxy_urlto have their size probed, otherwise they’re skipped (nowidth/heightadded).
8.5 Summary
- Minimum viable:
enable: true - Verify:
grep -o '<img[^>]*width="[0-9]*"' public/index.html | headon the output - Don’t process one image: add
no-size
9. CSS Async + SEO (2026-09-07)
Purpose: eliminate render-blocking CSS and fill in the metadata search/share needs.
Learning path: How to enable → Non-critical CSS → Structured data → Share image → LCP element → All tunable keys → Boundaries & conflicts
9.1 How to enable
Effect: animation-library CSS loads non-blockingly, so first-screen rendering isn’t stuck on it; the page head also gains JSON-LD structured data and og:image, which search engines and social platforms read for title/description/cover.
Corresponding config/source: the four implementations are in 9.2–9.5, all built into the theme and on by default.
Output: the built HTML can be grepped for media="print", application/ld+json and <meta property="og:image"> at the same time (all verified present).
9.2 Non-critical CSS async loading
Effect: the page head contains a <link> with media="print" onload="this.media='all'"; the media switches back to all only once the CSS has downloaded, so it doesn’t block first-screen rendering; with JS disabled, a <noscript> fallback covers it.
Corresponding source (layout/_partial/common/css.ejs):
<link rel="stylesheet" href="..." media="print" onload="this.media='all'">
<noscript><link rel="stylesheet" href="..."></noscript>Output: that <link> in the output carries media="print" and onload; aos/animate.css no longer appear in the render-blocking CSS list.
Note: when rel="stylesheet preload" and a plain stylesheet point at the same URL, the browser deduplicates automatically (no double download) — no need to remove either.
9.3 SEO structured data (JSON-LD)
Effect: the built HTML contains application/ld+json (verified present) with the site name, post title/description/date/author/cover and a SearchAction, from which Google can generate rich results.
Corresponding source (theme-built-in layout/_partial/common/structured-data.ejs, injected automatically):
- WebSite (site-wide): site name + SearchAction (sitelinks searchbox rich result)
- BlogPosting (post pages): headline/description/date/author/cover/keywords/category
- Person + Organization: cross-referenced via
@id(avoids duplicate data)
Output: grep -o 'application/ld+json' public/index.html returns hits.
9.4 Social share image (og:image)
Effect: on post pages og:image is the post cover; home/list pages fall back to the default image (measured: the homepage outputs /medias_webp/featureimages/0.webp).
Corresponding config:
# theme config (must also sync userConfig/_config.tmp.yml)
open_graph:
default_og_image: /medias_webp/featureimages/15.webpOutput: <meta property="og:image" content="...">.
Priority: page.img (post image) → theme.default_og_image (default) → theme.featureImages[0]. Post pages use the post cover; home/list pages use the default image.
9.5 LCP element priority
Effect: first-screen images such as the logo carry fetchpriority="high", so the browser downloads them first and LCP comes earlier.
Corresponding source: built into header/mobile-nav.
Note: the home banner background is JS-injected (random image rotation) and must not be changed to CSS output — that would break the random rotation.
9.6 All tunable keys
| Option | Location | Values | Purpose |
|---|---|---|---|
media="print" onload | css.ejs | on/off | non-critical CSS async |
| JSON-LD injection | structured-data.ejs | built-in | search-engine rich results |
open_graph.default_og_image | theme config | image path | share image when a post has none |
fetchpriority="high" | header/mobile-nav | built-in | first-screen image priority |
9.7 Boundaries & conflicts
rel="stylesheet preload"and a plainstylesheetwith the same URL are deduplicated by the browser automatically; duplicate declarations don’t double-download, but add an extra tag.- All JSON-LD data comes from existing variables (
config.title/url/author/language+page.*) and needs no manual maintenance; validate with Google Rich Results Test (after production deploy). - The home banner background must stay JS-injected; changing it to CSS output breaks the random rotation.
9.8 Summary
- Minimum viable: all four are theme built-ins, on by default
- Verify structured data:
grep -o 'application/ld+json' public/index.html - Share has no image: configure
default_og_image - Don’t touch the banner: random rotation depends on JS injection
Appendix: Performance Optimization Quick Reference
| Measure | Config location | Key points |
|---|---|---|
| Lazy loading | theme config lazyload | no-lazy class skips; onlypost controls scope |
| Asset minification | root _config.yml minify | local preview not minified; -d disables |
| CDN | theme config jsDelivr/cdn | -r bumps the version to flush caches |
| Images | /medias_webp/ + CDN | uniform webp; image repo is a submodule |
| LCP layering | layout/_partial/common/scripts.ejs | L0 sync / L1 defer / L2 on-demand / L3 async |
| CSS async | layout/_partial/common/css.ejs | aos/animate via media="print" onload |
| SEO structured | layout/_partial/common/structured-data.ejs | auto JSON-LD WebSite + BlogPosting |
| Social share image | theme config default_og_image | fallback default image for home/list (also sync userConfig/_config.tmp.yml) |
| LCP element | header/mobile-nav logo img | fetchpriority="high" |