mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-04 20:16:52 +08:00
replace assets generation with embed (#423)
This commit is contained in:
parent
9397832485
commit
2b1ddd093d
3 changed files with 16 additions and 658 deletions
|
@ -1,23 +0,0 @@
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/shurcooL/vfsgen"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
err := vfsgen.Generate(http.Dir("internal/view"), vfsgen.Options{
|
|
||||||
Filename: "internal/webserver/assets-prod.go",
|
|
||||||
PackageName: "webserver",
|
|
||||||
BuildTags: "!dev",
|
|
||||||
VariableName: "assets",
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalln(err)
|
|
||||||
}
|
|
||||||
}
|
|
6
internal/assets.go
Normal file
6
internal/assets.go
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package internal
|
||||||
|
|
||||||
|
import "embed"
|
||||||
|
|
||||||
|
//go:embed view
|
||||||
|
var Assets embed.FS
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue