Create list with posts from the past 7 days

I’m looking to have a list from all blog posts from the past 7 days, i’ve searched and found the following:

{{#get “posts” filter=“published_at:>‘2015-07-20’” limit=“5”}}

Now, how do i get the date to be the current date - 8 days?

Hi Tom,

Handlebars templates are executed server side and cached, therefore they’re not really useful for the kind of dynamic content you’re trying to achieve.

For dynamic content, it’s more appropriate to use client side JavaScript and talk to the API. That way you can have all the dynamic variables you need. There’s a guide for doing this from an external site here: https://api.ghost.org/docs/ajax-calls-from-an-external-website the approach would be the same, only you won’t need to jump through all the hoops with trusted domains, because your Ghost theme already has access to the SDK and API.

Thanks for your quick response!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.