Compare commits

...

2 commits

Author SHA1 Message Date
2f35c6e792 Merge pull request 'add theme system' (#1) from develop into main
Reviewed-on: #1
2024-09-27 10:49:30 -04:00
11272c4a85 add theme system 2024-09-27 02:31:45 -05:00
2 changed files with 15 additions and 0 deletions

View file

@ -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()

10
templates/sample.html Normal file
View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
{{template "head" "Sample"}}
<body>
{{template "title" .TheTitle}}
<div class="section">
Sample page!
</div>
</body>
</html>