The github.com/hbstack/hb
is the core module of HB framework, which automatically loads and compiles the module’s SCSS and TypeScript, as well as rendering HTML.
Module | github.com/hbstack/hb |
---|---|
Repository | ⭐ Please consider giving a star if your like it. |
Stars | |
Version | |
Used by | |
Requirements | |
License | |
Usage | See how to use modules. |
HB is built on top of HugoPress, a UI-less modular framework that defines several hooks for loading modules automatically.
HB module MUST be placed at the assets/hb/modules
folder, which has the following structure.
1tree assets/hb/modules/vendor-module
2├── js
3│ └── index.ts
4├── purgecss.config.toml
5└── scss
6 ├── index.scss
7 └── variables.tmpl.scss
HB will:
scss/variables.tmpl.scss
, and then loads and compiles scss/index.scss
into the CSS bundle.js/index.ts
into the JS bundle.purgecss.config.toml
used to add styles to PurgeCSS whitelist, in order to avoid getting removing.We recommend naming your HB module in form: vendor-name
, in order to avoid conflicting with HB built-in modules.
vendor
: your name or organization name.name
: the module name.custom
is reserved for users.See also creating a module.
Name | Type | Required | Default | Description |
---|---|---|---|---|
css_bundle_name | string | - | hb | The bundle name of CSS. |
color | string | - | light | Default color/mode, light or dark . |
debug | boolean | - | false | Debug mode. |
js_bundle_name | string | - | hb | The bundle name of JS. |
logo | string | - | images/logo.png | The logo path relative to assets folder. |
full_width | boolean/array | - | false | Whether to take full width, a boolean value or array of first level sections, e.g. ["docs", "blog"] . |
full_width_types | object | - | - | The content types to take full width, used by modules. |
hugo.toml
1[params]
2 [params.hb]
3 color = 'light'
4 css_bundle_name = 'hb'
5 debug = false
6 full_width = false
7 js_bundle_name = 'hb'
8 logo = 'images/logo.png'
hugo.yaml
1params:
2 hb:
3 color: light
4 css_bundle_name: hb
5 debug: false
6 full_width: false
7 js_bundle_name: hb
8 logo: images/logo.png
hugo.json
1{
2 "params": {
3 "hb": {
4 "color": "light",
5 "css_bundle_name": "hb",
6 "debug": false,
7 "full_width": false,
8 "js_bundle_name": "hb",
9 "logo": "images/logo.png"
10 }
11 }
12}
Name | Type | Required | Default | Description |
---|---|---|---|---|
full_width | boolean | - | false | When true then the current page takes full width, otherwise fallback to the site’s full_width . |
Name | Description |
---|---|
hb-main | For .hb-main . |
Name | Description |
---|---|
hb-body-begin | Follows the body-begin hook. |
hb-body-end | Before the body-end hook. |