From c1d54197d0bd3962b095dea1553a12ada4ad17dd Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 15 Oct 2021 17:21:35 +0200 Subject: Move template into own directory --- main.go | 4 +- template.html | 152 ------------------------------------------------ templates/template.html | 152 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+), 153 deletions(-) delete mode 100644 template.html create mode 100644 templates/template.html diff --git a/main.go b/main.go index 4543b9c..cdae7f3 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,9 @@ func loadTemplate() { gopaths := strings.Split(os.Getenv("GOPATH"), ":") for _, p := range gopaths { var err error - tpl, err = template.ParseFiles(path.Join(p, "src", "github.com", "silvasur", "startpage", "template.html")) + tpl, err = template.ParseFiles( + path.Join(p, "src", "github.com", "silvasur", "startpage", "templates", "template.html"), + ) if err == nil { return } diff --git a/template.html b/template.html deleted file mode 100644 index 4b20536..0000000 --- a/template.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - Startpage - - - - {{ if .Weather }} -
- - {{ .Weather.Temp.Value }}° -
- {{ end }} - {{ if .Links }} - - {{ end }} - - - - - - - diff --git a/templates/template.html b/templates/template.html new file mode 100644 index 0000000..4b20536 --- /dev/null +++ b/templates/template.html @@ -0,0 +1,152 @@ + + + + Startpage + + + + {{ if .Weather }} +
+ + {{ .Weather.Temp.Value }}° +
+ {{ end }} + {{ if .Links }} + + {{ end }} + + + + + + + -- cgit v1.2.3-54-g00ecf