mirror of
https://github.com/nkanaev/yarr.git
synced 2026-07-15 11:06:31 +00:00
frontend: simplify assets filesystem
This commit is contained in:
@@ -2,14 +2,24 @@
|
||||
|
||||
package assets
|
||||
|
||||
import "embed"
|
||||
import (
|
||||
"embed"
|
||||
"html/template"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
//go:embed *.html
|
||||
//go:embed graphicarts
|
||||
//go:embed javascripts
|
||||
//go:embed stylesheets
|
||||
var embedded embed.FS
|
||||
var static embed.FS
|
||||
|
||||
func init() {
|
||||
FS.embedded = &embedded
|
||||
//go:embed templates
|
||||
var templates embed.FS
|
||||
|
||||
func Templates() *template.Template {
|
||||
return template.Must(template.ParseFS(templates, "*.html"))
|
||||
}
|
||||
|
||||
func StaticFS() fs.FS {
|
||||
return static
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user