Hinode logo
  • About 
  • Docs 
  • Components 
  • Guides 
  • Releases 
  •  
Docs
  • Getting Started
    • Introduction
    • Commands
    • Hosting and Deployment
    • Upgrading
    • Private Modules and Packages
    • Contribute
    • Troubleshooting
  • Content
    • Content Management
    • Content Organization
    • Typography
    • Links and Cross-References
    • Images and Figures
    • Tables
    • Icons
  • Configuration
    • Layout
    • Colors
    • Color Modes
    • Fonts
    • Languages
    • Navigation
    • Documentation
    • Analytics
    • Modules
    • Cookie Consent
    • Digital Asset Managers
  • Components
    • Abbr
    • Accordion
    • Alert
    • Animation
    • Args
    • Badge
    • Breadcrumb
    • Button
    • Button Group
    • Card
    • Card Group
    • Carousel
    • Collapse
    • Command Prompt
    • Docs
    • Example
    • File
    • Icon
    • Image
    • Ins
    • Kbd
    • Link
    • Map
    • Mark
    • Navbar
    • Navs and Tabs
    • Persona
    • Release
    • Spinner
    • Sub
    • Sup
    • Table
    • Timeline
    • Toast
    • Tooltip
    • Video
  • Advanced Settings
    • Overview
    • Styles
    • Scripts
    • Icons
    • Partial Development
    • Module Development
    • Server Headers
    • Server-Side Redirection
  • About
    • Credits
    • License
  • Getting Started
    • Introduction
    • Commands
    • Hosting and Deployment
    • Upgrading
    • Private Modules and Packages
    • Contribute
    • Troubleshooting
  • Content
    • Content Management
    • Content Organization
    • Typography
    • Links and Cross-References
    • Images and Figures
    • Tables
    • Icons
  • Configuration
    • Layout
    • Colors
    • Color Modes
    • Fonts
    • Languages
    • Navigation
    • Documentation
    • Analytics
    • Modules
    • Cookie Consent
    • Digital Asset Managers
  • Components
    • Abbr
    • Accordion
    • Alert
    • Animation
    • Args
    • Badge
    • Breadcrumb
    • Button
    • Button Group
    • Card
    • Card Group
    • Carousel
    • Collapse
    • Command Prompt
    • Docs
    • Example
    • File
    • Icon
    • Image
    • Ins
    • Kbd
    • Link
    • Map
    • Mark
    • Navbar
    • Navs and Tabs
    • Persona
    • Release
    • Spinner
    • Sub
    • Sup
    • Table
    • Timeline
    • Toast
    • Tooltip
    • Video
  • Advanced Settings
    • Overview
    • Styles
    • Scripts
    • Icons
    • Partial Development
    • Module Development
    • Server Headers
    • Server-Side Redirection
  • About
    • Credits
    • License

Modules

Share via
Hinode
Link copied to clipboard

Customize and extend Hinode with Hugo modules.

On this page
Importing Modules   Configuring Modules   Configuring Module-Specific Extensions   Clarity   CookieYes   Font Awesome   Google Analytics   Utils   Enabling Optional Modules  
Added in v0.16.0   

Hinode supports Hugo Modules  to provide a flexible and extensible modular framework. By default, Hinode includes core building blocks for Bootstrap  , FlexSearch  , and Font Awesome  . The following paragraphs explain how to customize the module configuration.

Importing Modules  

By default, the Hinode template imports Hinode as module itself. In this approach, the modules that Hinode includes are imported as transitive modules. Adjust the module section in your site’s configuration file config/_default/hugo.toml to import or adjust the required modules. Visit the Hugo documentation to Review All Available Configuration Settings  . You can Disable Individual Modules  by setting disable to true.

  [[module.imports]]
    path = "github.com/gethinode/hinode"

The main repository of Hinode imports the following modules by default.

  • config/_default/hugo.toml
  [[module.imports]]
    path = "github.com/gethinode/mod-bootstrap"
  [[module.imports]]
    path = "github.com/gethinode/mod-csp"
  [[module.imports]]
    path = "github.com/gethinode/mod-flexsearch/v2"
  [[module.imports]]
    path = "github.com/gethinode/mod-fontawesome"
  [[module.imports]]
    path = "github.com/gethinode/mod-google-analytics"
  [[module.imports]]
    path = "github.com/gethinode/mod-katex"
  [[module.imports]]
    path = "github.com/gethinode/mod-leaflet"
  [[module.imports]]
    path = "github.com/gethinode/mod-lottie"
  [[module.imports]]
    path = "github.com/gethinode/mod-simple-datatables"
  [[module.imports]]
    path = "github.com/gethinode/mod-utils/v2"
...

Configuring Modules  

  Note

Hinode uses the default configuration defined in each referenced module since release v0.24.0  . You can override these settings in your site parameters.

You can choose to either fully integrate compatible modules or to include them on a page-by-page basis. For example, you might only want to display an interactive map on a few pages. In this case, you could choose to include the leaflet module on an opt-in basis. This ensures the page size is minimized. On the other hand, as bootstrap is used on every single page, it makes sense to include it as a core module.

For core modules, Hinode bundles the provided Stylesheet Files and JavaScript Files into the main stylesheet and core script bundles. For optional modules, Hinode prepares separate stylesheet files and JavaScript files for each individual module. The configuration order of the core modules is important: the first module is processed before the next modules.

  Note

Hugo uses two different algorithms to merge the filesystems, depending on the file type:

  • For i18n and data files, Hugo merges deeply using the translation ID and data key inside the files.
  • For static, layouts (templates), and archetypes files, these are merged on file level, so the left-most file will be chosen.

Adjust the modules section in your site’s parameter configuration file config/_default/params.toml to configure the various modules. Modules can include files for each of the following folders: archetypes, assets, content, data, i18n, layouts, static. Modules can also have their own configuration files. Each module needs to be imported as well ( See the Previous Paragraph).

Added in v0.24.0   

The following table provides an overview of the available settings for each module. Omit the mod- prefix of the module’s name.

Setting Default Description
integration optional Module integration, either core or optional. Core modules are fully integrated with the Hinode site, including stylesheets and Javascript bundles. The modules are processed in order of priority, with the first module taking precedence. Optional modules are only included on those pages that reference the module in the frontmatter. Hinode includes the following core modules by default: [“bootstrap”, “flexsearch”, “fontawesome”].
excludeSCSS false Excludes the module from the stylesheet processing pipeline. Use this setting to get more control of when and where to include the module’s stylesheet. For example, the Bootstrap stylesheet is imported by the main stylesheet after initializing the theme variables, but before the custom component styles.
disableTemplate false Excludes all scripts files from processing as Hugo template. The scripts are bundled as-is instead. This only applies to optional modules.
localize false v0.25.0      Triggers the creation of a language-specific bundle file. The language code is appended as suffix to the base name. For example, the English version of js/main.bundle.js becomes js/main.bundle.en.js.
category other v0.27.0      Assigns the module’s scripts to a category used for cookie consent. Available values are necessary, functional, analytics, performance, advertisement, and other. See Cookie Consent for more details.
local false v0.27.0      Includes an external URL in local mode too. By default, external scripts are only included in the built site.
url 0.27.0      Optional url for an external link. If set, the link is included in the page header or page body, pending integration type. See the Scripts Documentation for more information.
Setting Default
integration optional
Module integration, either core or optional. Core modules are fully integrated with the Hinode site, including stylesheets and Javascript bundles. The modules are processed in order of priority, with the first module taking precedence. Optional modules are only included on those pages that reference the module in the frontmatter. Hinode includes the following core modules by default: [“bootstrap”, “flexsearch”, “fontawesome”].
excludeSCSS false
Excludes the module from the stylesheet processing pipeline. Use this setting to get more control of when and where to include the module’s stylesheet. For example, the Bootstrap stylesheet is imported by the main stylesheet after initializing the theme variables, but before the custom component styles.
disableTemplate false
Excludes all scripts files from processing as Hugo template. The scripts are bundled as-is instead. This only applies to optional modules.
localize false
v0.25.0      Triggers the creation of a language-specific bundle file. The language code is appended as suffix to the base name. For example, the English version of js/main.bundle.js becomes js/main.bundle.en.js.
category other
v0.27.0      Assigns the module’s scripts to a category used for cookie consent. Available values are necessary, functional, analytics, performance, advertisement, and other. See Cookie Consent for more details.
local false
v0.27.0      Includes an external URL in local mode too. By default, external scripts are only included in the built site.
url
0.27.0      Optional url for an external link. If set, the link is included in the page header or page body, pending integration type. See the Scripts Documentation for more information.

For example, Bootstrap uses the following configuration in its module configuration:

[params.modules.bootstrap]
  integration = "core"
  excludeSCSS = true

Configuring Module-Specific Extensions  

Several modules support additional, module-specific configurations. Review them in the next paragraphs.

Clarity  

  Warning

This module assumes you have properly configured a Cookie Consent Manager. The Clarity script is assigned to the category analytics. Cookie consent is automatically given when this script is loaded. Do not load this script without explicit consent from the user. See the Hinode Docs for more details.

This module supports the following parameters (see the section params.modules in config.toml):

Setting Default Description
clarity.id Tracking code of Microsoft Clarity (see Installation Instructions  )
clarity.force false Trigger to force include the analytics scripts, bypassing other settings. Use this setting for debugging and testing only.
Setting Default
clarity.id
Tracking code of Microsoft Clarity (see Installation Instructions  )
clarity.force false
Trigger to force include the analytics scripts, bypassing other settings. Use this setting for debugging and testing only.

CookieYes  

Added in v0.27.0   

The cookieyes module requires the following settings:

Setting Default Description
cookieyes.local false Trigger to force include the CookieYes scripts, bypassing other settings. Use this setting for debugging and testing only.
cookieyes.url Link to your personalized CookieYes script. See the installation code in the advanced settings of your CookieYes account. The code is available by clicking the button next to the cookie banner status. The link has the following pattern: https://cdn-cookieyes.com/client_data/{installation code}/script.js.
Setting Default
cookieyes.local false
Trigger to force include the CookieYes scripts, bypassing other settings. Use this setting for debugging and testing only.
cookieyes.url
Link to your personalized CookieYes script. See the installation code in the advanced settings of your CookieYes account. The code is available by clicking the button next to the cookie banner status. The link has the following pattern: https://cdn-cookieyes.com/client_data/{installation code}/script.js.

Font Awesome  

Added in v0.17.0   

The fontawesome module supports the following additional settings:

Setting Default Description
fontawesome.embed true v0.26.3      If set, generates a symbol map with embedded vector images. Only works in conjunction with inline. Include the symbol map with the partial assets/symbols.html (requires the current page context).
fontawesome.inline true If set, uses inline vector images instead of web fonts. Both methods support Font Awesome styling and animation. However, when using vector images you cannot use aliases. Instead, use the default name of the icon.
fontawesome.debug true If set, prints the original code <i class="[...]" style=[...]></i> as comments next to the inline vector image.
fontawesome.skipMissing false If set, displays a warning when an icon cannot be found. The missing icon is replaced with a dummy. By default, Hinode exits with an error when an icon is missing.
Setting Default
fontawesome.embed true
v0.26.3      If set, generates a symbol map with embedded vector images. Only works in conjunction with inline. Include the symbol map with the partial assets/symbols.html (requires the current page context).
fontawesome.inline true
If set, uses inline vector images instead of web fonts. Both methods support Font Awesome styling and animation. However, when using vector images you cannot use aliases. Instead, use the default name of the icon.
fontawesome.debug true
If set, prints the original code <i class="[...]" style=[...]></i> as comments next to the inline vector image.
fontawesome.skipMissing false
If set, displays a warning when an icon cannot be found. The missing icon is replaced with a dummy. By default, Hinode exits with an error when an icon is missing.

Google Analytics  

Added in v0.27.0   

  Note

By convention, Hinode uses kebab case as naming convention for module names. However, the module name in the site parameters is renamed to GoogleAnalytics to align with Hugo’s privacy settings.

Set you G-tag in your site configuration (usually hugo.toml) in the following section:

[services]
  [services.googleAnalytics]
    ID = "G-xxxxxxxxxx"

You can modify the privacy configuration in the following section:

[privacy]
  [privacy.googleAnalytics]
    disable = false
    respectDoNotTrack = false

The google-analytics module supports the following additional settings:

Setting Default Description
GoogleAnalytics.force false Trigger to force include the analytics scripts, bypassing other settings. Use this setting for debugging and testing only.
Setting Default
GoogleAnalytics.force false
Trigger to force include the analytics scripts, bypassing other settings. Use this setting for debugging and testing only.

Utils  

Added in v0.22.5   

The utils module supports the following additional settings:

Setting Default Description
utils.filter [^0-9A-Za-zŽžÀ-ÿ ;.,\/'’"] Defines the regular expression for characters to remove from page descriptions. These page descriptions are used to define card content and metadata for search indexes. Adjust the filter to define which characters to support. You may need to adjust these settings to support specific diacritical letters.
utils.raw false Flag to indicate page descriptions should be returned as-is. In this setting, the filter is ignored.
Setting Default
utils.filter [^0-9A-Za-zŽžÀ-ÿ ;.,\/'’"]
Defines the regular expression for characters to remove from page descriptions. These page descriptions are used to define card content and metadata for search indexes. Adjust the filter to define which characters to support. You may need to adjust these settings to support specific diacritical letters.
utils.raw false
Flag to indicate page descriptions should be returned as-is. In this setting, the filter is ignored.

Enabling Optional Modules  

You can enable an optional module for a specific page by setting the following value in the page’s frontmatter:

---
modules: ["leaflet"]
---
• Fix linting rules (86641b4)
On this page:
Importing Modules   Configuring Modules   Configuring Module-Specific Extensions   Clarity   CookieYes   Font Awesome   Google Analytics   Utils   Enabling Optional Modules  
Modules
Modules
Hinode is a clean documentation and blog theme for your Hugo site based on Bootstrap 5.
Code licensed MIT, docs CC BY-NC 4.0
Currently v0.29.3
Privacy | Cookies
 
Links
Home 
About 
Docs 
Components 
Releases 
Guides
Getting Started 
Developing Modules 
Optimization 
Versioning 
Community
Issues   
Discussions   
Contribute 
Hinode
Code copied to clipboard