33 lines
627 B
Go
33 lines
627 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"git.tijl.dev/tijl/tijl.dev/internal/assets"
|
|
"git.tijl.dev/tijl/tijl.dev/internal/i18n"
|
|
"github.com/gofiber/fiber/v2"
|
|
"github.com/gofiber/template/html/v2"
|
|
)
|
|
|
|
func main() {
|
|
assets.LoadSVGs()
|
|
i18n.LoadTranslations()
|
|
|
|
engine := html.New("/home/tijl/projects/tijldev-next/web", ".html")
|
|
|
|
engine.AddFunc("icon", assets.Svg)
|
|
engine.AddFunc("translate", i18n.TranslateFunc())
|
|
|
|
app := fiber.New(fiber.Config{
|
|
Views: engine,
|
|
})
|
|
|
|
app.Get("/", func(c *fiber.Ctx) error {
|
|
return c.Render("pages/index", fiber.Map{})
|
|
})
|
|
|
|
app.Static("/static", "./static")
|
|
|
|
log.Fatal(app.Listen(":3000"))
|
|
}
|