Search code examples
node.jshandlebars.jsghost-blog

Why don't updates to default.hbs show up on the blog?


I've installed Ghost on an Amazon EC2 instance, and it's been working very well so far.

Today I wanted to make some changes in the default.hbs of the theme (I'm using the default casper theme) in order to get code syntax highlighting. (I'm trying to add prism.) I edited the content/themes/casper/default.hbs file, and added the css and js, like this:

<link rel="stylesheet" type="text/css" href="{{asset "css/prism.css"}}" />

However, the changes do not show up on my blog.

Then, just to test whether my edits are working, I added some content after the site-wrapper div:

<div class="site-wrapper">
<h2>Testing editing the default.hbs</h2>

However, these changes are not showing up on the blog either. I already tried restarting ghost, and restarting the whole web server.

What can be the problem? Do I have to recompile the site somehow, or erase some cache, etc.?


Solution

  • I was hosting my site using pm2. And the site published with pm2 wasn't updated even if I restarted ghost or restarted the machine.

    The site had to be explicitly restarted in pm2 with the following command

    pm2 restart <app_name>
    

    Now my changes properly show up on the site if I restart pm2 every time I want to view my latest changes.