957 B
957 B
| applyTo |
|---|
| layouts/**/*.html |
Layout and Shortcode Implementation Guidelines
Shortcodes reference: DOCS-SHORTCODES.md Test examples: content/example.md
Implementing Shortcodes
When creating or modifying Hugo layouts and shortcodes:
- Use Hugo template syntax and functions
- Follow existing patterns in
/layouts/shortcodes/ - Test in content/example.md
- Document new shortcodes in DOCS-SHORTCODES.md
Shortcode Pattern
<!-- layouts/shortcodes/example.html -->
{{ $param := .Get 0 }}
{{ $namedParam := .Get "name" }}
<div class="example">
{{ .Inner | markdownify }}
</div>
Testing
Add usage examples to content/example.md to verify:
- Rendering in browser
- Hugo build succeeds
- No console errors
See DOCS-SHORTCODES.md for complete shortcode documentation.