Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/y2k. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
38 lines
974 B
Go
38 lines
974 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"git.dev.alexdunmow.com/block/core/blocks"
|
|
)
|
|
|
|
// ChromeNavbarBlockMeta declares the y2k chrome navbar.
|
|
var ChromeNavbarBlockMeta = blocks.BlockMeta{
|
|
Key: "chrome_navbar",
|
|
Title: "Chrome Navbar",
|
|
Description: "Beveled chrome navigation bar with hover sparkle.",
|
|
Source: "y2k",
|
|
Category: blocks.CategoryNavigation,
|
|
}
|
|
|
|
// ChromeNavbarBlock renders the navbar.
|
|
// Content: {menuName, logoText, logoImage}
|
|
func ChromeNavbarBlock(ctx context.Context, content map[string]any) string {
|
|
data := ChromeNavbarData{
|
|
MenuName: getStringOr(content, "menuName", "main"),
|
|
LogoText: getString(content, "logoText"),
|
|
LogoImage: getString(content, "logoImage"),
|
|
}
|
|
var buf bytes.Buffer
|
|
_ = chromeNavbarComponent(data).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|
|
|
|
// ChromeNavbarData is the typed shape for the templ component.
|
|
type ChromeNavbarData struct {
|
|
MenuName string
|
|
LogoText string
|
|
LogoImage string
|
|
}
|