cleaner tag parameters

This commit is contained in:
orangix
2023-08-17 12:38:37 +02:00
parent 5c3289d5db
commit 33f306472f
2 changed files with 7 additions and 6 deletions

View File

@@ -80,8 +80,12 @@ func HandlePost(c *fiber.Ctx) error {
}
c.Set("Content-Security-Policy", csp)
tag, sort, page, index := c.Query("tag"), c.Query("sort"), c.Query("page"), c.Query("i")
next := nextInTag(ApiClient, tag, sort, page, index)
var next string
tagParam := strings.Split(c.Query("tag"), ".")
if len(tagParam) == 4 {
tag, sort, page, index := tagParam[0], tagParam[1], tagParam[2], tagParam[3]
next = nextInTag(ApiClient, tag, sort, page, index)
}
return c.Render("post", fiber.Map{
"post": post,