页头模块是一个通用的顶部应用栏,其带有一些实用的子模块,比如搜索表单、社交链接、浅色/深色切换以及语言切换等。
| Module | github.com/hbstack/header | 
|---|---|
| Repository | ⭐ Please consider giving a star if your like it. | 
| Stars | |
| Version | |
| Used by | |
| Requirements | |
| License | |
| Usage | See how to use modules. | 
| Parameter | Type | Default | Description | 
|---|---|---|---|
| brand | string | 站点标题 | 品牌文本。 | 
| breakpoint | string | lg | 当屏幕宽度小于 breakpoint 时折叠,否则展开。可选项: lg、xl、xxl。 | 
| full_width | boolean | true | 是否全宽。 | 
| logo_bg | string | - | Logo 背景色 background,用于透明背景的 Logo。 | 
| menus_alignment | string | start | 菜单对齐: start、center和end。 | 
| sticky | boolean | true | 是否固定头部。 | 
| theme | string | - | 自 v0.4.0删除,另请参阅主题。 | 
logo参数属于核心模块。
hugo.toml
 1[params]
 2  [params.hb]
 3    logo = 'images/logo.png'
 4    [params.hb.header]
 5      brand = ''
 6      breakpoint = 'lg'
 7      full_width = true
 8      logo_bg = 'indigo'
 9      menus_alignment = 'start'
10      sticky = true
hugo.yaml
 1params:
 2  hb:
 3    header:
 4      brand: ""
 5      breakpoint: lg
 6      full_width: true
 7      logo_bg: indigo
 8      menus_alignment: start
 9      sticky: true
10    logo: images/logo.png
hugo.json
 1{
 2   "params": {
 3      "hb": {
 4         "header": {
 5            "brand": "",
 6            "breakpoint": "lg",
 7            "full_width": true,
 8            "logo_bg": "indigo",
 9            "menus_alignment": "start",
10            "sticky": true
11         },
12         "logo": "images/logo.png"
13      }
14   }
15}
| Name | Description | 
|---|---|
| hb-header-nav-begin | 与页头导航开始处。 | 
| hb-header-togglers-begin | 于切换按钮开始处。 | 
| hb-header-togglers-end | 于切换按钮结束前。 | 
| hb-header-panel | 页头面板。 |