themes-terminal/button_override.templ
Alex Dunmow 0a9b177f7c initial: theme plugin terminal
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/terminal.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:44 +08:00

21 lines
468 B
Plaintext

package main
func buttonHref(url string) string {
if url == "" {
return "#"
}
return url
}
templ terminalButtonComponent(text, url, target string) {
if target == "_blank" {
<a class="terminal-button caret-blink" href={ templ.SafeURL(buttonHref(url)) } target="_blank" rel="noopener noreferrer">
{ "[ " + text + " ]" }
</a>
} else {
<a class="terminal-button caret-blink" href={ templ.SafeURL(buttonHref(url)) }>
{ "[ " + text + " ]" }
</a>
}
}