Global Configuration
This page covers the blog’s global configuration: site info, URL & permalinks, theme basics (Logo/Favicon), banner background, and the CDN mechanism. This is the foundation of the whole blog — every other config chapter builds on top of it.
Config has two layers: site config
_config.yml(Hexo core + plugins) and theme config (layout/appearance/interaction). In this project the theme config file is overwritten by theuserConfig/_config.tmp.ymltemplate during CI builds — edit the template for theme config changes (see the Installation & Theme Config chapter). Unless marked “root config”, everything on this page is theme config.How to read: every section follows “How to enable → Common options → All tunable keys → Boundaries & conflicts”. See the effect first, then the corresponding config that produces it — copy and use.
1. Site Info
Purpose: site name, subtitle, description, author and other basic info; affects the title bar, SEO and site-wide text.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
1.1 How to enable
Effect: the browser tab shows “夜法之书”, the header shows the site name and subtitle, and search results / share cards use description.
Corresponding config (root config _config.yml):
title: 夜法之书
subtitle: '深度思考,深入生活!所有文章均持续滚动更新!'
description: '~软件驱动世界~个人独立技术博客,关于Linux,开源,Nas,Docker,嵌入式,理财,健身等主题!'
author: 夜法之书
language: zh-CN
timezone: Asia/Shanghai1.2 Common options
① Site title and subtitle
Effect: title appears in the tab and the header; subtitle appears in the banner typewriter and under the header.
Corresponding config:
title: 夜法之书
subtitle: '深度思考,深入生活!'② Site description
Effect: the SEO meta description and the RSS description use this text.
Corresponding config:
description: '个人独立技术博客'③ Author fallback
Effect: when a post’s front-matter has no author, the page shows this; if set, front-matter wins.
Corresponding config:
author: 夜法之书④ Language and timezone
Effect: language decides html lang and date localization; timezone decides which timezone post dates are rendered in.
Corresponding config:
language: zh-CN
timezone: Asia/Shanghai1.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
title | string | — | any string | site title |
subtitle | string | — | any string | site subtitle |
description | string | — | any string | SEO description |
author | string | — | any string | site-wide default author |
language | string | zh-CN | language code | site language |
timezone | string | — | IANA timezone, e.g. Asia/Shanghai | date timezone |
1.4 Boundaries & conflicts
authoris the fallback author for posts — used when the post’s front-matter has noauthor.languageaffects the sitehtml langattribute and date localization.timezonemust match your readers’ timezone, otherwise post dates will shift.- These keys live in the root config, outside the scope of
userConfig/_config.tmp.ymloverrides.
1.5 Summary
- Minimum viable:
title+author+language - SEO: write
descriptioncarefully - Dates shifted: check
timezonefirst - Changes not taking effect: did you edit the root
_config.yml?
2. URL & Permalinks
Purpose: the site root URL and post link format. This blog uses abbrlink (CRC32 + hex) for short links, permanent after publishing.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
2.1 How to enable
Effect: post links look like https://blog.17lai.site/posts/8f9792ab/ — short and unrelated to the title; retitling a post doesn’t change its link.
Corresponding config (root config _config.yml):
url: https://blog.17lai.site
permalink: posts/:abbrlink/
abbrlink:
alg: crc32
rep: hex2.2 Common options
① Site root URL
Effect: canonical, sitemap and RSS absolute links are prefixed with it; a wrong value makes every outbound link point at the wrong domain.
Corresponding config:
url: https://blog.17lai.site② Link format
Effect: post URLs become /posts/<abbrlink>/; changing the format breaks all existing links.
Corresponding config:
permalink: posts/:abbrlink/③ Hash algorithm and representation
Effect: crc32 + hex produces 8-character hex short links; switching algorithms only affects new posts, since old abbrlinks are already written into front-matter.
Corresponding config:
abbrlink:
alg: crc32
rep: hex④ Whether drafts get short links
Effect: with drafts: true drafts also get an abbrlink; the default false generates it only on publish.
Corresponding config:
abbrlink:
drafts: true2.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
url | string | — | full site URL | absolute-link base |
permalink | string | — | path template, e.g. posts/:abbrlink/ | post link format |
abbrlink.alg | string | crc16 | crc16 / crc32 | hash algorithm |
abbrlink.rep | string | dec | dec / hex | representation |
abbrlink.drafts | bool | false | true / false | generate for drafts |
abbrlink.force | bool | false | true / false | force recompute (ignores cache, use with care) |
abbrlink.writeback | bool | false | true / false | write back to source files |
2.4 Boundaries & conflicts
writeback: false(since 2026-09-22) means the plugin does not write back to source files — it was disabled because a resident hexo server that reads a file mid-edit (empty) would clobber the source with a truncated object (seedocs/EXPERIENCE.md§55).abbrlinkis written into each post’s front-matter on first generation and stays fixed thereafter, so renaming posts won’t break old links.urlis the base of all absolute links (canonical, sitemap, RSS) — it must match the deployment domain in production.force: truerecomputes every short link, which invalidates all published links — only use it for a deliberate migration.
2.5 Summary
- Minimum viable:
url+permalink - Short links:
alg: crc32+rep: hex - Don’t enable
force: it kills old links - Don’t enable
writeback: the resident server can clobber source files
3. Theme Basics: Logo & Favicon
Purpose: site icon and header logo, currently sharing the same image.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
3.1 How to enable
Effect: the browser tab shows a custom icon; the left side of the header shows the same image as the logo.
Corresponding config (theme config):
favicon: /favicon.webp
logo: /favicon.webp3.2 Common options
① Change the site icon
Effect: the tab icon changes (webp/png/ico supported).
Corresponding config:
favicon: /my-icon.png② Change the header logo
Effect: the graphic on the left of the navbar changes; a separate horizontal logo is recommended.
Corresponding config:
logo: /my-logo.webp③ Default trad/simp conversion direction
Effect: the Chinese trad/simp conversion feature defaults to simplified or traditional.
Corresponding config:
zhDefaultEncoding: 23.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
favicon | string | — | image path | browser tab icon |
logo | string | — | image path | header logo |
zhDefaultEncoding | number | 2 | 1 (繁體) / 2 (简体) | default trad/simp direction |
3.4 Boundaries & conflicts
- Images placed at the
source/root are served statically. zhDefaultEncodingis the default direction of the Chinese trad/simp conversion feature, paired withpreference.translate(see the Multilingual & Wiki System chapter).- Browsers may cache the old favicon after replacement — force a refresh.
3.5 Summary
- Minimum viable:
favicon+logo - Brand feel: design the logo and favicon separately
- Icon not updating: clear the browser cache
4. Banner Background
Purpose: the header banner image on all pages. Supports daily rotation, random images, parallax scrolling, plus a typewriter subtitle overlay.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
4.1 How to enable
Effect: a large background image appears at the top of the page, with the subtitle typed out letter by letter and a blinking cursor.
Corresponding config (theme config):
banner:
enable: true
random: true4.2 Common options
① Daily rotation / fixed image
Effect: with enable: true a new image is picked each day; with false it always uses /medias_webp/banner/0.webp.
Corresponding config:
banner:
enable: false② Random image
Effect: picks a random image from featureImages; combined with enable: true this gives “a new image every day”.
Corresponding config:
banner:
random: true③ Parallax scrolling
Effect: when scrolling down, the background image and content move at different speeds, creating depth.
Corresponding config:
banner:
parallax: true④ Prevent over-cropping on mobile
Effect: constrains the minimum image aspect ratio so portrait screens don’t crop the image into a strip; 0 disables the constraint.
Corresponding config:
banner:
width_height_ratio: 1.0⑤ Typewriter subtitle
Effect: the subtitle appears letter by letter, can loop, and can show a cursor.
Corresponding config:
banner:
typed:
enable: true
loop: false
showCursor: true
cursorChar: "_"⑥ Typing speed
Effect: a larger typeSpeed types slower, a larger backSpeed deletes faster, and startDelay controls the pause before starting.
Corresponding config:
banner:
typed:
startDelay: 100
typeSpeed: 80
backSpeed: 504.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
banner.enable | bool | true | true / false | daily banner switch; false uses /medias_webp/banner/0.webp |
banner.random | bool | true | true / false | random featureimages image |
banner.parallax | bool | false | true / false | parallax scrolling |
banner.width_height_ratio | number | 1.0 | 0 (off) / positive number | minimum image aspect ratio |
banner.typed.enable | bool | true | true / false | typewriter effect |
banner.typed.loop | bool | false | true / false | whether to loop |
banner.typed.showCursor | bool | true | true / false | show cursor |
banner.typed.cursorChar | string | "_" | single character | cursor character |
banner.typed.startDelay | number | 100 | milliseconds | start delay |
banner.typed.typeSpeed | number | 80 | milliseconds/char | typing speed |
banner.typed.backSpeed | number | 50 | milliseconds/char | deleting speed |
4.4 Boundaries & conflicts
- With
random: trueimages are picked fromfeatureimages; combined withenable: truethis gives “a new image every day”. - The
typedtypewriter renders the subtitle (the sitesubtitleor the homepageindex.slogan.text, see the Navigation Menu & Homepage chapter). - When
background.image.randomis enabled the post banner is hidden (see the Post Page Config chapter §1).
4.5 Summary
- Minimum viable:
enable: true - Fixed image:
enable: false - Want motion:
parallax+typed - Portrait cropping: adjust
width_height_ratio
5. CDN Mechanism
Purpose: serve all static assets (JS/CSS/images) via CDN. This project uses jsDelivr + placeholder injection: templates contain
{cdnPathVersion}and other placeholders, replaced with real CDN URLs at CI build time.Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
5.1 How to enable
Effect: after building, JS/CSS links in the pages point to jsDelivr versioned paths and the browser loads from the CDN; a direct local hexo generate still keeps the placeholders (unreplaced).
Corresponding config (theme config):
jsDelivr:
url: {cdnPathVersion}
cdn:
url: "{cdnUrl}"
mediaUrl: "{mediaUrl}"
resUrl: "{resUrl}"5.2 Common options
① Versioned CDN path
Effect: asset URLs carry a version like @1.1, so browsers fetch new files after a release.
Corresponding config:
jsDelivr:
url: {cdnPathVersion}② latest path
Effect: always points at the latest version (not recommended in production — cache is uncontrollable). Currently commented out and not enabled.
Corresponding config:
jsDelivr:
latesturl: #{cdnPathLatest}③ Three asset domains
Effect: JS/CSS, images/media and other resources are loaded from their own domains.
Corresponding config:
cdn:
url: "{cdnUrl}"
mediaUrl: "{mediaUrl}"
resUrl: "{resUrl}"5.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
jsDelivr.url | string | — | URL containing {cdnPathVersion} | versioned CDN path |
jsDelivr.latesturl | string | — | URL containing {cdnPathLatest} | latest path (currently commented) |
cdn.url | string | — | contains {cdnUrl} | JS/CSS CDN |
cdn.mediaUrl | string | — | contains {mediaUrl} | image/media CDN |
cdn.resUrl | string | — | contains {resUrl} | resource CDN (default https://cfblog.17lai.site) |
Placeholders and build-time replacement (done by userConfig/_config.tmp.yml + tools/cicd.sh sed):
| Placeholder | Replaced with | Example |
|---|---|---|
{cdnPathVersion} | jsDelivr versioned path | https://cdn.jsdelivr.net/gh/appotry/hexo@1.1 |
{cdnPathLatest} | latest CDN path | https://cdn.jsdelivr.net/gh/appotry/hexo@latest |
{urlVersion} | file version number | ?v={urlVersion} |
{cdnUrl} / {mediaUrl} / {resUrl} | CDN domains | https://cfblog.17lai.site |
5.4 Boundaries & conflicts
- When writing config here you don’t need to care about placeholders — keep
{xxx}as-is, CI handles it. - Release timing: after changing JS/CSS run
tools/cicd.sh -r "feature"to bump the version (tools/.VERSION), otherwise browsers/PWA cache the old version; content-only changes use-cor-d. - A direct
hexo generatedoes not replace placeholders, so assets 404 — you must go through the CI scripts.
5.5 Summary
- Minimum viable: leave the template placeholders untouched
- Changing assets: must use
-rto bump the version - Don’t use latest: production cache is uncontrollable
- Local 404: CI injection was skipped
6. Site Running Time (time)
Purpose: show “This site has been running for N years N days” in the footer, counted from the configured launch date.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
6.1 How to enable
Effect: the footer shows “This site has been running for 6 years 3 months 12 days”, and the numbers grow automatically over time.
Corresponding config (theme config):
time:
enable: true
year: 2020
month: 06
date: 28
hour: 00
minute: 00
second: 006.2 Common options
① Change the launch date
Effect: the running duration is recalculated from the new date.
Corresponding config:
time:
year: 2021
month: 01
date: 01② Turn off the running time
Effect: the footer no longer shows the running duration.
Corresponding config:
time:
enable: false6.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
time.enable | bool | true | true / false | running-time switch |
time.year | number | — | year | launch year |
time.month | number | — | 1–12 | launch month |
time.date | number | — | 1–31 | launch day |
time.hour | number | — | 0–23 | hour |
time.minute | number | — | 0–59 | minute |
time.second | number | — | 0–59 | second |
6.4 Boundaries & conflicts
- Set the time to when the blog first went live; the footer automatically calculates and displays the running duration.
- Keep the leading
0inmonth(e.g.06) to avoid YAML parsing ambiguity.
6.5 Summary
- Minimum viable:
enable+ year/month/day - Just launched: use today’s date
- Don’t want to show it:
enable: false
7. Fork Me Badge (githubLink)
Purpose: show a “Fork Me on GitHub” corner badge in the header, linking to your repository.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
7.1 How to enable
Effect: a diagonal “Fork Me on GitHub” ribbon appears in the top-right corner; clicking it jumps to the repository.
Corresponding config (theme config):
githubLink:
enable: true
url: https://github.com/appotry/hexo
title: Fork Me7.2 Common options
① Change the repository URL
Effect: clicking the badge jumps to your repository.
Corresponding config:
githubLink:
url: https://github.com/you/your-repo② Change the copy
Effect: the text on the ribbon changes.
Corresponding config:
githubLink:
title: View Source7.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
githubLink.enable | bool | false | true / false | badge switch |
githubLink.url | string | — | repository URL | target address |
githubLink.title | string | Fork Me | any string | badge text |
7.4 Boundaries & conflicts
- With
enable: truethe badge shows in the header;urlpoints to your GitHub repository. - This and the GitHub link in the navigation menu are two independent entry points — you can keep just one.
7.5 Summary
- Minimum viable:
enable+url - Keep it subtle: leave it disabled
- Localize the copy: change
title
8. Theme Colors (color)
Purpose: site-wide color scheme — PWA theme color, background, navbar, text, with light/dark pairs. Use custom CSS for colors not covered here.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
8.1 How to enable
Effect: the site background, navbar, body text and secondary text are colored by config; switching to dark mode automatically uses the *_dark values.
Corresponding config (theme config):
color:
theme_color: "#7e9fc4"
body_bg_color: "#eee"
body_bg_color_dark: "#181c27"8.2 Common options
① Background color (light/dark)
Effect: the page background changes, with cards floating on top.
Corresponding config:
color:
body_bg_color: "#f5f5f5"
body_bg_color_dark: "#181c27"② Navbar colors
Effect: the top menu background and text colors change.
Corresponding config:
color:
navbar_bg_color: "rgba(255, 255, 255, 0.8)"
navbar_text_color: "#f8f8f8"③ Body and secondary text
Effect: the body text gets darker/lighter; secondary text such as excerpts uses sec_text_color.
Corresponding config:
color:
text_color: "#3c4858"
sec_text_color: "#718096"④ PWA theme color
Effect: the mobile browser address bar and the PWA splash screen use this color (manifest + theme-color meta).
Corresponding config:
color:
theme_color: "#7e9fc4"8.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
color.theme_color | string | "#7e9fc4" | color value | PWA theme color |
color.body_bg_color | string | "#eee" | color value | body background |
color.body_bg_color_dark | string | "#181c27" | color value | dark background |
color.navbar_bg_color | string | "rgba(255, 255, 255, 0.8)" | color value | top menu background |
color.navbar_bg_color_dark | string | "#1f3144" | color value | dark menu background |
color.navbar_text_color | string | "#f8f8f8" | color value | top menu text |
color.navbar_text_color_dark | string | "#d0d0d0" | color value | dark menu text |
color.subtitle_color | string | "#f8f8f8" | color value | subtitle color |
color.subtitle_color_dark | string | "#d0d0d0" | color value | dark subtitle color |
color.text_color | string | "#3c4858" | color value | global text |
color.text_color_dark | string | "#c4c6c9" | color value | dark text |
color.sec_text_color | string | "#718096" | color value | secondary text |
color.sec_text_color_dark | string | "#a7a9ad" | color value | dark secondary text |
8.4 Boundaries & conflicts
- Every color key has a matching
*_darkvalue — adjust both when changing colors. - Color inspiration: LOL Colors.
- Colors ultimately flow through three layers:
_variables/base.styl→:rootCSS variables →color-schema.styl; writing.cssdirectly gets overwritten by the build.
8.5 Summary
- Minimum viable: change only
theme_color - Full re-skin: change light and dark pairs together
- Don’t change only half: missing
*_darkmakes dark mode jarring - Style changes go in
.styl: don’t touch build artifacts
9. Fonts (font)
Purpose: site-wide body font size, font family, letter spacing and code font size.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
9.1 How to enable
Effect: the body renders at the specified size and font family, and the code block size scales proportionally to the body.
Corresponding config (theme config):
font:
font_size: 16px
font_family:
letter_spacing: 0.02em
code_font_size: 85%9.2 Common options
① Body font size
Effect: site-wide body text gets larger/smaller, with line height following proportionally.
Corresponding config:
font:
font_size: 18px② Font family
Effect: leaving it empty uses the theme’s default font stack; filling in a font name prioritizes that font (it must exist on the user’s machine or already be loaded).
Corresponding config:
font:
font_family: "Noto Sans SC"③ Letter spacing
Effect: the spacing between Chinese characters changes, making CJK typography looser/tighter.
Corresponding config:
font:
letter_spacing: 0.05em④ Code font size
Effect: code block text scales as a percentage of the body; 85% is slightly smaller than the body.
Corresponding config:
font:
code_font_size: 90%9.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
font.font_size | string | 16px | CSS length with unit | body font size |
font.font_family | string | empty (theme default) | font family name | body font |
font.letter_spacing | string | 0.02em | CSS length | letter spacing |
font.code_font_size | string | 85% | percentage | code font size (relative to body) |
9.4 Boundaries & conflicts
- Leaving
font_familyempty uses the theme’s default font stack; code font size scales as a percentage of the body size. - Custom fonts require loading the font files yourself (the theme does not pull web fonts automatically).
- Font size and the §10
design.font_size_*are two systems:font.font_sizeis the body baseline,design.font_size_*is the component size scale.
9.5 Summary
- Minimum viable: change only
font_size - Looser CJK: adjust
letter_spacing - Code too small:
code_font_size: 90% - Font not applying: the user’s machine lacks that font
10. Design Tokens (design)
Purpose: design tokens for radius/shadow/transition/gradient/spacing/font-size scales, mapped to CSS variables by
color-schema.styland referenced by all components.Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
10.1 How to enable
Effect: card radius, hover shadows, button gradients, component spacing and font sizes all render from tokens; change one token and every element of the same kind changes site-wide.
Corresponding config (theme config):
design:
radius_md: 8px
shadow_md: "0 2px 5px 0 rgba(0,0,0,0.16)"
transition_normal: 0.3s
space_4: 16px
font_size_md: 1.125rem10.2 Common options
① Radius
Effect: radius_sm affects buttons/small tags, radius_md cards, radius_lg modals, radius_pill capsules, radius_full circles.
Corresponding config:
design:
radius_sm: 3px
radius_md: 8px
radius_lg: 12px
radius_pill: 999px
radius_full: 50%② Shadows
Effect: shadow_sm for hover micro-shadows, shadow_md for default cards, shadow_lg for card hover, shadow_xl for modals/overlays; dark mode uses *_dark.
Corresponding config:
design:
shadow_sm: "0 1px 3px 0 rgba(0,0,0,0.12)"
shadow_md: "0 2px 5px 0 rgba(0,0,0,0.16)"
shadow_md_dark: "0 2px 5px 0 rgba(0,0,0,0.45)"③ Transition durations
Effect: fast for hover feedback, normal for panel/modal expansion.
Corresponding config:
design:
transition_fast: 0.2s
transition_normal: 0.3s④ Gradients
Effect: gradient_primary for navbar/buttons, gradient_accent for card decoration.
Corresponding config:
design:
gradient_primary: "linear-gradient(to right, #4facfe, #00f2fe)"
gradient_accent: "linear-gradient(135deg, #667eea, #764ba2)"⑤ Spacing and font-size scales
Effect: component padding takes values from space_*; font sizes take values from font_size_* and scale with --font-scale.
Corresponding config:
design:
space_1: 4px
space_4: 16px
font_size_md: 1.125rem
font_size_2xl: 2rem10.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
design.radius_sm | string | 3px | CSS length | button/small-tag radius |
design.radius_md | string | 8px | CSS length | card/note radius |
design.radius_lg | string | 12px | CSS length | modal radius |
design.radius_pill | string | 999px | CSS length | capsule radius |
design.radius_full | string | 50% | percentage | circle |
design.shadow_sm | string | "0 1px 3px 0 rgba(0,0,0,0.12)" | CSS box-shadow | hover micro-shadow |
design.shadow_md | string | "0 2px 5px 0 rgba(0,0,0,0.16)" | CSS box-shadow | default card shadow |
design.shadow_lg | string | "0 5px 11px 0 rgba(0,0,0,0.18)" | CSS box-shadow | card hover |
design.shadow_xl | string | "0 10px 30px 0 rgba(0,0,0,0.2)" | CSS box-shadow | modal/overlay |
design.shadow_sm_dark | string | "0 1px 3px 0 rgba(0,0,0,0.4)" | CSS box-shadow | dark micro-shadow |
design.shadow_md_dark | string | "0 2px 5px 0 rgba(0,0,0,0.45)" | CSS box-shadow | dark card shadow |
design.shadow_lg_dark | string | "0 5px 11px 0 rgba(0,0,0,0.5)" | CSS box-shadow | dark hover |
design.shadow_xl_dark | string | "0 10px 30px 0 rgba(0,0,0,0.55)" | CSS box-shadow | dark overlay |
design.transition_fast | string | 0.2s | CSS time | hover feedback |
design.transition_normal | string | 0.3s | CSS time | panel/modal |
design.gradient_primary | string | — | CSS gradient | navbar/buttons |
design.gradient_accent | string | — | CSS gradient | card decoration |
design.space_1 | string | 4px | CSS length | spacing scale 1 |
design.space_2 | string | 8px | CSS length | spacing scale 2 |
design.space_3 | string | 12px | CSS length | spacing scale 3 |
design.space_4 | string | 16px | CSS length | spacing scale 4 |
design.space_5 | string | 24px | CSS length | spacing scale 5 |
design.font_size_xs | string | 0.75rem | rem | font-size scale xs |
design.font_size_sm | string | 0.875rem | rem | font-size scale sm |
design.font_size_md | string | 1.125rem | rem | font-size scale md |
design.font_size_lg | string | 1.25rem | rem | font-size scale lg |
design.font_size_xl | string | 1.5rem | rem | font-size scale xl |
design.font_size_2xl | string | 2rem | rem | font-size scale 2xl |
10.4 Boundaries & conflicts
- This is the theme’s design-system layer — components reference these tokens, so one change applies globally.
- Keep the scale system when adjusting (radius/shadow/spacing each form a ladder); don’t break consistency by changing a single value.
- Font sizes are rem-based and scale with the root
--font-scalevariable (site-wide proportional scaling when the user adjusts font size) — don’t replace them with fixed px values. - Colors are not in this section: colors live in the §8
colorsection.
10.5 Summary
- Minimum viable: adjust only
radius_md/shadow_md - Change the style: change the whole group, keep the ladder
- Don’t use px for font sizes: keep rem
- Colors go to §8: this section only covers radius/shadow/spacing
11. Web Analytics (web_analytics)
Purpose: site-wide visitor analytics, supporting Baidu Analytics, Google Analytics 4 and self-hosted umami — all can run simultaneously.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
11.1 How to enable
Effect: after the page loads it reports PV/UV to the analytics service; the footer can show total visits and total visitors.
Corresponding config (theme config):
web_analytics:
enable: true
umami:
enable: true
src: https://ana.17lai.site/script.js
api_server: https://ana.17lai.site
website_id: "your-website-id"11.2 Common options
① Turn off analytics
Effect: no analytics script is injected at all.
Corresponding config:
web_analytics:
enable: false② Respect DNT
Effect: visitors whose browser has “Do Not Track” enabled are not counted.
Corresponding config:
web_analytics:
follow_dnt: true③ Baidu Analytics
Effect: data goes to the Baidu Analytics dashboard.
Corresponding config:
web_analytics:
baidu:
enable: true
id: your-baidu-id④ Google Analytics 4
Effect: data goes to the GA4 property.
Corresponding config:
web_analytics:
google:
enable: true
measurement_id: 'G-XXXXXXXXXX'⑤ umami footer PV/UV
Effect: the footer shows total visits and total visitors (with footer.statistics).
Corresponding config:
web_analytics:
umami:
totalTraffic: true
totalNumberOfvisitors: true⑥ Analytics start time and API
Effect: only data after start_time is counted; api_server and website_id decide which instance to read from.
Corresponding config:
web_analytics:
umami:
start_time: '2023-01-01'
api_server: https://ana.17lai.site
website_id: "your-website-id"11.3 All tunable keys
| Key | Type | Default | Options/Range | Purpose |
|---|---|---|---|---|
web_analytics.enable | bool | true | true / false | analytics master switch |
web_analytics.follow_dnt | bool | false | true / false | respect DNT |
web_analytics.baidu.enable | bool | false | true / false | Baidu Analytics |
web_analytics.baidu.id | string | — | Baidu Analytics ID | site identifier |
web_analytics.baiduPush | bool | false | true / false | Baidu Search Resource submission |
web_analytics.google.enable | bool | false | true / false | GA4 |
web_analytics.google.measurement_id | string | — | starts with G- | GA4 property |
web_analytics.umami.enable | bool | true | true / false | umami |
web_analytics.umami.totalTraffic | bool | true | true / false | footer total visits |
web_analytics.umami.totalNumberOfvisitors | bool | true | true / false | footer total visitors |
web_analytics.umami.pageStats | bool | true | true / false | page stats |
web_analytics.umami.src | string | — | JS URL | umami script |
web_analytics.umami.start_time | string | '2023-01-01' | YYYY-MM-DD (must be quoted) | analytics start time |
web_analytics.umami.token | string | — | viewOnly token | advanced stats |
web_analytics.umami.api_server | string | — | server URL | umami server |
web_analytics.umami.website_id | string | — | site ID | umami site |
11.4 Boundaries & conflicts
- umami’s
totalTraffic/totalNumberOfvisitorsdrive the footer PV/UV display (withfooter.statistics). start_timeshould be when the umami site was created and must be quoted, otherwise YAML parses it as a Date object and JSON.stringify turns it into{}.tokenrequires creating a viewOnly user in the umami admin.- All three analytics can run simultaneously, but that double-reports; usually keep just one.
11.5 Summary
- Minimum viable:
enable+ umami’ssrc/website_id - Footer PV/UV:
totalTraffic+totalNumberOfvisitors - Always quote
start_time - Don’t enable all three: duplicate reporting
Appendix: Global Config Quick Reference
| Config item | Location | Description |
|---|---|---|
title / subtitle / description | root _config.yml | site basic info |
author / language / timezone | root _config.yml | author fallback, language, timezone |
url / permalink | root _config.yml | site root URL + posts/:abbrlink/ link format |
abbrlink | root _config.yml | crc32+hex short links, writeback: false (no writeback, prevents resident-server clobbering) |
logo / favicon | theme config | header logo and site icon |
zhDefaultEncoding | theme config | default trad/simp conversion direction |
banner | theme config | daily rotation/random images/parallax/typewriter |
jsDelivr / cdn | theme config | CDN placeholders (replaced at CI time) |
time | theme config | footer running duration |
githubLink | theme config | Fork Me badge |
color | theme config | site-wide light/dark colors |
font | theme config | font size/family/letter spacing |
design | theme config | radius/shadow/transition/gradient/spacing/font-size tokens |
web_analytics | theme config | Baidu/GA4/umami analytics |
Suggested reading order: configure §1–§3 first (site identity and icons), then §4 (banner look), then §6–§10 (footer, colors, fonts, tokens), and finally §11 analytics. §5 CDN is only for release troubleshooting — leave the placeholders untouched day to day.