-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
52 lines (44 loc) · 1002 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"fmt"
"os"
"runtime/debug"
"time"
"github.com/bvisness/bvisness.me/bhp"
"github.com/bvisness/bvisness.me/pkg/code"
"github.com/bvisness/bvisness.me/pkg/config"
"github.com/bvisness/bvisness.me/pkg/images"
)
var hash string = fmt.Sprintf("%d", time.Now().Unix())
func init() {
info, ok := debug.ReadBuildInfo()
if !ok {
panic("failed to read build info")
}
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
hash = setting.Value
}
}
time.Local = time.UTC
}
var bvisnessIncludes = &bhp.FSSearcher{
FS: os.DirFS("include"),
}
func main() {
b := bhp.Instance{
SrcDir: "site",
FourOhFour: "404.luax",
Searchers: []bhp.Searcher{
bhp.GoSearcher{
"images": images.LoadLib,
"code": code.LoadLib,
},
bvisnessIncludes,
},
StaticPaths: []string{"apps/"},
Middleware: bhp.ChainMiddleware(images.Middleware),
Dev: config.Config.Dev,
}
b.Run()
}