Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add script to enable publish by time #756

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

karthik2804
Copy link
Contributor

Content can be wrapped around with the following tag in templates to enable displaying them only once a preset time is past.

{{#if (timed_publish "2023-07-25T17:26:00Z" env.PREVIEW_MODE)}}

// Content

{{/if}}

Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
@karthik2804 karthik2804 requested a review from itowlson July 24, 2023 18:40
Copy link
Contributor

@tpmccallum tpmccallum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just going to test this locally and will approve soon.

scripts/timed_publish.rhai Outdated Show resolved Hide resolved
Signed-off-by: tpmccallum tim.mccallum@fermyon.com

Signed-off-by: Timothy McCallum <tim.mccallum@fermyon.com>
@tpmccallum
Copy link
Contributor

Thanks @karthik2804
This works great (even nesting the publish time if inside a sidebar menu's if.
Thanks again; this will come in handy in the future.

@tpmccallum tpmccallum merged commit 5f6b897 into fermyon:main Nov 22, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants