From 219e47ae2a10ae6aca42e58abd084a69641ec613 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Fri, 19 Mar 2021 00:55:38 -0400 Subject: dev --- cmd/web/app.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cmd/web/app.go') diff --git a/cmd/web/app.go b/cmd/web/app.go index 8f6df89..2c19545 100644 --- a/cmd/web/app.go +++ b/cmd/web/app.go @@ -1,6 +1,9 @@ package main import ( + "os" + "path/filepath" + "sync" "html/template" "time" @@ -34,6 +37,16 @@ type App struct { download chan string } +var getWd string +func (a *App) MuhTemplates() *template.Template { + if getWd == "" { + getWd, _ = os.Getwd() + } + + return template.Must(template.ParseFiles( + filepath.Join(getWd, "cmd/web/templates/index.html"))) +} + func NewApp(libPath string) (*App, error) { lib, err := steam.NewLibrary(libPath) if err != nil { -- cgit v1.2.3