Navigation Menu & Homepage
This page explains the configuration of the top navigation menu (level-1/level-2 menus) and the homepage (cover carousel, banner, post waterfall). Everything is done in the theme config.
The authoritative source of the theme config is
userConfig/_config.tmp.yml(it overwrites the theme config at CI time); all sections below come from it.Reading guide: every section follows 「How to enable → Common options → All tunable keys → Boundaries & conflicts」 — check the Effect first, then the Corresponding config that produces it, and copy it to use.
1. Navigation Menu (menu)
Purpose: menu items in the top navbar. Supports level-1 menus (direct links) and level-2 menus (children dropdowns).
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
1.1 How to enable
Effect: menu items appear in the top bar of the page; hovering an item with children opens a dropdown panel, and clicking navigates to the matching URL.
Corresponding config (theme config, menu section):
menu:
home: # level-1 menu: direct link
url: / # level-1 menus must have url (can omit when children exist)
icon: fas fa-home # Font Awesome icon (v5.15 icon names)
class: menu-2d-home # live2d selector: positions the tooltip box
nav:
url: https://nav.17lai.site/
icon: fas fa-suitcase
class: menu-2d-nav
target: _blank # open in a new tab
so:
url: https://so.17lai.site/
icon: fas fa-mask
class: menu-2d-sosuo
target: _blank
multimedia: # level-2 menu: children array
icon: fas fa-music
class: menu-2d-media
children:
- name: music # menu display name (i18n key)
url: /musics/
icon: fas fa-music
class: menu-2d-musics
- name: gallery
url: /galleries/
icon: fas fa-image
- name: movie
url: /movies/
icon: fas fa-film
posts:
icon: fas fa-folder-plus
children:
- name: tags # /tags/ tag page
url: /tags/
icon: fas fa-tags
- name: categories # /categories/ category page
url: /categories/
icon: fas fa-bookmark
- name: archives # /archives/ archive page
url: /archives/
icon: fas fa-archive1.2 Common options
① Add a level-1 menu
Effect: an extra icon menu item appears in the top bar; clicking it jumps directly to that URL.
Corresponding config:
menu:
about:
url: /about/
icon: fas fa-user② Add a level-2 menu
Effect: the menu becomes a dropdown panel whose children open on hover.
Corresponding config:
menu:
posts:
icon: fas fa-folder-plus
children:
- name: tags
url: /tags/
icon: fas fa-tags③ Open an external link in a new window
Effect: clicking opens a new tab instead of leaving the site.
Corresponding config:
menu:
nav:
url: https://nav.17lai.site/
target: _blank1.3 All tunable keys
| Key | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|
menu.<name>.url | string | — | absolute site path or full URL | Level-1 menu link (required for level-1) |
menu.<name>.icon | string | — | Font Awesome v5.15 icon class | Menu icon |
menu.<name>.class | string | — | any class name | live2d tooltip positioning selector |
menu.<name>.target | string | — | _blank / _self | How the link opens |
menu.<name>.children | array | — | array of child items | Level-2 menu |
menu.<name>.children[].name | string | — | i18n key | Child menu display name |
menu.<name>.children[].url | string | — | site path or URL | Child menu link |
menu.<name>.children[].icon | string | — | Font Awesome class | Child menu icon |
menu.<name>.children[].class | string | — | any class name | live2d positioning selector |
1.4 Boundaries & conflicts
- Adding a menu: add an entry under
menu(level-1) or addchildrento a menu (level-2).nameis an i18n key (the matching copy inlanguages/zh-CN.yml); look upiconin Font Awesome v5.15;target: _blankopens external links in a new window. classis only for positioning the live2d mascot tooltip; omit it if you have no mascot.- Write menu
urlas/musics/(absolute path), notmusics, otherwise concatenation withurlmay break.
1.5 Summary
- Minimal setup: one
url+iconis a level-1 menu - Want a dropdown: switch to
children; the parent can omiturl - External links: remember
target: _blank - No relative paths:
/xxx/rather thanxxx
2. Homepage Cover Carousel (cover)
Purpose: the cover carousel of posts at the top of the homepage. Posts enter the carousel via
cover/coverImgin front-matter.Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
2.1 How to enable
Effect: a large-image carousel appears at the top of the homepage; you can switch with the left/right buttons and the bottom dots, it auto-rotates every intervalTime, and clicking an image opens the corresponding post.
Corresponding config (theme config, cover section):
cover:
showPrevNext: true # prev/next buttons
showIndicators: true # bottom indicators (dots)
autoLoop: true # auto rotation
duration: 180 # transition duration (ms)
intervalTime: 8000 # auto rotation interval (ms)
useConfig: false # true = use _data/covers.json for carousel posts
video:
enable: false # carousel background video (fill src with an array of video URLs)
src:
- https://example.com/video1.mp42.2 Common options
① Put a post into the carousel
Effect: that post’s cover appears in the carousel.
Corresponding config (post front-matter):
cover: true② Change the carousel image
Effect: the post uses the specified image in the carousel instead of its default cover.
Corresponding config (post front-matter):
coverImg: /path/to/img.webp③ Turn off auto rotation
Effect: manual switching only; it no longer advances every few seconds.
Corresponding config:
cover:
autoLoop: false④ Configure everything through a data file
Effect: carousel contents are decided by source/_data/covers.json; post front-matter is ignored.
Corresponding config:
cover:
useConfig: truePost front-matter control (priority notes from the config comments):
| front-matter key | Effect |
|---|---|
hide: true | fully hide the post (not in the homepage list, not in the cover carousel) |
cover: true | post enters the cover carousel (prerequisite: hide is not true) |
coverImg: /path/to/img.webp | custom carousel image (takes priority over the cover default) |
Priority:
hide: true>cover: true.hide: true + cover: true→ the post is fully hidden, not in the carousel.
2.3 All tunable keys
| Key | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|
cover.showPrevNext | bool | true | true / false | Prev/next buttons |
cover.showIndicators | bool | true | true / false | Bottom indicators |
cover.autoLoop | bool | true | true / false | Auto rotation |
cover.duration | number | 180 | milliseconds | Transition duration |
cover.intervalTime | number | 8000 | milliseconds | Auto rotation interval |
cover.useConfig | bool | false | true / false | Use _data/covers.json |
cover.video.enable | bool | false | true / false | Carousel background video |
cover.video.src | array | — | array of video URLs | Background video sources |
front-matter hide | bool | — | true | Fully hide the post |
front-matter cover | bool | — | true | Enter the carousel |
front-matter coverImg | string | — | image path | Custom carousel image |
2.4 Boundaries & conflicts
- With
useConfig: true, the post front-mattercover/coverImgstop working;_data/covers.jsondecides instead. hide: truehas the highest priority;cover: truehas no effect.- With
video.enable: truethe carousel background plays a video; ifsrcis empty nothing shows.
2.5 Summary
- Minimal setup: post front-matter
cover: true - Want a different image: add
coverImg - Hide one post:
hide: true, an absolute veto - Centralized control:
useConfig: true+covers.json
3. Homepage Banner & Subtitle
Purpose: the homepage hero image (independent of the global banner), the typewriter subtitle, buttons and social links, and the “dream” quote.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
3.1 How to enable
Effect: a full-screen banner at the top of the homepage (100% viewport height by default), with a 30% black mask over the image, a subtitle typed out character by character below the title, and a row of social icons on the right.
Corresponding config (theme config, index section):
index:
banner_img: /img/default.png # homepage hero image (relative or absolute path)
banner_img_height: 100 # hero image height (percentage of screen, 0-100)
banner_mask_alpha: 0.3 # black mask opacity (0-1, 1 = fully opaque)
slogan: # homepage subtitle, configured independently
enable: true
text: "An elegant Material-Design theme for Hexo" # empty = use hexo subtitle
api: # fetch the subtitle via API (returns JSON)
enable: false
url: ""
method: "GET" # GET | POST | PUT
headers: {}
keys: [] # value path, e.g. ['data','content']3.2 Common options
① Change the homepage hero image
Effect: the homepage banner switches to the specified image (homepage only, post pages unaffected).
Corresponding config:
index:
banner_img: /medias_webp/banner/home.webp② Adjust the banner height
Effect: 100 fills the whole screen, 50 keeps only half.
Corresponding config:
index:
banner_img_height: 50③ Change the subtitle
Effect: the typewriter text becomes the new string; if text is empty it falls back to the site subtitle.
Corresponding config:
index:
slogan:
enable: true
text: "Think deeply, live deeply"④ Provide the subtitle via API
Effect: the subtitle comes from a JSON field returned by the endpoint; on request failure it falls back to text.
Corresponding config:
index:
slogan:
api:
enable: true
url: "https://example.com/slogan.json"
method: "GET"
keys: ['data', 'content']Homepage-only widgets:
dream: # "dream" quote (text below the banner)
enable: true
showTitle: false
title: Dream
text: "All that I have lost was never mine…"
indexbtn: # second banner button
enable: true
name: GitHub
icon: fab fa-github
url: https://github.com/appotry
socialLink: # personal info row in the banner (leave empty to hide)
github: https://github.com/appotry
dockerhub: https://hub.docker.com/u/bloodstar
email: admin@17lai.fun
rss: true # true/false3.3 All tunable keys
| Key | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|
index.banner_img | string | — | image path or URL | Homepage hero image |
index.banner_img_height | number | 100 | 0–100 (percentage of viewport) | Hero image height |
index.banner_mask_alpha | number | 0.3 | 0–1 | Black mask opacity |
index.slogan.enable | bool | true | true / false | Subtitle switch |
index.slogan.text | string | — | any string | Subtitle text (empty = site subtitle) |
index.slogan.api.enable | bool | false | true / false | Fetch subtitle via API |
index.slogan.api.url | string | "" | URL | Endpoint address |
index.slogan.api.method | string | "GET" | GET / POST / PUT | Request method |
index.slogan.api.headers | map | {} | request headers | Custom request headers |
index.slogan.api.keys | array | [] | array of field paths | Value path |
dream.enable | bool | true | true / false | Quote switch |
dream.showTitle | bool | false | true / false | Whether to show the quote title |
dream.title | string | — | any string | Quote title |
dream.text | string | — | any string | Quote content |
indexbtn.enable | bool | true | true / false | Second button switch |
indexbtn.name | string | — | any string | Button label |
indexbtn.icon | string | — | Font Awesome class | Button icon |
indexbtn.url | string | — | URL | Button link |
socialLink.<platform> | string | — | URL or empty | Social icon link (empty = hidden) |
socialLink.rss | bool | — | true / false | RSS icon |
3.4 Boundaries & conflicts
index.banner_*applies to the homepage only; for the post-page hero image seepost.banner_*in the “Post Page Configuration” chapter.slogan.apidepends on the typewriter effect (fun_features.typing.enable); when that is off the API subtitle does not show.- Platforms left empty in
socialLinkrender no icon;rss: true/falseis a switch, not a link. - With
dream.showTitle: falseonlytextis shown.
3.5 Summary
- Minimal setup:
banner_img+slogan.text - Want it minimal: lower
banner_mask_alpha+ disabledream - No subtitle text: leave it empty to use the site
subtitle - API subtitle not working: enable the typewriter effect first
4. Homepage Post List (Waterfall)
Purpose: the homepage content area shows post cards in a waterfall (Masonry) layout. The layout is handled by the theme; config controls excerpts, link target, meta info and pinning.
Learning path: How to enable → Common options → All tunable keys → Boundaries & conflicts
4.1 How to enable
Effect: multi-column post cards appear below the homepage banner, each showing cover, title, date/category/tags; scrolling to the bottom loads the next page automatically.
Corresponding config (theme config, inside the index section):
index:
auto_excerpt:
enable: true # auto-extract post excerpts
post_url_target: _self # open posts: _blank new tab | _self same page
post_meta: # post card meta info
date: true
category: true
tag: true
post_sticky: # icon before pinned post titles
enable: true
icon: "iconfont icon-top"4.2 Common options
① Auto excerpt
Effect: cards show the first characters of the body instead of just the title.
Corresponding config:
index:
auto_excerpt:
enable: true② Open posts in a new tab
Effect: clicking a card opens it in a new tab.
Corresponding config:
index:
post_url_target: _blank③ Card meta info
Effect: show/hide date, category and tags on cards.
Corresponding config:
index:
post_meta:
date: true
category: true
tag: false④ Pin a post
Effect: posts with a larger sticky value rank first, with a pin icon before the title.
Corresponding config (post front-matter):
sticky: 1Post front-matter controls the card:
title: Example post
sticky: 1 # larger = higher (homepage pin)
index_img: /medias_webp/cover/5w2h.webp # card cover image
hide: false # true = hidden from the homepage list4.3 All tunable keys
| Key | Type | Default | Allowed values / range | Description |
|---|---|---|---|---|
index.auto_excerpt.enable | bool | true | true / false | Auto-extract excerpts |
index.post_url_target | string | _self | _blank / _self | How posts open |
index.post_meta.date | bool | true | true / false | Show date on cards |
index.post_meta.category | bool | true | true / false | Show category on cards |
index.post_meta.tag | bool | true | true / false | Show tags on cards |
index.post_sticky.enable | bool | true | true / false | Pin icon switch |
index.post_sticky.icon | string | — | icon class | Pin icon |
front-matter sticky | number | — | positive integer, larger = higher | Homepage pin weight |
front-matter index_img | string | post.default_index_img | image path | Card cover |
front-matter hide | bool | false | true / false | Hidden from the homepage list |
4.4 Boundaries & conflicts
- Without
index_img, the theme configpost.default_index_imgis the fallback (see the “Post Page Configuration” chapter); if both are empty no cover shows. - The waterfall layout is based on the Masonry library; it reflows automatically after images load — no manual maintenance.
hide: trueaffects both the homepage list and the cover carousel (see §2).
4.5 Summary
- Minimal setup: nothing to configure; the waterfall is the default
- Cards too plain: enable
auto_excerpt+ setindex_img - Want to pin: front-matter
sticky: 1 - One post shouldn’t appear:
hide: true
Appendix: Navigation & Homepage Quick Reference
| Feature | Config location | Description |
|---|---|---|
| Nav menu | theme menu | level-1 url/icon/class/target, level-2 children |
| Cover carousel | theme cover | auto rotation + indicators; front-matter cover/coverImg/hide |
| Homepage banner | theme index | banner_img/height/mask + slogan subtitle |
| Dream quote | theme dream | quote text below the banner |
| Homepage button | theme indexbtn | second button (name/icon/link) |
| Social links | theme socialLink | second-row icons, hidden when empty |
| Post list | theme index + front-matter | excerpt/link target/meta/pin/cover |