Badge
Add compact, semantic status labels without custom colors or JavaScript.
OINK promotes the content components that proved reusable across PGSTY sites into the theme. Each component has a stable authoring API, unique instance IDs, local assets, and a defined safety boundary. Site-specific data widgets remain outside the theme.
Interactive shortcodes mark the features used by a page. OINK then adds each required stylesheet or runtime once, even if the page has several component instances. A plain page does not download component code it never uses.
Relative asset and link parameters pass through Hugo’s URL handling, so they
remain correct under a subpath baseURL. Component markup also has print,
dark-mode, mobile, keyboard, and reduced-motion behavior where applicable.
Everyday primitives cover small structures that recur throughout engineering documentation. Each guide below explains when to use the primitive, shows the rendered result beside its source, and records its complete version-one API.
| Documentation need | Reference | JavaScript |
|---|---|---|
| Release state, lifecycle, or short status | Badge | None |
| Shortcut or key sequence | Kbd | None |
| Configuration, parameter, or response data | Fields and Field | None |
| Repository or directory structure | FileTree | None; folders use details |
| Inspect a screenshot or architecture image | Image Zoom | Optional, loaded on demand |
| Compare several related images | Gallery | Reuses optional Image Zoom JS |
All primitives except Kbd use named parameters and standard {{< ... >}}
shortcode notation. Parameter names are case-sensitive. Unknown parameters,
quoted booleans or integers, empty required strings, invalid enum values, and
incorrect parent/child combinations stop the build with the source position.
The public APIs do not accept arbitrary class, style, colors, or event
handlers. Visible labels come from the author or Oink’s translations. Static
primitives add no JavaScript; interactive primitives mark their page so the
required runtime is included once.
The output contract keeps the same information available without a browser runtime:
| Primitive | HTML | Markdown | Print and RSS | JavaScript |
|---|---|---|---|---|
| Badge | Semantic status span or link | Emphasized text or link | Static inline content | None |
| Kbd | Nested kbd sequence |
Ctrl + K |
Plain key notation | None |
| Fields | Responsive definition list | Metadata bullet list | Complete definitions | None |
| FileTree | Nested lists and native disclosure | Nested list | Fully expanded tree | None |
| Shared image | Figure, image, and caption | Ordinary image and caption | Static figure | Reuses Zoom when enabled |
| Gallery | Responsive figure grid | Images and captions | Sequential static figures | Reuses Zoom when enabled |
Missing required parameters and invalid values fail the Hugo build instead of
silently changing meaning. Historical positional imgproc remains compatible,
but new content should use the accessible named form.
Version one does not add a public Icon shortcode or an icon parameter to
Badge. Oink’s private shell SVG registry remains separate from author-facing
content icons. Automatic TypeScript parsing, API playgrounds, directory reads,
remote image downloads, and complex pan or wheel-zoom controls also remain
outside the Hugo-only theme boundary.
Use asciinema for a terminal recording stored as a local .cast file:
file is required and can also be the first positional argument. The terminal
window uses title when supplied and otherwise displays the file value.
Supported options are title, theme, fit (width, height, both, or
none), autoplay, loop, preload, speed, startAt, poster, cols,
rows, idleTimeLimit, pauseOnMarkers, and comma-separated markers.
Keep cast files local for offline use. A remote URL is accepted only when the author explicitly supplies it.
ECharts and Infographic remain Oink content components, but each now has a dedicated section under Advanced. This page keeps the reusable component overview concise and points to the richer examples.
Use Apache ECharts for quantitative charts based on structured JSON or YAML. The chart gallery contains several live patterns, and callbacks and trusted code documents the explicit executable-code boundary.
Use Infographics with AntV for declarative processes, timelines, cycles, grids, and funnels. The dedicated pages explain template semantics, themes, local-first constraints, and accessible textual fallbacks.
doc-card and nav-card share one card implementation. doc-cards and
nav-cards create responsive groups of one to four columns. The aliases let an
existing site’s content keep its most descriptive name without duplicating
markup or styles.
A card accepts title, link, image, alt, icon, desc, accent, and
badge. Its body can contain Markdown links. Tokens such as {version} in
desc resolve from site parameters when a matching value exists.
Wrap document cards in doc-carousel to create an accessible horizontal
carousel:
label supplies the carousel’s accessible name. Arrow keys and visible
previous/next controls navigate the track; reduced-motion preferences disable
unnecessary animation.
details emits native details and summary elements:
title sets the summary. The block is closed by default; set closed=false to
render it open.
OINK keeps Docsy’s tabpane and tab authoring model while preserving
selected=true and whitespace behavior used by imported sites:
Use text=true for Markdown content; otherwise tabs are syntax-highlighted
code. Tab panes also support language-aware persistence, disabled tabs, and
right-aligned entries. Generated tab and panel IDs have matching ARIA
relationships.
param prints a page parameter, falling back to the site parameter of the same
name:
Current version: v0.2.0
The shortcode fails the build when the named parameter does not exist. This is intentional: a missing release or repository value should not silently produce misleading documentation.
OINK also ships local runtimes for inherited content features:
mermaid, math, and markmap code blocks;swaggerui and redoc API documentation shortcodes;See Shortcodes and Diagrams and formulae for the complete authoring reference.
alt text and carousels a meaningful label.Add compact, semantic status labels without custom colors or JavaScript.
Write keyboard shortcuts as accessible, static key sequences.
Describe configuration, parameters, properties, and response fields with responsive semantic HTML.
Present repository and directory structures as semantic, progressively disclosed lists.
Let readers inspect meaningful standalone images with an optional native dialog.
Arrange related images in a responsive static grid that can reuse Image Zoom.