From 3cb7572a8f1092b3169f4faaa2e76776dea39993 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 7 Aug 2024 01:51:13 +0200 Subject: Just use hardcoded strings --- templates/base.go | 5 ----- templates/navbar.templ | 2 +- templates/navbar_templ.go | 2 +- templates/root.templ | 8 ++++---- templates/root_templ.go | 43 +++++++++++++++---------------------------- 5 files changed, 21 insertions(+), 39 deletions(-) (limited to 'templates') diff --git a/templates/base.go b/templates/base.go index f0b288b..e6647f2 100644 --- a/templates/base.go +++ b/templates/base.go @@ -1,8 +1,3 @@ package templates -const ( - PrinterKey = "printer" - LocaleKey = "locale" -) - //go:generate templ generate -log-level warn diff --git a/templates/navbar.templ b/templates/navbar.templ index 95e8563..5007183 100644 --- a/templates/navbar.templ +++ b/templates/navbar.templ @@ -3,7 +3,7 @@ package templates import "git.thomasvoss.com/euro-cash.eu/i18n" templ navbar() { - {{ p := ctx.Value(PrinterKey).(i18n.Printer) }} + {{ p := ctx.Value("printer").(i18n.Printer) }}