Interactions & Visual Effects
This page covers the interaction & visual features of the matery theme: code block enhancements, image lightbox, typewriter, page effects, simplified/traditional Chinese conversion, reading progress, back-to-top, rewards, print styles, audio/video players and charts. Each feature lists its config location and how to use it.
How to read this page: every feature is shown as a pair — Effect → Corresponding config. Look at what it produces first, then copy the YAML below. Every key in the parameter tables appears either on this page or in
userConfig/_config.tmp.yml; unverified values are marked “other values unverified”.Config locations are all in the theme config
themes/matery/_config.yml(“theme config” below). Note: in this project the theme config file is overwritten by theuserConfig/_config.tmp.ymltemplate during CI builds — sync your changes to the template (see the Installation chapter). Some features have no dedicated config key (back-to-top, print styles) — they are built into the theme and work out of the box.
1. Code Block Enhancements
Purpose: code blocks automatically get a language label, copy button, expand/collapse and fullscreen view; overly long code is height-limited.
Learning path: Enable the language label → configure copy and expand → tune the height limit → full parameter table → Boundaries & conflicts
1.1 How to enable
Effect: the code block below is the real rendering — a language label in the top-right, a copy button on hover:
echo "Hello Matery"Corresponding config (minimum viable: language label + copy button, everything else at default):
code:
language:
enable: true
default: "TEXT"
copy_btn: trueStandard Markdown code blocks are enhanced automatically; no extra marker syntax is needed.
1.2 Common options
① Height limit and expand
Effect: code blocks taller than height_limit (450px) are collapsed by default with an “expand” bar at the bottom; clicking it shows the full block with no height limit.
Corresponding config:
code:
height_limit: "450px" # auto-collapse above this height
show_full: true # show the "expand" bar in the collapsed state② Manual collapse
Effect: a collapse button appears in the code block toolbar so readers can manually collapse / expand the whole block.
Corresponding config:
code:
shrink: true③ Language label fallback
Effect: when no language is written or the language is unrecognized, the top-right label shows the copy specified by default (default TEXT).
Corresponding config:
code:
language:
enable: true
default: "TEXT" # use "CODE" to show CODE instead④ Copy button
Effect: a copy button appears on hover; clicking copies the whole block. With false only the language label remains in the top-right.
Corresponding config:
code:
copy_btn: true⑤ Fullscreen view
Effect: a fullscreen button appears in the toolbar; clicking makes that code block fill the viewport (this is the other code-fullscreen entry besides the §17 preference panel).
Corresponding config:
code:
show_expand: true⑥ Wrapping over-wide lines
Effect: with break: false, over-wide lines do not wrap but scroll horizontally (this project uses that value); true wraps them.
Corresponding config:
code:
break: false1.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
code.shrink | bool | true | true / false | Code block collapsible (fold button) |
code.break | bool | false | true / false | Whether long lines wrap; false scrolls horizontally |
code.show_full | bool | true | true / false | Show the “expand all” button for long code |
code.height_limit | string | "450px" | CSS length with a unit (px etc.) | show_full height threshold |
code.show_expand | bool | true | true / false | Fullscreen view button |
code.copy_btn | bool | true | true / false | Copy code button |
code.language.enable | bool | true | true / false | Show the language label |
code.language.default | string | "TEXT" | any string | Default label when no language is given |
1.4 Boundaries & conflicts
height_limitmaps to the CSS variable--code-max-height; when expanded, JS sets the container’smaxHeighttoscrollHeight(no longer bounded by that value), and on collapse restores it to empty, back to 450px.copy_btn/show_full/shrinkare three independent buttons, combinable freely; turn all off and only a bare code block remains.- The language label is only output when
language.enable: true; unrecognized languages fall back tolanguage.default. - Changing any item in this section requires a clean build to take effect (the cache does not notice config changes).
1.5 Summary
- Minimum viable:
language.enable+copy_btn— two lines are enough. - Afraid of exploding long posts: tune
height_limit;show_fullprovides the “expand” bar. - Changes don’t apply: suspect the cache first; do a clean build.
2. Image Lightbox (lightGallery)
Purpose: post images click to enlarge into fullscreen browsing, with zoom, paging and download, plus auto-generated captions.
Learning path: Enable the lightbox → plain images suffice → swap in original image links → full parameters → boundaries
2.1 How to enable
Effect: images in a post become clickable; clicking opens a black-overlay lightbox with zoom / paging / download; the caption generated from image_caption appears below the image.
Corresponding config (theme config, inside the post block):
post:
image_zoom:
enable: true # post images clickable to enlargeExample (a plain Markdown image is enough, auto-enhanced):
2.2 Common options
① Link replacement (thumbnail → original)
Effect: the lightbox loads the replaced original-image link while the list still shows the compressed image — saving bandwidth without sacrificing zoom quality.
Corresponding config:
post:
image_zoom:
img_url_replace: ['-slim', ''] # strips -slim from the link; use a 're:' prefix for regex② Disable the lightbox
Effect: images are not clickable and nothing happens on click; links display as before.
Corresponding config:
post:
image_zoom:
enable: false2.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
post.image_zoom.enable | bool | true | true / false | Post images clickable to enlarge |
post.image_zoom.img_url_replace | array | ['', ''] | [search, replace]; use a re: prefix for regex | Link replacement rule when enlarging |
The lightbox library itself is loaded via
libs.js.lightgallery/libs.css.lightgallery(local/libs/lightGallery/...), not viaimage_zoomkeys; other values unverified.
2.4 Boundaries & conflicts
- Lightbox initialization happens on post pages (
#articleContent/#myGallery);Matery.plugins.lightgallery(selector)returns immediately for those two containers and does not initialize twice. Wiki pages unverified. - The lightbox depends on
lightgallery-all.min.jsbeing loaded; when missing, the function simplyreturns and clicking images does nothing. img_url_replaceis a paired replacement; wrong ordering corrupts links — when unsure keep the default['', ''](no replacement).
2.5 Summary
- It should be on by default: one line
enable: truegives plain images the lightbox. - Blurry on zoom: use
img_url_replaceto swap back to the original link. - Clicking does nothing: first check whether the lightgallery assets loaded.
3. Typewriter (Typed)
Purpose: banner subtitle character-by-character rotation and post page title typing animation.
Learning path: Enable subtitle typing → configure the sentence list → enable post title typing → limit pages → full parameters → conflicts
3.1 How to enable
Effect: the homepage banner subtitle types out from empty, pauses, deletes and moves to the next sentence; post page H2 titles appear the same way, with a blinking cursor.
Corresponding config (theme config, minimum viable — subtitle typing only):
fun_features:
typing:
enable: true3.2 Common options
① Banner subtitle typing (subtitle block, including speed and rotation)
Effect: rotates through the sentences in the sub list, looping, with _ as the cursor.
Corresponding config:
subtitle:
enable: true
typed:
loop: true # loop rotation
showCursor: true # show cursor
cursorChar: "_" # cursor character
startDelay: 100 # start delay (ms)
typeSpeed: 80 # typing speed (ms/char)
backSpeed: 50 # deleting speed (ms/char)
sub: # rotation sentence list (typed one by one)
- 真经一句话,假经传万卷!② Another entry: fun_features.typing (with page scope)
Effect: a second switch entry for the same subtitle typing effect; an empty scope enables it site-wide, while page names limit typing to those pages only.
Corresponding config:
fun_features:
typing:
enable: true
typeSpeed: 70
cursorChar: "_"
loop: false
scope: [] # home | post | tag | category | about | links | page | 404 (empty = all)③ Post page H2 title typing
Effect: H2 titles in posts (and other layouts) appear character by character; when disabled the title displays directly with no animation.
Corresponding config:
post:
typed:
enable: true
loop: false
showCursor: true
cursorChar: "_"
startDelay: 50
typeSpeed: 70
backSpeed: 503.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
subtitle.enable | bool | true | true / false | Banner subtitle area master switch |
subtitle.typed.loop | bool | true | true / false | Whether to loop |
subtitle.typed.showCursor | bool | true | true / false | Show cursor |
subtitle.typed.cursorChar | string | "_" | any character | Cursor character |
subtitle.typed.startDelay | number | 100 | ms | Start delay |
subtitle.typed.typeSpeed | number | 80 | ms/char, larger = slower | Typing speed |
subtitle.typed.backSpeed | number | 50 | ms/char | Deleting speed |
subtitle.sub | array | several Chinese sentences | any string list | Rotation sentences |
fun_features.typing.enable | bool | true | true / false | Subtitle typing switch (second entry) |
fun_features.typing.typeSpeed | number | 70 | ms/char | Typing speed |
fun_features.typing.cursorChar | string | "_" | any character | Cursor character |
fun_features.typing.loop | bool | false | true / false | Whether to loop |
fun_features.typing.scope | array | [] | home post tag category about links page 404 | Pages to enable (empty = all) |
post.typed.enable | bool | true | true / false | Post H2 title typing |
post.typed.loop | bool | false | true / false | Whether to loop |
post.typed.showCursor | bool | true | true / false | Show cursor |
post.typed.cursorChar | string | "_" | any character | Cursor character |
post.typed.startDelay | number | 50 | ms | Start delay |
post.typed.typeSpeed | number | 70 | ms/char | Typing speed |
post.typed.backSpeed | number | 50 | ms/char | Deleting speed |
3.4 Boundaries & conflicts
subtitle.typedandfun_features.typingare two independent entries, both belonging to the banner subtitle; before editing, confirm which one is actually in effect (when both are on, the code’s read order decides; other combinations unverified).scopeonly accepts the 8 page names in the table above; a wrong name simply means that page is not enabled (no error).post.typedapplies to H2 and does not affect the banner; withloop: falsetyping stops on the complete title.- After changing config you must do a clean build.
3.5 Summary
- Only want subtitle typing: one line
fun_features.typing.enable. - Want to control which pages type: use
scope; don’t turn off the master switch. - Section titles are moving too: that’s
post.typed, an independent switch.
4. Page Effects
Purpose: 13 decorative effects in two categories — page/background effects (auto-run) and mouse/click effects (interaction-triggered), switchable at runtime via the floating panel on the right.
Learning path: Enable the master switch → pick a page effect → pick a mouse effect → desktop gating → runtime switching → full parameters → conflicts
4.1 How to enable
Effect: the selected decorative animation appears (e.g. sakura petals falling continuously); the selected click effect appears on mouse move/click; mobile does not load them by default.
Corresponding config (theme config effects block, the single config source after the 2026-08-10 refactor):
effects:
enable: true # master switch: whether the "Page Effects" area shows in the floating panel
page:
default: sakura # sakura
mouse:
default: off4.2 Common options
① Page/background effects (single select)
Effect: only the one named by default takes effect — sakura shows sakura, ripples shows ripples, off adds nothing, random picks one from available each time.
Corresponding config:
effects:
page: # page/background effects (mutually exclusive, pick one)
default: off # default: off | random | specific id
available:
sakura: { label: 樱花, lib: sakura }
ripples: { label: 水波, lib: ripples }
leaf: { label: 落叶, lib: leaf }
snowdown: { label: 飘雪, lib: snowdown }
snowflake: { label: 雪花, lib: snowflake }
buble: { label: 冒泡, lib: buble }
canvas_nest: { label: 网络, lib: canvas_nest }
ribbon: { label: 彩带, lib: ribbon }
ribbon_dynamic: { label: 动态彩带, lib: ribbon_dynamic }② Mouse/click effects (single select)
Effect: the matching feedback appears on click or mouse move — clicklove hearts, mouseStar stars, fireworks explosions, popupText popup text.
Corresponding config:
effects:
mouse: # mouse/click effects (mutually exclusive, pick one)
default: off
available:
clicklove: { label: 爱心, lib: clicklove }
popupText: { label: 弹出文字, lib: popupText }
mouseStar: { label: 星星, lib: star }
fireworks: { label: 爆炸, lib: fireworks }③ Desktop-only injection
Effect: with true, mobile does not load effect scripts at all (saves power and bandwidth); with false, mobile loads them too.
Corresponding config:
effects:
desktop_only: true # inject on desktop only (off on mobile for performance)④ Runtime switching (reader side, no code changes)
Effect: right floating panel → “Page Effects” area: choose Off / Random / a specific effect; the choice is written to localStorage and takes effect after refresh, with higher priority than default in the config.
Corresponding call (equivalent to the panel operation):
localStorage.setItem('matery.effect.page', 'sakura'); // sakura appears after refresh
localStorage.setItem('matery.effect.mouse', 'clicklove'); // hearts on click after refresh
localStorage.setItem('matery.effect.page', 'off'); // disable page effects⑤ Manually trigger loading
Effect: reads window.Matery.effects (config metadata injected by the template) and loads scripts according to the page / mouse values; with no config it is a no-op that does not error.
Corresponding call:
Matery.plugins.effects(); // inject effect scripts immediately per current config4.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
effects.enable | bool | true | true / false | Master switch: whether the panel’s “Page Effects” area shows |
effects.desktop_only | bool | true | true / false | Inject on desktop only |
effects.page.default | string | off | off / random / any id in available | Default page effect (single select) |
effects.page.available.<id>.label | string | — | any display name | Panel display copy |
effects.page.available.<id>.lib | string | — | sakura ripples leaf snowdown snowflake buble canvas_nest ribbon ribbon_dynamic | Library actually loaded |
effects.mouse.default | string | off | off / random / any id in available | Default mouse effect (single select) |
effects.mouse.available.<id>.label | string | — | any display name | Panel display copy |
effects.mouse.available.<id>.lib | string | — | clicklove popupText star fireworks | Library actually loaded |
localStorage["matery.effect.page"] | string | — | off / random / id | Runtime page-effect preference |
localStorage["matery.effect.mouse"] | string | — | off / random / id | Runtime mouse-effect preference |
libcorresponds to atheme.libs.js.*path key;canvas_nest/ribbonadditionally support aparamssub-key (color, count etc.);paramsfor the other libraries unverified.
4.4 Boundaries & conflicts
- The
pageandmousegroups are each single-select: configuring several in one group means only the one named bydefaulttakes effect. - The two groups persist independently:
matery.effect.pageandmatery.effect.mousedo not interfere; after switching in the panel you must refresh the page for it to apply. - Desktop gate: with
desktop_only: true, injection happens only when the window width exceeds theBP.funbreakpoint (~992px) and the local visit count is > 1; mobile and first-time visitors do not load it. - The legacy standalone
sakura/ripples/clickloveenable sections have been removed and no longer participate in injection; add/remove effects by editing theavailablelists — the panel and runtime adapt automatically. - Runtime logic lives in
themes/matery/source/js/plugins.js(Matery.plugins.effects); config metadata is injected intowindow.Matery.effectsbythemes/matery/layout/_partial/script/effects.ejs.
4.5 Summary
- Minimum viable:
effects.enable+ one linepage.defaultto pick an effect. - Several in one group does nothing: only
defaulttakes effect. - Nothing on desktop: check whether the width passes the breakpoint, then the visit count (first visits don’t inject).
- Want to change your mind: use the floating panel instead of repeatedly editing config.
4.6 Festival lanterns (dengbox)
Purpose: festival lantern decorations on the left and right edges of the page (e.g. “新春/快乐”); lives in the
fun_featuresblock (distinct from theeffectspanel above).
Effect: when enabled, one lantern hangs on each side of the page with customizable text; disabled hides them.
Corresponding config (theme config fun_features block):
fun_features:
dengbox:
enable: false # false | true
left: 新春 # left lantern text
right: 快乐 # right lantern textThis is a different mechanism from §4’s
effects: lanterns are static decoration, not controlled by the effects panel.
5. Simplified/Traditional Chinese Conversion
Purpose: one-click traditional/simplified switching for page content, with the user’s choice remembered in localStorage.
Learning path: Enable the switch → see the button → switch via API → full parameters → conflicts
5.1 How to enable
Effect: a “繁/简” toggle button appears in the footer (#translateLink); clicking converts all body text between simplified and traditional, the button label flips accordingly, and the choice survives a refresh.
Corresponding config (theme config, consolidated into the preference section on 2026-08-16):
preference:
translate:
enable: true # conversion switch5.2 Common options
① Disable conversion
Effect: the trad/simp button no longer appears in the footer; body text always stays as written.
Corresponding config:
preference:
translate:
enable: false② Switch via API (without clicking the button)
Effect: the call immediately converts the body and flips the button label; the encoding value is also written to local storage so later pages follow it.
Corresponding call:
Matery.plugins.languageToggle(); // toggle simp ↔ trad
Matery.plugins.languageToggle.getEncoding(); // read the current encoding5.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
preference.translate.enable | bool | true | true / false | Trad/simp conversion switch (the only read point) |
5.4 Boundaries & conflicts
- The legacy
footer.translateconfig was removed on 2026-08-10 (confirmed by the footer.ejs comment); onlypreference.translate.enableis read. - Conversion is body-text replacement; it does not change markup outside code-block text. It is separate from the i18n language dropdown (which swaps template copy).
- The button is output based on
enable; API calls beyond the button are not limited byenable.
5.5 Summary
- One-line switch:
preference.translate.enable. - Button missing: first confirm you didn’t write the old
footer.translate. - Want to script it: call
Matery.plugins.languageToggle()directly.
6. Reading Progress Bar / Back to Top
Purpose: a reading progress bar at the top grows while scrolling; one-click back-to-top at the bottom right.
Learning path: Enable the progress bar → tune height and color → confirm back-to-top → full parameters → conflicts
6.1 How to enable
Effect: a thin colored progress bar appears at the top of the page, growing with page load and scroll; a round button appears at the bottom right (visible after scrolling) and smoothly returns to the top.
Corresponding config (theme config; the progress bar lives in the fun_features block):
fun_features:
progressbar:
enable: true # loading progress bar (off by default)
height_px: 3
color: "#29d"6.2 Common options
① Height and color
Effect: the bar thickens per height_px and changes color per color, reflected immediately at the top of the page.
Corresponding config:
fun_features:
progressbar:
height_px: 3
color: "#29d"② nprogress behavior options
Effect: showSpinner turns off the spinner in the top-right; a smaller trickleSpeed makes the bar advance faster (10–100 is the common range).
Corresponding config:
fun_features:
progressbar:
options: { showSpinner: false, trickleSpeed: 100 } # nprogress options③ Back to top (no dedicated config key)
Effect: the #backTop button is built into the right floating panel, enabled by default, needs no config, scrolls smoothly and adapts its size on mobile.
Corresponding config: none. The button is output by layout/_partial/common/right-floating.ejs; see §15 for the other arrow entry.
6.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
fun_features.progressbar.enable | bool | false | true / false | Loading progress bar switch |
fun_features.progressbar.height_px | number | 3 | positive integer (px) | Progress bar height |
fun_features.progressbar.color | string | "#29d" | any CSS color | Progress bar color |
fun_features.progressbar.options | object | {showSpinner:false, trickleSpeed:100} | nprogress keys of the same name | Passed through to nprogress |
Apart from
showSpinner/trickleSpeed, the other nprogress keys inoptionsare unverified.
6.4 Boundaries & conflicts
- The progress bar is off by default and needs an explicit
enable: true. - Back to top has two entries:
#backTopin this section (inside the floating panel) andscroll_top_arrowin §15 (a standalone arrow); both can exist at once. optionsis passed through as-is; a wrong key name does not error, it just has no effect.
6.5 Summary
- One line enables the progress bar:
progressbar.enable: true. - Back to top needs no config: built in.
- Two back-to-top buttons: if you want only one, turn off the other’s switch.
7. Reward Popup
Purpose: a “tip” button at the bottom of posts; clicking pops up a WeChat/Alipay QR code dialog.
Learning path: Enable rewards → swap QR codes → per-post override → full parameters → conflicts
7.1 How to enable
Effect: a “tip” button appears at the bottom of posts; clicking opens a QR code dialog with Alipay/WeChat tabs, closable via the close button or by clicking the overlay.
Corresponding config (theme config, inside the post block):
post:
reward:
enable: true
title: 码字辛苦,打赏作者!
wechat: /medias_webp/reward/wechat.webp
alipay: /medias_webp/reward/alipay.webp7.2 Common options
① Change the popup title
Effect: the copy at the top of the popup becomes the content of title.
Corresponding config:
post:
reward:
title: 码字辛苦,打赏作者!② Change the QR code images
Effect: the new image shows in the corresponding tab; local paths or remote images both work.
Corresponding config:
post:
reward:
wechat: /medias_webp/reward/wechat.webp
alipay: /medias_webp/reward/alipay.webp③ Per-post override (front-matter)
Effect: the “tip” button appears at the bottom of this post (true) or not (false), taking priority over the global config.
Corresponding config:
reward: true # true enables tipping for this post / false disables (default follows global config)7.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
post.reward.enable | bool | true | true / false | Global reward button switch |
post.reward.title | string | 码字辛苦,打赏作者! | any string | Popup title |
post.reward.wechat | string | /medias_webp/reward/wechat.webp | image path / URL | WeChat QR code |
post.reward.alipay | string | /medias_webp/reward/alipay.webp | image path / URL | Alipay QR code |
front-matter reward | bool | follows global | true / false | Per-post override |
7.4 Boundaries & conflicts
- Front-matter
rewardoverrides the globalpost.reward.enable; if omitted it follows the global setting. - When a QR code image is missing the popup still opens; only the image fails to load (no error).
- Output only on post pages; standalone pages (wiki/about etc.) do not show it.
7.5 Summary
- Minimum viable:
post.reward.enable+ two images. - Turn off for one post: front-matter
reward: false. - Swapped image doesn’t show: clean-build first, then verify the path.
8. Print Styles
Purpose: print layout optimization for posts (hide nav/sidebar/footer, center content, show link URLs).
Learning path: Press Ctrl+P and look → confirm no config needed → boundaries
8.1 How to enable
Effect: Ctrl+P printing keeps only the body, hiding the navbar, sidebar, footer and floating buttons; full URLs appear next to links; margins and font sizes are optimized for paper and automatically switch to light variables (no black background when printing in dark mode).
Corresponding config: none needed — print styles are built into the theme CSS (source/css/_pages/_base/print.styl + the @media print rules in color-schema.styl) and are always active.
8.2 Common options
① Check with the browser print preview
Effect: the preview shows only the post body and title, filling the paper width; floating buttons and background effects all disappear.
Corresponding action:
Browser Ctrl+P → preview → confirm no sidebar / no black background → print or save as PDF② Changing print styles
Effect: editing rules inside @media print directly changes the print result; this is a source-code change, not a config item.
Corresponding location:
themes/matery/source/css/_pages/_base/print.styl
themes/matery/source/css/color-schema.styl (@media print section)8.3 All tunable keys
| Item | Location | Default | Effect |
|---|---|---|---|
| Print rules | print.styl + color-schema.styl | built in, active | Hide non-body elements, show link URLs, light variables |
No YAML config key; changing styles requires editing the styl source.
8.4 Boundaries & conflicts
- Print styles and screen styles are two rule sets; changing screen CSS does not affect print and vice versa.
- Switching to light variables inside
@media printprevents black-background white-text output when printing in dark mode. - Browsers disable background-color printing by default; PDF output follows the browser settings.
8.5 Summary
- No config: built in,
Ctrl+Pjust works. - Want to customize: edit
print.styl, then clean-build. - Printing all black: confirm the
@media printsection incolor-schema.stylis still there.
9. Music Player (APlayer)
Purpose: bottom-fixed music player on the homepage/site-wide; MetingJS resolves NetEase and other platform playlists.
Learning path: Enable the player → fill platform/type/ID → choose bottom-fixed or card → full parameters → conflicts
9.1 How to enable
Effect: a music card appears (cover + playback controls + progress bar + playlist), or a bottom-floating bar; clicking play starts the first track of the playlist.
Corresponding config (theme config music block):
music:
enable: true # enable (off by default)
server: netease # platform: netease | tencent | kugou | xiami | baidu
type: playlist # type: song | playlist | album | search | artist
id: 4965675848 # playlist/song ID9.2 Common options
① Bottom-fixed mode
Effect: with fixed: true the player stays fixed at the bottom of the page and persists while scrolling; with false it is embedded as a card in the page.
Corresponding config:
music:
fixed: true # true = bottom-fixed mode (floating at the bottom of the page)② Title in non-fixed mode
Effect: card mode shows the copy from title.show at the top; in fixed mode that title is ignored.
Corresponding config:
music:
title:
enable: true
show: 听听音乐③ Autoplay and loop order
Effect: autoplay: true tries to play as soon as the page loads (browser policy may block it); loop controls single-track/playlist looping and order controls sequential or random playback.
Corresponding config:
music:
autoplay: false
loop: 'all' # loop: all | one | none
order: 'random' # order: list | random④ Volume, folded list, lyrics
Effect: volume sets the default volume (ignored after the user adjusts it); listFolded: true folds the playlist by default; hideLrc: true hides lyrics.
Corresponding config:
music:
volume: 0.7 # default volume (the player remembers user settings)
listFolded: true # list folded by default
hideLrc: true # hide lyrics⑤ Standalone music page (musics block)
Effect: a player for a separate music page; the config keys match music but are independent; fixed: false makes it an in-page card.
Corresponding config:
musics:
enable: true
fixed: false # enable bottom-fixed mode
type: playlist
id: 49656758489.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
music.enable | bool | false | true / false | Whether the player is enabled |
music.title.enable | bool | true | true / false | Card title switch (only in non-fixed mode) |
music.title.show | string | 听听音乐 | any string | Card title copy |
music.autoHide | bool | true | true / false | Whether to auto-hide |
music.server | string | netease | netease tencent kugou xiami baidu | Music platform |
music.type | string | playlist | song playlist album search artist | Resource type |
music.id | string/number | 4965675848 | platform-specific song/playlist/album ID | Resource ID |
music.fixed | bool | true | true / false | Bottom-fixed mode |
music.autoplay | bool | false | true / false | Autoplay |
music.theme | string | '#42b983' | any CSS color | Player theme color |
music.loop | string | 'all' | all / one / none | Loop mode |
music.order | string | 'random' | list / random | Playback order |
music.preload | string | 'auto' | none / metadata / auto | Preload strategy |
music.volume | number | 0.7 | 0–1 | Default volume (ignored after user adjustment) |
music.listFolded | bool | true | true / false | List folded by default |
music.hideLrc | bool | true | true / false | Hide lyrics |
musics.* | — | same as music | as above | Standalone music page config |
musics.listMaxHeight | string | "525px" | any CSS length | Max list height |
9.4 Boundaries & conflicts
musicandmusicsare two separate configs: the former is site-wide/homepage, the latter is the standalone music page; they do not override each other.titleonly works in non-fixed mode.volumeis only an initial value — the player remembers user settings, so config changes do not affect returning visitors.autoplay: trueis often blocked by browser autoplay policies and needs a first user interaction.
9.5 Summary
- Minimum viable:
enable+server+type+id, four items. - Don’t cover content: set
fixed: falsefor card mode. - Volume change has no effect: clear localStorage, or verify in a private window.
10. Video Player (DPlayer)
Purpose: embed a DPlayer video player in posts, supporting local videos, HLS live streams and danmaku.
Learning path: minimal tag → add cover/danmaku → full parameters → conflicts
10.1 How to enable
Effect: a video player with playback controls (play/pause/progress/volume/speed) appears in the post, sized responsively to its container.
Corresponding config: no theme config needed — provided by the hexo-tag-mmedia plugin (DPlayer asset paths in the libs.js.dplayer config).
Example ({% mmedia %} tag; the first argument selects the player type):
{% mmedia dplayer url=/medias_webp/video/demo.mp4 %}The example path is illustrative — replace it with your own video file (local path or remote URL).
10.2 Common options
① Cover image
Effect: the cover given by pic shows before playback and disappears after you press play.
Corresponding config:
{% mmedia dplayer url=/medias_webp/video/demo.mp4 pic=/medias_webp/featureimages/1.webp %}② Danmaku
Effect: a danmaku input box and danmaku layer appear in the player; id + api specify the danmaku backend.
Corresponding config:
{% mmedia dplayer url=https://example.com/demo.mp4 pic=/medias_webp/featureimages/1.webp id=123456 api=https://api.prprpr.me/dplayer/v3/ %}③ HLS live stream
Effect: when url points to a .m3u8, playback uses HLS (live/segmented stream); progress-bar behavior changes with the stream type.
Corresponding config:
{% mmedia dplayer url=https://example.com/live.m3u8 %}10.3 All tunable keys
| Parameter | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
url | string | — | video address or .m3u8 | Video source (required) |
pic | string | — | image path / URL | Cover image |
id | string | — | any string | Danmaku pool ID |
api | string | — | danmaku backend address | Danmaku API |
The above are the dplayer parameters of
hexo-tag-mmedia; the plugin supports other parameters too, other values unverified.
10.4 Boundaries & conflicts
- Player assets are loaded by
libs.js.dplayer; when missing, the tag leaves only an empty container. urlis required; a wrong path does not error, playback simply fails.- Danmaku needs
id+apisupplied as a pair; giving only one makes danmaku unavailable.
10.5 Summary
- Minimum viable: the
mmediatag + one linedplayer url=. - Want danmaku: provide
id+apitogether. - Live streaming: just change
urlto a.m3u8.
11. Bilibili Video Card
Purpose: embed a Bilibili video info card (cover, title, uploader, view count, duration).
Learning path: fill in the BV id → see the card → boundaries
11.1 How to enable
Effect: a Bilibili video card renders in the post with cover, title, uploader and play stats; clicking jumps to the original video.
Corresponding config: no theme config needed — provided by the hexo-bilibili-card-new plugin.
Example ({% bilicard %} tag + BV id; the API is fetched at build time to render the card):
{% bilicard BV1oa4y1L7mw %}11.2 Common options
① Change the video
Effect: swap in another BV id and the card’s cover/title/uploader change accordingly.
Corresponding config:
{% bilicard BV1xx4y1X7xx %}② Build-time fetch failure
Effect: when the API is unreachable the card degrades to a plain link or a blank block; the build is not interrupted.
Corresponding config: none needed; this is plugin behavior, and failure does not affect the rest of the post.
11.3 All tunable keys
| Parameter | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
| BV id | string | — | video id starting with BV | The video to embed |
Other plugin parameters unverified.
11.4 Boundaries & conflicts
- Card data is fetched at build time; later Bilibili data changes require a rebuild to update.
- Depends on external network access; without it the card is incomplete.
- It is a different tag from §10’s
{% mmedia %}; do not mix them up.
11.5 Summary
- Only a BV id needed:
{% bilicard BV... %}. - Data not updating: rebuild.
- Slow/failed build: check external network connectivity first.
12. ECharts
Purpose: embed ECharts interactive charts in posts (bar/line/pie etc.), with zoom and tooltips.
Learning path: load the library → minimal chart → full parameters → conflicts
12.1 How to enable
Effect: an interactive chart appears in the post: hovering shows tooltips, and legends can be clicked to toggle visibility.
Corresponding config (theme config echarts block, controls chart library loading):
echarts:
enable: true # load the ECharts library
version: "latest" # library version (default v6.1.0)Example ({% echarts %} tag; content is an ECharts option JSON; first arg is width, second is height):
{% echarts '81%' 400 %}
{
"title": {"text": "Sample chart"},
"xAxis": {"type": "category", "data": ["A", "B", "C"]},
"series": [{"data": [10, 20, 30], "type": "bar"}]
}
{% endecharts %}12.2 Common options
① Chart width and height
Effect: the first arg is width ('81%' relative to the container, '600px' also works), the second is height (pixels); the chart renders at that size.
Corresponding config:
{% echarts '81%' 400 %}② Change the chart type
Effect: change series[].type from bar to line / pie and the matching shape renders, with unchanged interactivity.
Corresponding config:
{% echarts '81%' 400 %}
{
"xAxis": {"type": "category", "data": ["A", "B", "C"]},
"series": [{"data": [10, 20, 30], "type": "line"}]
}
{% endecharts %}12.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
echarts.enable | bool | true | true / false | Whether to load the ECharts library |
echarts.version | string | "latest" | version number / latest (resolves to v6.1.0 by default) | Library version |
| Tag arg 1 (width) | string | — | CSS length or percentage | Chart width |
| Tag arg 2 (height) | number | — | pixels | Chart height |
| Tag content | JSON | — | ECharts option object | Chart config |
12.4 Boundaries & conflicts
- With
echarts.enable: falsethe library is not loaded and the tag leaves only an empty container. - Tag content must be valid JSON (no JS functions), otherwise parsing fails and the chart is blank.
- Charts initialize after content injection; when used inside encrypted/dynamically inserted content, re-render via the refresh callback.
12.5 Summary
- Two lines to load the library:
enable+version. - Chart not showing: validate the JSON first, then confirm the library loaded.
- Not drawn in encrypted posts: needs re-initialization after decryption.
13. Breathing Blink (blink)
Purpose: a breathing/flashing decorative effect for page elements.
Learning path: switch → see the effect → boundaries
13.1 How to enable
Effect: when enabled, certain elements (e.g. hint text, hr decorations) get a breathing animation with a light/dark gradient loop; disabled restores them to static.
Corresponding config (theme config):
blink:
enable: true # false | true13.2 Common options
① Disable blinking
Effect: the breathing animation disappears from all elements; the page returns to static.
Corresponding config:
blink:
enable: false② Related: hr styling
Effect: hr dividers change from the default thin line to a theme-styled decorative line (a lightweight styling switch like blink, but independent of it).
Corresponding config:
hr:
enable: false # false | true13.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
blink.enable | bool | true | true / false | Breathing blink switch |
hr.enable | bool | false | true / false | hr divider styling (related item) |
13.4 Boundaries & conflicts
- Only a switch, no speed/amplitude parameters; to tune the rhythm you must edit the styl source.
- Unrelated to §4’s
effects: this is element-level animation, not a page effect.
13.5 Summary
- One bool:
blink.enable. - Want to tune the rhythm: edit the source, not the config.
14. Online Customer Service (daovoice / tidio / tuxiaochao)
Purpose: three third-party online customer service/contact widgets — they don’t conflict and can run simultaneously.
Learning path: pick a platform → fill in credentials → see the entry → conflicts
14.1 How to enable
Effect: once enabled, that platform’s customer-service entry (floating bubble/button) appears at the bottom right of the page; clicking expands the chat window.
Corresponding config (DaoVoice as an example):
daovoice:
enable: true
app_id: your-app-id # DaoVoice app ID14.2 Common options
① DaoVoice
Effect: a DaoVoice floating entry appears at the bottom right; not loaded when app_id is empty.
Corresponding config:
daovoice:
enable: false
app_id: # DaoVoice app ID② Tidio
Effect: a Tidio chat bubble appears at the bottom right; public_key must be this site’s public key from the Tidio dashboard.
Corresponding config:
tidio:
enable: false
public_key: ki6lsd8zq8isma7plzmwzuxgpnaihind # Tidio public key③ Tencent Tuxiaochao
Effect: a Tuxiaochao feedback entry appears at the bottom right; clicking opens the product feedback page.
Corresponding config (see https://txc.qq.com/):
tuxiaochao:
enable: false
productId: 350806 # Tuxiaochao product ID14.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
daovoice.enable | bool | false | true / false | DaoVoice switch |
daovoice.app_id | string | empty | platform app ID | DaoVoice credentials |
tidio.enable | bool | false | true / false | Tidio switch |
tidio.public_key | string | ki6lsd8z... | platform public key | Tidio credentials |
tuxiaochao.enable | bool | false | true / false | Tuxiaochao switch |
tuxiaochao.productId | number | 350806 | platform product ID | Tuxiaochao credentials |
14.4 Boundaries & conflicts
- The three do not conflict and can be enabled together, but multiple entries stack at the bottom right (visually overlapping).
- All are third-party services requiring registration on the respective platform for credentials; wrong credentials fail silently.
- They introduce third-party scripts, affecting first paint and privacy policy — don’t enable them unless necessary.
14.5 Summary
- Off by default; enabling one as needed is enough.
- Don’t mistype credentials:
app_id/public_key/productIdeach control their own platform. - Don’t enable all three: the entries stack on top of each other.
15. Scroll Top Arrow (scroll_top_arrow)
Purpose: a one-click back-to-top arrow button in the bottom-right corner.
Learning path: switch → distinguish from §6 → boundaries
15.1 How to enable
Effect: a standalone up-arrow button appears at the bottom right; clicking smoothly returns to the top; it is a separate entry from §6’s #backTop.
Corresponding config (theme config):
scroll_top_arrow:
enable: true15.2 Common options
① Disable the arrow
Effect: the standalone arrow disappears; if #backTop still exists, back-to-top capability is unaffected.
Corresponding config:
scroll_top_arrow:
enable: false15.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
scroll_top_arrow.enable | bool | true | true / false | Standalone back-to-top arrow switch |
15.4 Boundaries & conflicts
- A separate entry from §6’s
#backTopfloating button; this config only controls the standalone arrow, shown whenenable: true. - With both enabled, two back-to-top controls may appear at the bottom right; turn one off based on visual preference.
- No position/color parameters; changing styles requires editing styl.
15.5 Summary
- One bool:
scroll_top_arrow.enable. - Two back-to-top buttons: keep just one.
16. Page Background (background)
Purpose: site-wide page background — image background (optionally random) or video background, plus a loading animation. This is a separate mechanism from the §4
effectspage effects.Learning path: enable the master switch → choose the default mode → configure the random image library → configure video → configure the loading animation → full parameters → conflicts
16.1 How to enable
Effect: the selected background (image or video) appears beneath the page, with cards optionally semi-transparent above it; the loading animation plays a transition on first entry.
Corresponding config (theme config):
background:
enable: true # master switch: false renders neither image nor video background
default: off # default background when the panel is unset: image | video | off16.2 Common options
① Image background (including random library)
Effect: with random: true, one image is picked randomly from lightPath / darkPath per light/dark theme (counts given by lightNum / darkNum); with false the fixed url is used.
Corresponding config:
background:
image:
enable: true
url: "{mediaUrl}/medias_webp/sea.webp" # default background on first visit
random: true # random background: pick one from the light/dark libraries
lightNum: 45 # number of light random images (0-based)
lightPath: /medias_webp/featureimages/ # light library path
darkNum: 22 # number of dark random images (0-based)
darkPath: /medias_webp/featureimages/dark/ # dark library path② Video background
Effect: randomly plays a video from the JSON list at url, overlaid with the cover; brightness decides whether that video suits the light or dark theme.
Corresponding config:
background:
video:
enable: true
url: /video_url.json?v=1.0.0 # video list JSON (local static file)
# structure [{video: webmURL, cover: webpURL, brightness: bright|dark}]③ Loading animation
Effect: on first entry the chosen transition animation plays (1 pacman / 2 blocks / 3 circles); time is the forced duration (ms), off disables it.
Corresponding config:
background:
loading:
enable: true
type: "off" # default type: off disabled | 1 pacman | 2 blocks | 3 circles
time: 350 # forced duration ms (1000=1s)④ Runtime switching (reader side)
Effect: the panel’s “Page Background” picks off / image / video and “Loading Animation” picks off / 1 / 2 / 3; the choice is written to localStorage and takes effect after refresh, with higher priority than background.default.
Corresponding call (equivalent to the panel operation):
localStorage.setItem('matery.bg', 'image'); // enable the image background after refresh
localStorage.setItem('matery.loading', '2'); // play the blocks loading animation after refresh
localStorage.removeItem('matery.bg'); // clear the preference → fall back to background.default16.3 All tunable keys
| Key | Type | Default | Allowed values / range | Effect |
|---|---|---|---|---|
background.enable | bool | true | true / false | Background master switch |
background.default | string | off | off / image / video | Default background mode with no local preference |
background.image.enable | bool | true | true / false | Image background switch |
background.image.url | string | {mediaUrl}/medias_webp/sea.webp | image path / URL | Default background image |
background.image.random | bool | true | true / false | Whether to pick images randomly |
background.image.lightNum | number | 45 | non-negative integer | Number of light random images |
background.image.lightPath | string | /medias_webp/featureimages/ | directory path | Light library path |
background.image.darkNum | number | 22 | non-negative integer | Number of dark random images |
background.image.darkPath | string | /medias_webp/featureimages/dark/ | directory path | Dark library path |
background.video.enable | bool | true | true / false | Video background switch |
background.video.url | string | /video_url.json?v=1.0.0 | JSON path | Video list address |
background.loading.enable | bool | true | true / false | Loading animation switch |
background.loading.type | string | "off" | off / 1 / 2 / 3 | Default animation type |
background.loading.time | number | 350 | ms | Forced duration |
localStorage["matery.bg"] | string | — | off / image / video | Runtime background preference |
localStorage["matery.loading"] | string | — | off / 1 / 2 / 3 | Runtime loading-animation preference |
16.4 Boundaries & conflicts
- Switch hierarchy is
background.enable(master) → each subenable→ panel selection; turning off any level stops rendering. - With
random: true, images are picked fromlightPath/darkPathlibraries by light/dark theme;lightNum/darkNumare the available image counts (0-based). - The video background’s
brightnessfield is filtered by theme (cover grayscale ≥90 = bright / <90 = dark). - Image and video are mutually exclusive (the panel’s
matery.bgis single-select); the loading animation is a separate single-select. - This is a different mechanism from §4
effects: background controls the underlying canvas, effects control falling/click animations.
16.5 Summary
- Minimum viable:
background.enable+default: image. - Change the image every time:
random: true+ library paths and counts. - Want to turn off the background area:
background.enable: false(the corresponding panel area disappears too).
17. Preference Panel (right-floating)
Purpose: the gear button (
#fp-toggle) in the bottom-right floating button group opens a “Preference Settings” panel, letting readers adjust reading preferences without touching code. The panel itself is always visible; the “Effects” and “Background” areas are shown/hidden byeffects.enable/background.enable.Learning path: font scaling → language/trad-simp → display mode → effects and background → section overview
17.1 How to enable
Effect: a gear button appears at the bottom right; clicking expands a panel with seven sections — font scaling, language/trad-simp, display mode, page effects, mouse effects, page background, loading animation; all choices persist across pages.
Corresponding config: the panel itself is always visible, with no YAML master switch; the “Effects” area is controlled by effects.enable and the “Background” area by background.enable.
effects:
enable: true # false → the panel's "page effects/mouse effects" area disappears
background:
enable: true # false → the panel's "page background/loading animation" area disappears17.2 Common options
① Font scaling
Effect: A− / A+ / Reset adjust in 0.1 steps (range 0.85–1.3); all rem-based font sizes scale proportionally site-wide and trigger a layout reflow; the choice is written to localStorage matery.font-scale.
Corresponding call (equivalent to clicking the buttons):
document.documentElement.style.setProperty('--font-scale', '1.2'); // site-wide font size ×1.2
localStorage.setItem('matery.font-scale', '1.2'); // persists after refresh② Language / trad-simp
Effect: the language dropdown switches the site language; the “Simp/Trad” segmented control uses the same mechanism as §5 (cookie + body conversion), and the body changes immediately after switching.
Corresponding call:
Matery.plugins.languageToggle(); // simp ↔ trad
Matery.plugins.languageToggle.getEncoding(); // current encoding③ Display mode
Effect: light / auto / dark single-select, reusing color-schema.js storage and the data-user-color-scheme attribute; the switch applies immediately and persists across refresh; choosing “auto” clears the local choice and returns to prefers-color-scheme.
Corresponding call:
document.documentElement.setAttribute('data-user-color-scheme', 'dark');
localStorage.setItem('Matery_Color_Scheme', 'dark'); // persists after refresh
document.documentElement.removeAttribute('data-user-color-scheme'); // back to auto④ Page effects / Mouse effects
Effect: each offers Off / Random / a specific effect; the choice is written to localStorage and applies after refresh (see §4).
Corresponding config:
localStorage.setItem('matery.effect.page', 'sakura');
localStorage.setItem('matery.effect.mouse', 'clicklove');⑤ Page background / Loading animation
Effect: background off / image / video single-select; loading animation off / 1 / 2 / 3 single-select (see §16).
Corresponding config:
localStorage.setItem('matery.bg', 'image');
localStorage.setItem('matery.loading', '2');17.3 All tunable keys
| Section | Storage key / config key | Value | Effect |
|---|---|---|---|
| Font scaling | localStorage["matery.font-scale"] | 0.85–1.3, step 0.1 | Site-wide font scale (CSS variable --font-scale) |
| Language | preference.default_lang / preference.lang_meta | see Installation & Theme Config | Site-wide language dropdown |
| Trad-simp | preference.translate.enable + button | true / false | Trad/simp conversion (§5) |
| Display mode | localStorage["Matery_Color_Scheme"] | light / dark / auto | Light/dark theme |
| Page effects | localStorage["matery.effect.page"] | off / random / id | Page decoration (§4) |
| Mouse effects | localStorage["matery.effect.mouse"] | off / random / id | Click decoration (§4) |
| Page background | localStorage["matery.bg"] | off / image / video | Background mode (§16) |
| Loading animation | localStorage["matery.loading"] | off / 1 / 2 / 3 | Transition animation (§16) |
17.4 Boundaries & conflicts
- The panel itself is always visible; only the “Effects” and “Background” areas are shown/hidden by
effects.enable/background.enable. - Font scaling changes
--font-scaleon<html>; root font size =calc(--font-size-base × --font-scale)(default 16px × 1); styles hardcoded in px do not scale. - Display mode shares the same localStorage key as
color-schema.js; both entries (menu button / panel) stay in sync. - Files involved: template
themes/matery/layout/_partial/common/right-floating.ejs; font-size variables inthemes/matery/source/css/_pages/_base/base.stylandcolor-schema.styl.
17.5 Summary
- Reader self-service: for most preference issues, have readers adjust the panel rather than editing config.
- Two areas can be hidden: turning off
effects.enable/background.enableremoves them from the panel. - Direct storage access: all preferences live in localStorage; clearing it falls back to config defaults.
Appendix: Interaction & Visual Feature Quick Reference
| Feature | Config location | Key params | Description |
|---|---|---|---|
| Code block enhancement | theme code | shrink/break/show_full/copy_btn/language | language label + copy/expand/fullscreen |
| Image lightbox | theme post.image_zoom | enable/img_url_replace | post images auto-wrapped .img-item |
| Typewriter | theme subtitle.typed / fun_features.typing / post.typed | loop/showCursor/typeSpeed | subtitle rotation + post titles |
| Page effects | theme effects | page/mouse 9/4 items, default: off/random/id | runtime switching via floating panel |
| Trad/Simp conversion | theme preference.translate | enable | migrated here (old footer.translate removed) |
| Progress bar | theme fun_features.progressbar | height_px/color | off by default |
| Back to top | built-in (right floating panel) | no config key | #backTop enabled by default |
| Reward | theme post.reward | wechat/alipay QR images | per-post override via front-matter reward |
| Print styles | built-in CSS (print.styl) | no config key | @media print auto-applies |
| Music APlayer | theme music / musics | server/type/id/fixed | MetingJS parsing, bottom-fixed option |
| Video DPlayer | npm plugin hexo-tag-mmedia | url/pic/id/api | {% mmedia dplayer %} |
| Bilibili card | npm plugin hexo-bilibili-card-new | BV id | {% bilicard BV... %} |
| ECharts | theme built-in tag plugin | enable/version | {% echarts %} JSON config |