all repos

mugit @ c9e6e1a

🐮 git server that your cow will love

mugit/web/web.go(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package web

import (
	"embed"
	"io/fs"
)

var (
	//go:embed templates/* static/*
	allFS       embed.FS
	TemplatesFS = fsSub(allFS, "templates")
	StaticFS    = fsSub(allFS, "static")
)

func fsSub(fsys fs.FS, dir string) fs.FS {
	f, err := fs.Sub(fsys, dir)
	if err != nil {
		panic(err)
	}
	return f
}