Dawn Theme Changes work fine in Dev don't work in Prod

I am at a loss as to why changes I made in a theme run perfectly fine on my dev machine but not in prod. Both ghost instances are running ghost 5.59.1. Anyone have any ideas what I might be doing wrong? Below are some differences with the environments…

Prod

  • node 16.2.2
  • mysql8
  • did not install yarn, gulp as I assume I don’t need to

Dev

  • node 18.17.1
  • sqlite3
  • installed yarn, gulp

There are super minor changes to the index and loop HBS files associated with the Ghost Dawn template; eg show 2 weeks of posts on the homepage and hide the load more paginate button.

I have GitHub setup to push committed changes to prod but noticed the changes I made don’t render on Prod. In fact, content on the homepage content feed is blank (eg the loop isn’t working.) So, then I ran yarn zip to compile a dist archive and manually upload to prod. Same thing, changes don’t show on prod, homepage content feed is blank. I’ve tried restarting the server, made no difference.

Here’s index.hbs – the original code vs my changes

Original Code

{{!< default}}

<main class="site-main">

    <div class="post-feed gh-feed gh-canvas">
        {{#foreach posts}}
            {{> "loop"}}
        {{/foreach}}
    </div>

    {{pagination}}

</main>

My Changes

{{!< default}}

<main class="site-main">

   <div class="post-feed gh-feed gh-canvas">
      {{#get "posts" filter="published_at:>'2 weeks ago'" limit="all"}}
         {{#foreach posts}}
            {{> "loop"}}
         {{/foreach}}
      {{/get}}
   </div>

</main>

Here’s loop.hbs – with original code vs my changes

Original code

<article class="feed {{visibility}} {{post_class}}">

    <div class="feed-calendar">
        <div class="feed-calendar-month">
            {{date published_at format="MMM"}}
        </div>
        <div class="feed-calendar-day">
            {{date published_at format="DD"}}
        </div>
    </div>

    <h2 class="feed-title">{{title}}</h2>

    <div class="feed-right">
        {{> "icons/star"}}
        <div class="feed-length">
            {{reading_time}}
        </div>
    </div>

    {{> "icons/chevron-right"}}

    <a class="u-permalink" href="{{url}}" aria-label="{{title}}"></a>

</article>

My changes

<article class="feed {{visibility}} {{post_class}}">

    <div class="feed-calendar">
        <div class="feed-calendar-month">
            {{date published_at format="MMM"}}
        </div>
        <div class="feed-calendar-day">
            {{date published_at format="DD"}}
        </div>
    </div>

    <h2 class="feed-title">{{title}}</h2>

    <div class="feed-tags">
        {{#foreach tags}}
            <a href="{{url}}" class="tag">{{name}}</a>
        {{/foreach}}
    </div>

    <div class="feed-right">
        {{> "icons/star"}}
        <div class="feed-length">
            {{reading_time}}
        </div>
    </div>

    {{> "icons/chevron-right"}}

    <a class="u-permalink" href="{{url}}" aria-label="{{title}}"></a>

</article>

published_at:>'2 weeks ago'

That’s not a valid filter. Docs for the filter param can be found at https://ghost.org/docs/content-api/#filtering

TL;DR: The relative date format is published_at:<now-2w

3 Likes