package main // figletBanner returns a small block-letter banner for the given title. // This is intentionally simple — admins who want bespoke figlet output can // paste it into the asciiArt field which overrides this. func figletBanner(title string) string { if title == "" { return "" } return "/*===========================================*/\n" + "/* " + padRight(title, 41) + " */\n" + "/*===========================================*/" } // padRight pads s with spaces on the right so the total length is at least n. func padRight(s string, n int) string { for len(s) < n { s = s + " " } if len(s) > n { s = s[:n] } return s } templ asciiHeaderComponent(data AsciiHeaderData) {
{ data.AsciiArt }
} else {
{ figletBanner(data.Title) }
}