diff options
Diffstat (limited to 'cmd/web/app.go')
| -rw-r--r-- | cmd/web/app.go | 13 |
1 files changed, 13 insertions, 0 deletions
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 { |
