diff options
| author | 2025-10-25 23:25:31 +0700 | |
|---|---|---|
| committer | 2025-10-25 23:25:31 +0700 | |
| commit | dd69b45d3a41be2b5c38892c3b107770a0f859f2 (patch) | |
| tree | d2b6ed2bd645eef448f987e57b97ff918909ea48 /internal/router/root.go | |
| parent | 69b868a7655a25c82ce4a2bd444812be69c8b998 (diff) | |
| parent | 629e275e5270ed146f9cd6dba25383cf80022909 (diff) | |
| download | web-0.11.0.tar.gz web-0.11.0.zip | |
v0.11.0 (#17)v0.11.0
- [feat: send new blog posts to
subscribers](https://github.com/SayaAndy/saya-today-web/commit/adcd8cf82f7ec4027701643c545b1f27a7cfc221)
- [feat: email
linking](https://github.com/SayaAndy/saya-today-web/commit/0d261d2f7d080b610f50102576073e334a89e8cb)
- [feat: subscription
settings](https://github.com/SayaAndy/saya-today-web/commit/4b2da2abbc7376ce0de71a00b18b7091b00dbcd1)
- [feat: allow to unsubscribe from an
email](https://github.com/SayaAndy/saya-today-web/commit/df7a0ae1c0fc177cba2eae8cc73fe21d2afdd229)
Diffstat (limited to 'internal/router/root.go')
| -rw-r--r-- | internal/router/root.go | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/internal/router/root.go b/internal/router/root.go deleted file mode 100644 index f4a0692..0000000 --- a/internal/router/root.go +++ /dev/null @@ -1,27 +0,0 @@ -package router - -import ( - "log/slog" - - "github.com/SayaAndy/saya-today-web/config" - "github.com/gofiber/fiber/v2" -) - -func init() { - tm.Add("index", "views/index.html") -} - -func Root(localeCfg []config.AvailableLanguageConfig) func(c *fiber.Ctx) error { - return func(c *fiber.Ctx) error { - content, err := tm.Render("index", fiber.Map{ - "AvailableLanguages": localeCfg, - }) - if err != nil { - slog.Warn("failed to generate page", slog.String("page", "/"), slog.String("error", err.Error())) - c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8) - return c.Status(fiber.ErrInternalServerError.Code).SendString("failed to generate page") - } - - return c.Type("html").Send(content) - } -} |