From 13a66428533c5f870901343dd505bcb835015430 Mon Sep 17 00:00:00 2001 From: SayaAndy Date: Sat, 6 Sep 2025 19:18:00 +0700 Subject: feat: home page feat: my random fact giver for a home page feat: stricter cors policy refactor: move lightlibrary css onto my bucket --- internal/router/api-v1-general-page-bottom-embeds.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/router/api-v1-general-page-bottom-embeds.go') diff --git a/internal/router/api-v1-general-page-bottom-embeds.go b/internal/router/api-v1-general-page-bottom-embeds.go index df766a7..c4d9543 100644 --- a/internal/router/api-v1-general-page-bottom-embeds.go +++ b/internal/router/api-v1-general-page-bottom-embeds.go @@ -38,7 +38,7 @@ func Api_V1_GeneralPage_BottomEmbeds(l map[string]*locale.LocaleConfig, langs [] } pathParts := strings.Split(strings.Trim(path, "/"), "/") - if len(pathParts) < 2 { + if len(pathParts) == 0 { return c.Status(fiber.ErrBadRequest.Code).SendString("'Referer' header is invalid: expect format '/{lang}/...'") } @@ -58,6 +58,8 @@ func Api_V1_GeneralPage_BottomEmbeds(l map[string]*locale.LocaleConfig, langs [] additionalTemplates = append(additionalTemplates, "views/pages/blog-catalogue.html") } else if len(pathParts) == 3 && pathParts[1] == "blog" { additionalTemplates = append(additionalTemplates, "views/pages/blog-page.html") + } else if len(pathParts) == 1 { + additionalTemplates = append(additionalTemplates, "views/pages/home-page.html") } content, err := tm.Render("general-page-bottom-embeds", values, additionalTemplates...) -- cgit v1.3.1+17