diff --git a/main.go b/main.go index cc02e00..afbad2c 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ package main import ( + "embed" "log" "os" "path" @@ -18,6 +19,9 @@ import ( "github.com/julienschmidt/httprouter" ) +//go:embed all:templates +var resources embed.FS + // The main function func main() { app := core.New() @@ -43,6 +47,7 @@ func main() { app.SetGormConfig(config.GetGormConfig()) app.SetCacheConfig(config.GetCacheConfig()) app.Bootstrap() + app.RegisterTemplates(resources) registerGlobalHooks() registerRoutes() registerEvents() diff --git a/templates/sample.html b/templates/sample.html new file mode 100644 index 0000000..0ccd602 --- /dev/null +++ b/templates/sample.html @@ -0,0 +1,10 @@ + + + {{template "head" "Sample"}} + + {{template "title" .TheTitle}} +
+ Sample page! +
+ + \ No newline at end of file