diff options
| author | grm <grm@eyesin.space> | 2026-09-12 12:16:05 +0300 |
|---|---|---|
| committer | grm <grm@eyesin.space> | 2026-09-12 12:16:05 +0300 |
| commit | e0768c2aacd72bd4e62d0847dc2231644664d08d (patch) | |
| tree | 9674a800e37bc87ea92496bd3abf98a0920a0948 /internal/web/templates.go | |
| parent | 3073532f723b976a2f54666f779e9a045bacb7f6 (diff) | |
| download | blogspace-e0768c2aacd72bd4e62d0847dc2231644664d08d.tar.gz blogspace-e0768c2aacd72bd4e62d0847dc2231644664d08d.tar.bz2 blogspace-e0768c2aacd72bd4e62d0847dc2231644664d08d.zip | |
Highlight the current tab in the dashboard nav
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/web/templates.go')
| -rw-r--r-- | internal/web/templates.go | 2 |
1 files changed, 2 insertions, 0 deletions
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 { |
