discovery.go 369 B

123456789101112131415161718192021
  1. package pages
  2. import (
  3. core "codeberg.org/vnpower/pixivfe/v2/core/webapi"
  4. "github.com/gofiber/fiber/v2"
  5. )
  6. func DiscoveryPage(c *fiber.Ctx) error {
  7. mode := c.Query("mode", "safe")
  8. works, err := core.GetDiscoveryArtwork(c, mode)
  9. if err != nil {
  10. return err
  11. }
  12. return c.Render("pages/discovery", fiber.Map{
  13. "Artworks": works,
  14. "Title": "Discovery",
  15. })
  16. }