Do I really need to stop start every template edit?

Hello, I can only assume i’m doing something wrong. To get the changes to to .hbs files to appear in browser, I need to stop then start ghost? I thought using ‘ghost run’ would stop this happening.

I also then need to chmod files back to ghost as I have to root in to the VM to be able to overwrite.

It’s quite frustrating as editing the templates has been really straightforward and Ghost itself is amazing. Any ideas? Or should I just make a script to automate?

Cheers

This is not my experience, so I suspect you’re editing directly in the Ghost folders. Any edits I make, are uploaded in the theme file (zip), and this process checks for errors and makes the changes live.

Code mirror looks excellent, it looks like it can be installed into content/themes. Obviously, this method would make it easy to ‘brick’ the content side of the website. I will try it later and share my results.

If you’re running ghost in development mode, changes will automatically be picked up; in prod ghost uses template caching so changes wouldn’t be picked up

4 Likes

In Production mode is the template cache necessary? How would a ghost site in dev mode on web for real visitors behave without the cache?

It’s absolutely required, since the template has to be converted from text into javascript that’s later executed which in compute terms is expensive.

If you’re trying to make changes to your theme, the best thing you can do is install a local version of Ghost which uses a much simpler setup in dev mode and is designed exactly for this use case.

1 Like

Thank you for the additional information. I have it setup locally but don’t quite have the workflow working for me. I will get there.

1 Like

I didn’t finish trying the method above, but, I installed cockpit and then cockpit navigator on the VM ghost is on and you can edit the files in a text editor via a browser. It quickly went from a few changes to a huge amount of modification, so I used Github anyway.

You can also edit the files and restart Ghost via the https://www.cloudron.io sysadmin system. I’ve been using it for years now, they keep their apps up to date.