From a1dfc548198a1326e71f1dd70303a5d3441f7a39 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 21 Jun 2024 13:02:08 +0200 Subject: refactor: switch to templ for HTML templates --- frontend/assets.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'frontend/assets.go') diff --git a/frontend/assets.go b/frontend/assets.go index 46369fa..7a90d80 100644 --- a/frontend/assets.go +++ b/frontend/assets.go @@ -12,8 +12,8 @@ import ( ) var Assets = &AssetCollection{ - Scripts: make(map[string]*Asset), - Stylesheets: make(map[string]*Asset), + Scripts: []*Asset{}, + Stylesheets: []*Asset{}, ByPath: make(map[string]*Asset), } @@ -25,8 +25,8 @@ type Asset struct { } type AssetCollection struct { - Scripts map[string]*Asset - Stylesheets map[string]*Asset + Scripts []*Asset + Stylesheets []*Asset ByPath map[string]*Asset } @@ -61,7 +61,7 @@ func hashScripts() error { if err != nil { return err } - Assets.Scripts[filename] = asset + Assets.Scripts = append(Assets.Scripts, asset) Assets.ByPath[asset.URL] = asset } @@ -78,7 +78,7 @@ func hashStyles() error { if err != nil { return err } - Assets.Stylesheets[filename] = asset + Assets.Stylesheets = append(Assets.Stylesheets, asset) Assets.ByPath[asset.URL] = asset } -- cgit 1.4.1