From aa90c7048d1fd38c4a3f027d1495e73fbd6cc98b Mon Sep 17 00:00:00 2001 From: juls0730 <62722391+juls0730@users.noreply.github.com> Date: Sat, 23 Nov 2024 02:21:26 -0600 Subject: [PATCH] reorganize and fix some stuff --- main.go | 16 +- styles/main.css | 2 + tailwind.config.js | 2 +- {views => templates}/layouts/main.hbs | 4 +- templates/views/admin/index.hbs | 203 +++++++++++++++++++++ {views => templates/views}/admin/login.hbs | 13 +- templates/views/index.hbs | 77 ++++++++ views/admin/index.hbs | 175 ------------------ views/index.hbs | 54 ------ 9 files changed, 304 insertions(+), 242 deletions(-) rename {views => templates}/layouts/main.hbs (65%) create mode 100644 templates/views/admin/index.hbs rename {views => templates/views}/admin/login.hbs (66%) create mode 100644 templates/views/index.hbs delete mode 100644 views/admin/index.hbs delete mode 100644 views/index.hbs diff --git a/main.go b/main.go index 1a735d7..706af9c 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,7 @@ import ( "github.com/chai2010/webp" "github.com/gofiber/fiber/v3" + "github.com/gofiber/fiber/v3/middleware/helmet" "github.com/gofiber/fiber/v3/middleware/static" "github.com/gofiber/template/handlebars/v2" "github.com/google/uuid" @@ -35,7 +36,7 @@ import ( "github.com/nfnt/resize" ) -//go:embed assets/** views/** schema.sql +//go:embed assets/** templates/** schema.sql var embeddedAssets embed.FS var devContent string = ` \ No newline at end of file diff --git a/views/admin/login.hbs b/templates/views/admin/login.hbs similarity index 66% rename from views/admin/login.hbs rename to templates/views/admin/login.hbs index 9f1281a..983917e 100644 --- a/views/admin/login.hbs +++ b/templates/views/admin/login.hbs @@ -1,4 +1,4 @@ -
+
@@ -6,9 +6,14 @@ Login
- - - + + +
diff --git a/templates/views/index.hbs b/templates/views/index.hbs new file mode 100644 index 0000000..3ace5d9 --- /dev/null +++ b/templates/views/index.hbs @@ -0,0 +1,77 @@ +
+
+
+ + {{{WeatherData.Icon}}} + +
+

{{WeatherData.Temp}}°C

+

{{WeatherData.Desc}}

+
+
+
+
+
+ + + + + + + + + + + + + + +

Passport

+
+ +
+
+
+
+ {{#each Categories}} +
+ {{this.Name}} +

{{this.Name}}

+
+
+ {{#each this.Links}} + + {{this.Name}} +
+

{{this.Name}}

+

{{this.Description}}

+
+
+ {{/each}} +
+ {{/each}} +
+
+ + \ No newline at end of file diff --git a/views/admin/index.hbs b/views/admin/index.hbs deleted file mode 100644 index bdda3d9..0000000 --- a/views/admin/index.hbs +++ /dev/null @@ -1,175 +0,0 @@ -
-
- {{#each Categories}} -
- -

{{this.Name}}

- -
-
- {{#each this.Links}} -
- {{this.Name}} -
-

{{this.Name}}

-

{{this.Description}}

-
- -
- {{/each}} - -
- {{/each}} -
- -

Add a new category

-
-
-
- - - - \ No newline at end of file diff --git a/views/index.hbs b/views/index.hbs deleted file mode 100644 index 71a7d94..0000000 --- a/views/index.hbs +++ /dev/null @@ -1,54 +0,0 @@ -
-
-
- - {{{WeatherData.Icon}}} - -
-

{{WeatherData.Temp}}°C

-

{{WeatherData.Desc}}

-
-
-
-
-
- -

Passport

-
- -
-
-
-
- {{#each Categories}} -
- -

{{this.Name}}

-
-
- {{#each this.Links}} - -
- {{this.Name}} -
-

{{this.Name}}

-

{{this.Description}}

-
-
-
- {{/each}} -
- {{/each}} -
-
- - \ No newline at end of file