ponzu-cms / ponzu

Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.
https://docs.ponzu-cms.org
BSD 3-Clause "New" or "Revised" License
5.68k stars 386 forks source link

Hook #176

Closed agung-wete closed 7 years ago

agung-wete commented 7 years ago

Hi i'm trying to use ponzu + hugo is there any hook to call if content added / updated in ponzu (like github hook) ?

thank you

nilslice commented 7 years ago

There are a number of hooks provided by the item.Hookable interface whose default implementations can be overriden by any of your Content types.

The documentation for these are here: https://docs.ponzu-cms.org/Interfaces/Item/#itemhookable

There are brief descriptions for each hook on that page. Based on your comment, it sounds like you might want something like AfterSave and AfterDelete? Let me know if it isn't clear how these should be implemented and I can try to expand.

I'd be delighted to know how you are using Ponzu + Hugo together if you're able to share!

agung-wete commented 7 years ago

thank you hugo has datafiles and datadrivencontent, i'm trying the best approach to combine with ponzu

nilslice commented 7 years ago

Cool - I didn't know about those features of Hugo, thanks for sharing!

Do the Hooks in Ponzu work for what you are trying to accomplish?