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