From c163ae690ee2a72b1c9bac7733565d0b545406d9 Mon Sep 17 00:00:00 2001 From: video-prize-ranch Date: Thu, 29 Jun 2023 22:23:14 +0000 Subject: [PATCH] Support /t/TAG/ID paths (closes #117) --- main.go | 1 + pages/post.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/main.go b/main.go index e85f143..59eb435 100644 --- a/main.go +++ b/main.go @@ -118,6 +118,7 @@ func main() { app.Get("/a/:postID", pages.HandlePost) app.Get("/a/:postID/embed", pages.HandleEmbed) app.Get("/t/:tag", pages.HandleTag) + app.Get("/t/:tag/:postID", pages.HandlePost) app.Get("/user/:userID", pages.HandleUser) app.Get("/r/:sub/:postID", pages.HandlePost) app.Get("/user/:userID/cover", pages.HandleUserCover) diff --git a/pages/post.go b/pages/post.go index 8c97318..f273b7d 100644 --- a/pages/post.go +++ b/pages/post.go @@ -20,6 +20,8 @@ func HandlePost(c *fiber.Ctx) error { post, err = ApiClient.FetchAlbum(c.Params("postID")) case strings.HasPrefix(c.Path(), "/gallery"): post, err = ApiClient.FetchPosts(c.Params("postID")) + case strings.HasPrefix(c.Path(), "/t"): + post, err = ApiClient.FetchPosts(c.Params("postID")) default: post, err = ApiClient.FetchMedia(c.Params("postID")) }