From 32c4f1ddd704984dad79ad059619b127dcc7de2f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 May 2024 21:04:13 +0200 Subject: style: show pages for different sources --- internal/server/templates.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'internal/server/templates.go') 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) { -- cgit 1.4.1