Box
Wraps content in a container with configurable width, alignment, and optional border.
Location : layouts/_partials/layouts/box.html
Parameters :
| Parameter | Type | Description | Default |
|---|---|---|---|
content | string | HTML content to wrap | required |
width | string | Width mode: "compact" (fit content), "full" (page width), "wide" (viewport width) | "compact" |
align | string | Alignment: "left", "center", "right" | "left" |
border | boolean | Add border with padding | false |
class | string | Additional CSS classes | - |
Examples:
go
// Basic usage (compact, left-aligned)
{{ $content := "<p>Some content</p>" }}
{{ partial "layouts/box.html" (dict "content" $content) }}
// Full width, centered
{{ $content := "<p>Some content</p>" }}
{{ partial "layouts/box.html" (dict
"content" $content
"width" "full"
"align" "center"
) }}
// Wide with border
{{ $content := "<p>Some content</p>" }}
{{ partial "layouts/box.html" (dict
"content" $content
"width" "wide"
"border" true
) }}
// Custom class
{{ $content := "<p>Some content</p>" }}
{{ partial "layouts/box.html" (dict
"content" $content
"class" "custom-box"
) }}