From eafedf907e0492d96d6564fa4ddf86652c034f6d Mon Sep 17 00:00:00 2001 From: Timothy McCallum Date: Mon, 27 Nov 2023 11:58:39 +1000 Subject: [PATCH 1/3] Document scheduling menu items for timed release Signed-off-by: tpmccallum tim.mccallum@fermyon.com Signed-off-by: Timothy McCallum --- content/spin/v2/contributing-docs.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/content/spin/v2/contributing-docs.md b/content/spin/v2/contributing-docs.md index bda626b1a..0b30adcf3 100644 --- a/content/spin/v2/contributing-docs.md +++ b/content/spin/v2/contributing-docs.md @@ -439,7 +439,19 @@ $ spin build $ spin up -e "PREVIEW_MODE=1" ``` -> Please note: using the `PREVIEW_MODE=1` as part of a `spin` command is safe on localhost and allows you to view content (even if the `date` setting in the content's `.md` is set to a future date). It is often the case that you will be checking content before the publishing date via your system. The developer documentation's manifest file `spin.toml` has the `PREVIEW_MODE` set to `0` i.e. `environment = { PREVIEW_MODE = "0" }`. This `spin.toml` file is correct for a production environment and should always be `0` (so that the CMS adheres to the publishing `date` setting for content on the public site). Simply put, you can use `PREVIEW_MODE=1` safely in your command line on your locahost but you should never update the `spin.toml` file (in this regard). +> Please note: using the `PREVIEW_MODE=1` as part of a `spin` command is safe on localhost and allows you to view the content (even if the `date` setting in the content's `.md` is set to a future date). It is often the case that you will be checking content before the publishing date via your system. The developer documentation's manifest file `spin.toml` has the `PREVIEW_MODE` set to `0` i.e. `environment = { PREVIEW_MODE = "0" }`. This `spin.toml` file is correct for a production environment and should always be `0` (so that the CMS adheres to the publishing `date` setting for content on the public site). Simply put, you can use `PREVIEW_MODE=1` safely in your command line on your localhost but you should never update the `spin.toml` file (in this regard). + +### 6.8 Scheduling Menu Items for Timed Release + +As mentioned above, all pages (`.md` files) in the documentation have a UTC date i.e. `date = "2023-07-25T17:26:00Z"`. The `date` is a page scheduling mechanism whereby each page is only displayed if the `date` has elapsed. Menu items (found in the `/developer/templates/*.hbs` files) that relate to a scheduled page can also be scheduled (so the specific menu item and its associated page appear at the same time). Simply envelope the menu item with the following `if` syntax to synchronize the appearance of the menu item with the related page: + + + +``` +{{#if (timed_publish "2023-07-25T17:26:00Z" env.PREVIEW_MODE)}} + // Scheduled menu item for timed release +{{/if}} +``` ### 7. Checking Web Pages From bdbfec374d3725eb345c3ee54dfbd8cbc33e570f Mon Sep 17 00:00:00 2001 From: Timothy McCallum Date: Mon, 27 Nov 2023 12:00:31 +1000 Subject: [PATCH 2/3] Update contributing-docs.md Signed-off-by: tpmccallum tim.mccallum@fermyon.com Signed-off-by: Timothy McCallum --- content/spin/v2/contributing-docs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/spin/v2/contributing-docs.md b/content/spin/v2/contributing-docs.md index 0b30adcf3..81ed383c7 100644 --- a/content/spin/v2/contributing-docs.md +++ b/content/spin/v2/contributing-docs.md @@ -27,6 +27,7 @@ keywords = "contribute contributing" - [6.5 How To Properly Edit CSS Styles](#65-how-to-properly-edit-css-styles) - [6.6 Checking Your Content - Using Bartholomew's CLI](#66-checking-your-content---using-bartholomews-cli) - [6.7 Checking Your Content - Preview a Documentation Page on Localhost](#67-checking-your-content---preview-a-documentation-page-on-localhost) + - [6.8 Scheduling Menu Items for Timed Release](#68-scheduling-menu-items-for-timed-release) - [7. Checking Web Pages](#7-checking-web-pages) - [8. Add Changes](#8-add-changes) - [9. Commit Changes](#9-commit-changes) From 9bafe197749686c7edfd48ff4aba8da08a52030d Mon Sep 17 00:00:00 2001 From: Timothy McCallum Date: Mon, 27 Nov 2023 14:57:28 +1000 Subject: [PATCH 3/3] Update contributing-docs.md Signed-off-by: tpmccallum tim.mccallum@fermyon.com Signed-off-by: Timothy McCallum --- content/spin/v2/contributing-docs.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/spin/v2/contributing-docs.md b/content/spin/v2/contributing-docs.md index 81ed383c7..9b31be406 100644 --- a/content/spin/v2/contributing-docs.md +++ b/content/spin/v2/contributing-docs.md @@ -454,6 +454,8 @@ As mentioned above, all pages (`.md` files) in the documentation have a UTC date {{/if}} ``` +> In order to keep the code tidy and readable it is advised to remove the `if` logic (from the `.hbs` file) that wraps the content, once the `timed_publish` has elapsed. + ### 7. Checking Web Pages The `bart check` command can be used to check the content. Simply pass in the content as a parameter. The developer documentation [uses shortcodes](/bartholomew/shortcodes), so always pass `--shortcodes ./shortcodes` as shown below: