refactor(admin): use go1.16 embed for templates and assets

This commit is contained in:
sentriz
2021-05-08 15:56:33 +01:00
committed by Senan Kelly
parent 6f15589c08
commit 0c871d888b
9 changed files with 78 additions and 11322 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,18 @@
//nolint:gochecknoglobals,golint,stylecheck
package assets
import (
"strings"
"embed"
)
// PrefixDo runs a given callback for every path in our assets with
// the given prefix
func PrefixDo(pre string, cb func(path string, asset *EmbeddedAsset)) {
for path, asset := range Bytes {
if strings.HasPrefix(path, pre) {
cb(path, asset)
}
}
}
//go:embed layouts
var Layouts embed.FS
//go:embed pages
var Pages embed.FS
//go:embed partials
var Partials embed.FS
//go:embed static
var Static embed.FS