How to reflect changes in *.hbs files


if theme files get changed, Ghost doesn’t reflect that in a production environment. Currently, I restart ghost after I deployed changes to a theme or other files.
Is there a better way, or some kind of hook, I could use and run to let Ghost load the changes?


In a production environment, you shouldn’t be modifying the theme contents as you would locally. Like you discovered, Ghost caches the handlebars for performance.

If you’re looking to change your theme in a production environment, you can use the Admin API, or the Themes interface in the Admin panel. A great example of how you can integrate theme deployment into a CI/CD pipeline can be found with Ghost Deploy Theme GitHub Action

Thanks for your answer and the link.

I don’t have a git repository for my theme. I change the files locally and upload them. I know, this could be automated with a CI/CD pipeline, but I kind of like the manual apporach. . .
Isn’t there a hook in the backend to reload the theme?

The hook is done by uploading/activating a theme :smiley: You can try activating the same theme using the API, but I’m not sure if there is logic in place to avoid doing extra work.