I’m using Discourse to handle my comments on posts and pages. When a page/post is loaded (via regular page view or a preview) Discourse will create a new topic with a link to the source (the blog post/page link). So when I work with a new post and click preview the following block will make sure Discourse isn’t notice the the unpublished post.
But if I schedule the post the {{#if published_at }} is “trutly” and will create a new topic in Discourse when I click preview on my scheduled post. Due making part of the post visible for the Discourse members and with a link to the post on the blog before it is published.
So in this case I’m basically looking for a {{#if published }} but that doesn’t seems to exist. So I was looking for a way to “extend” the usage of {{#if published_at }} in a way so I can check in the hbs if the post/page really is published and available for the public.
OK, published_at is not the right thing to use here, as you’ve found it can be set at any point before publishing by setting a past or future (scheduled) published_at date.
Instead, you should be able to use the {{is}} helper to check the context, eg: