| author | 2025-09-06 19:18:00 +0700 | |
|---|---|---|
| committer | 2025-09-06 19:18:00 +0700 | |
| commit | 13a66428533c5f870901343dd505bcb835015430 (patch) | |
| tree | 5c63fabb02fa9c55c9e7cf2c26c2a35a90806f35 /internal/router/api-v1-general-page-bottom-embeds.go | |
| parent | 0802dc3a8835bc19cf994f9eb2b462df604d4262 (diff) | |
| download | web-13a66428533c5f870901343dd505bcb835015430.tar.gz web-13a66428533c5f870901343dd505bcb835015430.zip | |
feat: home page
feat: my random fact giver for a home page
feat: stricter cors policy
refactor: move lightlibrary css onto my bucket
Diffstat (limited to 'internal/router/api-v1-general-page-bottom-embeds.go')
| -rw-r--r-- | internal/router/api-v1-general-page-bottom-embeds.go | 4 |
1 files changed, 3 insertions, 1 deletions
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...) |