Have got publishing to Netlify

This commit is contained in:
Leon Mika 2025-01-27 15:45:53 +11:00
parent 8e0ffb6c24
commit 7ef6725bdb
23 changed files with 667 additions and 109 deletions

View file

@ -19,7 +19,7 @@ func (s *Site) Create() fiber.Handler {
return err
}
return c.Redirect(fmt.Sprintf("/sites/%v", site.ID))
return c.Redirect(fmt.Sprintf("/sites/%v/posts", site.ID))
}
}
@ -41,6 +41,16 @@ func (s *Site) Show() fiber.Handler {
}
}
func (s *Site) Rebuild() fiber.Handler {
return func(c *fiber.Ctx) error {
if err := s.Site.Rebuild(c.UserContext(), GetSite(c)); err != nil {
return err
}
return c.Redirect(fmt.Sprintf("/sites/%v/posts", GetSite(c).ID))
}
}
func (s *Site) WithSite() fiber.Handler {
return func(c *fiber.Ctx) error {
id, err := c.ParamsInt("siteId")