From e0768c2aacd72bd4e62d0847dc2231644664d08d Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 12 Sep 2026 12:16:05 +0300 Subject: Highlight the current tab in the dashboard nav Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'internal/web/templates.go') diff --git a/internal/web/templates.go b/internal/web/templates.go index f322ccc..1e17654 100644 --- a/internal/web/templates.go +++ b/internal/web/templates.go @@ -99,6 +99,8 @@ var funcs = template.FuncMap{ return *p }, "lower": strings.ToLower, + // hasPrefix marks the current dashboard tab: {{if hasPrefix .Path "/b/x/posts"}} + "hasPrefix": strings.HasPrefix, // dict builds a map for passing several values to a partial: {{template "x" (dict "a" 1 "b" 2)}} "dict": func(kv ...any) (map[string]any, error) { if len(kv)%2 != 0 { -- cgit v1.2.3