Dynamic Loading
Blocks are loaded on-demand based on your content configuration.
The HBX Resolver is the engine powering HugoBlox’s modular architecture. It dynamically resolves block definitions (Blox) from your content front matter into rendered HTML components.
Dynamic Loading
Blocks are loaded on-demand based on your content configuration.
Schema Validation
Parameters are validated against JSON schemas for type safety.
Extensible
Create custom blocks without modifying the core engine.
A Block (Blox) is a self-contained component consisting of a template and an optional schema.
Blocks are typically used in landing pages within the sections list.
type: landingsections: - block: markdown content: title: Hello World text: This is a markdown block - block: collection content: title: Recent Posts filters: folders: - postsections in your page front matter.block parameter.layouts/partials/blox/<block-name>/block.html.Create your own blocks to extend HugoBlox functionality.
Create layouts/partials/blox/my-custom-block/block.html.
{{/* layouts/partials/blox/my-custom-block/block.html */}}{{ $block := . }}{{ $title := $block.content.title | default "Default Title" }}
<section class="my-custom-block p-8"> <h2 class="text-2xl font-bold">{{ $title }}</h2> <div class="content"> {{ $block.content.text | markdownify }} </div></section>sections: - block: my-custom-block content: title: My New Block text: It works!You can define a schema.json to enforce parameter types and defaults.
{ "$schema": "http://json-schema.org/draft-07/schema", "type": "object", "properties": { "content": { "type": "object", "properties": { "title": { "type": "string" }, "text": { "type": "string" } }, "required": ["title"] } }}