1.7 KiB
1.7 KiB
Components
Reusable Go template components.
Available Templates
| Component | File | Purpose |
|---|---|---|
| Anime Card | anime_card.gohtml |
Poster card with hover reveal |
| Continue Watching | continue_watching.gohtml |
Continue watching row |
| Dropdown | dropdown.gohtml |
Dropdown wrapper (also uses <ui-dropdown>) |
| Filter Bar | filter_bar.gohtml |
Search + filters for browse |
| Header | header.gohtml |
Sticky header with nav |
| Navigation | navigation.gohtml |
Sidebar navigation |
| Video Player | video_player.gohtml |
Episode video container |
| Watchlist Actions | watchlist_actions.gohtml |
Add/remove watchlist button |
| Watch Order | watch_order.gohtml |
Watch order queue |
Usage
Components are rendered with {{template "name" .}}. Props follow a keyword convention:
{{template "anime_card" dict "Anime" .Data "WithActions" true}}
{{template "navigation" dict "CurrentPath" .CurrentPath}}
Props Convention
Components receive a dict with named keys — no positional arguments, no implicit state.
dict "Key" .Value "Key2" .Value2
Adding a component
- Create
<name>.gohtmlin this directory. - Register it in
template_fs.goif not already picked up by the embed glob. - Wire it into the page template.