discovery.go 634 B

1234567891011121314151617181920212223242526272829303132333435
  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. }
  17. func NovelDiscoveryPage(c *fiber.Ctx) error {
  18. mode := c.Query("mode", "safe")
  19. works, err := core.GetDiscoveryNovels(c, mode)
  20. if err != nil {
  21. return err
  22. }
  23. return c.Render("pages/novelDiscovery", fiber.Map{
  24. "Novels": works,
  25. "Title": "Discovery",
  26. })
  27. }