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. |
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. |
hugo.toml
1[params]
2 [params.hb]
3 css_bundle_name = 'hb'
4 debug = false
5 js_bundle_name = 'hb'
6 logo = 'images/logo.png'
hugo.yaml
1params:
2 hb:
3 css_bundle_name: hb
4 debug: false
5 js_bundle_name: hb
6 logo: images/logo.png
hugo.json
1{
2 "params": {
3 "hb": {
4 "css_bundle_name": "hb",
5 "debug": false,
6 "js_bundle_name": "hb",
7 "logo": "images/logo.png"
8 }
9 }
10}
| 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. |