diff options
author | Alan Pearce | 2024-05-07 21:04:13 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-07 21:04:13 +0200 |
commit | 32c4f1ddd704984dad79ad059619b127dcc7de2f (patch) | |
tree | f4d3c1bc0805ca715d54d80c74364d17d02793a2 /internal/server/templates.go | |
parent | 48b22d9ad78e4f3bdb6ca5bbd5ab642b1f991715 (diff) | |
download | searchix-32c4f1ddd704984dad79ad059619b127dcc7de2f.tar.lz searchix-32c4f1ddd704984dad79ad059619b127dcc7de2f.tar.zst searchix-32c4f1ddd704984dad79ad059619b127dcc7de2f.zip |
style: show pages for different sources
Diffstat (limited to 'internal/server/templates.go')
-rw-r--r-- | internal/server/templates.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/server/templates.go b/internal/server/templates.go index 8755e36..17b14ba 100644 --- a/internal/server/templates.go +++ b/internal/server/templates.go @@ -32,6 +32,18 @@ var templateFuncs = template.FuncMap{ return template.HTML(out.String()) // #nosec G203 }, + "sourceName": func(input string) string { + switch input { + case "nixos": + return "NixOS" + case "darwin": + return "Darwin" + case "home-manager": + return "Home Manager" + } + + return input + }, } func loadTemplate(layoutFile string, filename string) (*template.Template, error) { |