themes-art-deco/footer.templ
Alex Dunmow 9fbedf5ba1 initial: theme plugin art-deco
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/art-deco.

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

60 lines
1.8 KiB
Plaintext

package main
import "strings"
// addressLines splits a multi-line address into individual lines for centered rendering.
func addressLines(addr string) []string {
if addr == "" {
return nil
}
lines := strings.Split(addr, "\n")
out := make([]string, 0, len(lines))
for _, line := range lines {
l := strings.TrimSpace(line)
if l != "" {
out = append(out, l)
}
}
return out
}
// footerComponent renders the centered Art Deco footer.
templ footerComponent(data FooterData) {
<section data-block="art-deco:footer" class="py-12 deco-grain">
<div class="max-w-3xl mx-auto px-4 text-center">
<hr class="deco-rule mb-8"/>
if len(addressLines(data.Address)) > 0 {
<address class="not-italic mb-4" style="color: hsl(var(--muted-foreground));">
for _, line := range addressLines(data.Address) {
<div>{ line }</div>
}
</address>
}
if data.ReservationsEmail != "" {
<p class="mb-4">
<a href={ templ.SafeURL("mailto:" + data.ReservationsEmail) } class="deco-link">{ data.ReservationsEmail }</a>
</p>
}
if data.MenuName != "" {
<nav
aria-label="Footer"
class="deco-caps text-xs mb-4"
style="font-family: var(--font-heading, &quot;Italiana&quot;, &quot;Cinzel&quot;, Georgia, serif); color: hsl(var(--foreground));"
>
<span>{ data.MenuName }</span>
</nav>
}
if data.ShowSocial {
<div class="flex justify-center gap-4 mb-4" style="color: hsl(var(--primary));">
<span class="deco-caps text-xs" aria-hidden="true">Instagram</span>
<span aria-hidden="true">·</span>
<span class="deco-caps text-xs" aria-hidden="true">Facebook</span>
<span aria-hidden="true">·</span>
<span class="deco-caps text-xs" aria-hidden="true">LinkedIn</span>
</div>
}
<hr class="deco-rule mt-8"/>
</div>
</section>
}