Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/corporate-modernist. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
61 lines
1.6 KiB
Plaintext
61 lines
1.6 KiB
Plaintext
package main
|
|
|
|
// footerComponent renders the corporate-modernist:footer block.
|
|
templ footerComponent(data FooterData) {
|
|
<div class="cm-footer" data-block="corporate-modernist:footer" data-variant={ data.Variant }>
|
|
<div class="cm-content-well">
|
|
if data.Variant == "full" && len(data.Columns) > 0 {
|
|
<div class="cm-swiss-12">
|
|
for _, col := range data.Columns {
|
|
<div style={ footerColumnSpan(len(data.Columns)) }>
|
|
if col.Title != "" {
|
|
<div class="cm-display" style="font-size: 0.875rem; font-weight: 600; margin: 0 0 0.75rem 0; text-transform: uppercase; letter-spacing: 0.05em;">{ col.Title }</div>
|
|
}
|
|
if len(col.Links) > 0 {
|
|
<ul style="list-style: none; padding: 0; margin: 0;">
|
|
for _, l := range col.Links {
|
|
<li style="margin-bottom: 0.5rem;">
|
|
<a href={ templ.SafeURL(l.Href) } class="cm-text" style="font-size: 0.95rem; text-decoration: none;">
|
|
{ footerLinkLabel(l) }
|
|
</a>
|
|
</li>
|
|
}
|
|
</ul>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
if data.ShowLegal {
|
|
<div class="cm-footer-legal">
|
|
if data.LegalLine != "" {
|
|
{ data.LegalLine }
|
|
} else {
|
|
All rights reserved.
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
func footerLinkLabel(l FooterLink) string {
|
|
if l.Label != "" {
|
|
return l.Label
|
|
}
|
|
return l.Href
|
|
}
|
|
|
|
func footerColumnSpan(count int) string {
|
|
switch {
|
|
case count >= 4:
|
|
return "grid-column: span 3 / span 3;"
|
|
case count == 3:
|
|
return "grid-column: span 4 / span 4;"
|
|
case count == 2:
|
|
return "grid-column: span 6 / span 6;"
|
|
default:
|
|
return "grid-column: span 12 / span 12;"
|
|
}
|
|
}
|