2021-03-20 20:40:40 +00:00
|
|
|
// SPDX-FileCopyrightText: 2021 Luke Granger-Brown <depot@lukegb.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2021-03-20 19:52:10 +00:00
|
|
|
package fupstatic
|
|
|
|
|
|
|
|
import (
|
|
|
|
"embed"
|
|
|
|
"io/fs"
|
2021-03-20 23:43:59 +00:00
|
|
|
|
|
|
|
"hg.lukegb.com/lukegb/depot/web/fup/hashfs"
|
2021-03-20 19:52:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
//go:embed css js
|
|
|
|
var static embed.FS
|
|
|
|
|
2021-03-20 23:43:59 +00:00
|
|
|
var Static *hashfs.FS = hashfs.New(static)
|
2021-03-20 19:52:10 +00:00
|
|
|
|
|
|
|
//go:embed tmpl
|
|
|
|
var templates embed.FS
|
|
|
|
|
|
|
|
var Templates fs.FS = must(fs.Sub(templates, "tmpl"))
|
|
|
|
|
|
|
|
func must(fsys fs.FS, err error) fs.FS {
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return fsys
|
|
|
|
}
|