aboutsummaryrefslogtreecommitdiff
path: root/controllers/posts.go
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-07-07 15:18:49 +0530
committerBobby <[email protected]>2025-07-07 15:18:49 +0530
commit98afdc4673f616bc61f9ef673580ca3933bdef8a (patch)
tree0a6e36249773a35ab2f9f7696501f9b64d849884 /controllers/posts.go
parent9e4d6b1e271032d14e55f16395343979276e8de5 (diff)
downloadimageboard-98afdc4673f616bc61f9ef673580ca3933bdef8a.tar.xz
imageboard-98afdc4673f616bc61f9ef673580ca3933bdef8a.zip
refactor to y2k retro style with django templates
Diffstat (limited to 'controllers/posts.go')
-rw-r--r--controllers/posts.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/controllers/posts.go b/controllers/posts.go
new file mode 100644
index 0000000..6fdcd26
--- /dev/null
+++ b/controllers/posts.go
@@ -0,0 +1,22 @@
+package controllers
+
+import (
+ "imageboard/utils/shortcuts"
+
+ "github.com/gofiber/fiber/v2"
+)
+
+func PostsController(ctx *fiber.Ctx) error {
+ ctx.Locals("Title", "Posts")
+
+ searchQuery := ctx.Query("tags", "")
+
+ customdata := struct {
+ SearchQuery string
+ Posts []interface{}
+ }{
+ SearchQuery: searchQuery,
+ Posts: []interface{}{},
+ }
+ return shortcuts.Render(ctx, "posts", customdata)
+}