bartholomew icon indicating copy to clipboard operation
bartholomew copied to clipboard

Set a publish date at fragment level not just page level

Open itowlson opened this issue 1 year ago • 2 comments

Consider the following not entirely hypothetical scenario:

  • A site where it is desirable to schedule pages, for example to synchronise with an announcement or release
  • The site also has an index or table of contents with links to pages (manually updated rather than generated on the fly)

But if we future-date a page and merge it together with its TOC entry, the TOC entry is dangling! So we have to fall back to some unfortunate individual, say in Australia, having to stay up into the small hours to merge it at the right moment.

A possible way out of this would be to allow fragments to have publish dates. Then the TOC entry could be timed for the same moment as the new page.

This could also help with page changes, where you want to add a piece of content to an existing page, but only have that content appear at the prescribed time.

The downside of this approach is that if publish-by dates are kept around, pages end up as a mass of "hide until 4 October 1973" scar tissue, so users of this feature would need to be diligent about cleaning up! So if there is a more self-sustaining way to do this then that would be even more betterer...!

itowlson avatar Jul 24 '23 01:07 itowlson

This is already possible with the help of rhai scripts since this PR was merged.

It would require the content in question to be wrapped with an if statement calling a rhai script that returns if the the current date exceeds the set date.

karthik2804 avatar Jul 24 '23 01:07 karthik2804

Oooh! Nice!

itowlson avatar Jul 24 '23 01:07 itowlson