about summary refs log tree commit diff stats
path: root/internal/server/templates.go
diff options
context:
space:
mode:
authorAlan Pearce2024-05-07 21:04:13 +0200
committerAlan Pearce2024-05-07 21:04:13 +0200
commit32c4f1ddd704984dad79ad059619b127dcc7de2f (patch)
treef4d3c1bc0805ca715d54d80c74364d17d02793a2 /internal/server/templates.go
parent48b22d9ad78e4f3bdb6ca5bbd5ab642b1f991715 (diff)
downloadsearchix-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.go12
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) {