From 5d2b097cbd7e9150d625f1e5e2a12186e8f6ccb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=81scar=20M=2E=20Lage?= Date: Mon, 28 Mar 2022 21:50:10 +0200 Subject: [PATCH] Refactor: views/ dir is now called templates/ --- server/server.go | 12 ++++++------ {views => templates}/404.html | 0 {views => templates}/about.html | 0 {views => templates}/base.html | 0 {views => templates}/edit.html | 0 {views => templates}/list.html | 0 {views => templates}/notfound.html | 0 {views => templates}/page.html | 0 8 files changed, 6 insertions(+), 6 deletions(-) rename {views => templates}/404.html (100%) rename {views => templates}/about.html (100%) rename {views => templates}/base.html (100%) rename {views => templates}/edit.html (100%) rename {views => templates}/list.html (100%) rename {views => templates}/notfound.html (100%) rename {views => templates}/page.html (100%) diff --git a/server/server.go b/server/server.go index 9ae0f64..feb9e8f 100644 --- a/server/server.go +++ b/server/server.go @@ -53,12 +53,12 @@ func Serve() { "safeHTML": func(s string) template.HTML { return template.HTML(s) }, - }).ParseFiles("views/page.html", "views/base.html")) - templates["list.html"] = template.Must(template.ParseFiles("views/list.html", "views/base.html")) - templates["edit.html"] = template.Must(template.ParseFiles("views/edit.html", "views/base.html")) - templates["about.html"] = template.Must(template.ParseFiles("views/about.html", "views/base.html")) - templates["notfound.html"] = template.Must(template.ParseFiles("views/notfound.html", "views/base.html")) - templates["404.html"] = template.Must(template.ParseFiles("views/404.html", "views/base.html")) + }).ParseFiles("templates/page.html", "templates/base.html")) + templates["list.html"] = template.Must(template.ParseFiles("templates/list.html", "templates/base.html")) + templates["edit.html"] = template.Must(template.ParseFiles("templates/edit.html", "templates/base.html")) + templates["about.html"] = template.Must(template.ParseFiles("templates/about.html", "templates/base.html")) + templates["notfound.html"] = template.Must(template.ParseFiles("templates/notfound.html", "templates/base.html")) + templates["404.html"] = template.Must(template.ParseFiles("templates/404.html", "templates/base.html")) e.Renderer = &TemplateRegistry{ templates: templates, } diff --git a/views/404.html b/templates/404.html similarity index 100% rename from views/404.html rename to templates/404.html diff --git a/views/about.html b/templates/about.html similarity index 100% rename from views/about.html rename to templates/about.html diff --git a/views/base.html b/templates/base.html similarity index 100% rename from views/base.html rename to templates/base.html diff --git a/views/edit.html b/templates/edit.html similarity index 100% rename from views/edit.html rename to templates/edit.html diff --git a/views/list.html b/templates/list.html similarity index 100% rename from views/list.html rename to templates/list.html diff --git a/views/notfound.html b/templates/notfound.html similarity index 100% rename from views/notfound.html rename to templates/notfound.html diff --git a/views/page.html b/templates/page.html similarity index 100% rename from views/page.html rename to templates/page.html