diff options
author | Alan Pearce | 2024-06-21 13:02:08 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-21 15:44:12 +0200 |
commit | a1dfc548198a1326e71f1dd70303a5d3441f7a39 (patch) | |
tree | 03e7d60dc389678ee7cadaac4d5e64596dffde91 /frontend/assets.go | |
parent | cac323d9ae70f55a43fd99b73e60cf614be11797 (diff) | |
download | searchix-a1dfc548198a1326e71f1dd70303a5d3441f7a39.tar.lz searchix-a1dfc548198a1326e71f1dd70303a5d3441f7a39.tar.zst searchix-a1dfc548198a1326e71f1dd70303a5d3441f7a39.zip |
refactor: switch to templ for HTML templates
Diffstat (limited to 'frontend/assets.go')
-rw-r--r-- | frontend/assets.go | 12 |
1 files changed, 6 insertions, 6 deletions
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 } |