From 0975a2d7ea5630ed5b73c9942cc66174409baed6 Mon Sep 17 00:00:00 2001 From: tlylt Date: Sat, 29 Apr 2023 07:33:26 +0800 Subject: [PATCH 1/3] update docs --- docs/userGuide/syntax/dates.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/userGuide/syntax/dates.md b/docs/userGuide/syntax/dates.md index bf930cc05d..c50b95612a 100644 --- a/docs/userGuide/syntax/dates.md +++ b/docs/userGuide/syntax/dates.md @@ -36,10 +36,10 @@ The default output format is `"ddd D MMM"` e.g. Fri 6 Mar {{ njcode('base1 | date(format2, 0)') }} :glyphicon-arrow-right: {{ base1 | date(format2, 0) }}
{{ njcode('base1 | date(format2, 10)') }} :glyphicon-arrow-right: {{ base1 | date(format2, 10) }}
-#### Page variables -Dates can be supplied using [page variables](../reusingContents.html#variables) for convenience. +#### Nunjucks variables +Dates can be supplied using [Nunjucks variables](../reusingContents.html#variables) for convenience. -Inside `variables.md` or referencing page: +Inside the `.md` file of a page: ``` {% raw %}{% set date_pagevar = "2020-03-06" %}{% endraw %} ``` From 70b33349bf8ea66f07265fb9abbb72a840ee3531 Mon Sep 17 00:00:00 2001 From: tlylt Date: Sat, 29 Apr 2023 07:33:47 +0800 Subject: [PATCH 2/3] fix variables --- .../cli/test/functional/test_site/_markbind/variables.md | 1 - .../sub_site/nested_sub_site/_markbind/variables.md | 4 ++++ .../test_site_special_tags/_markbind/variables.md | 4 ++++ packages/core/template/default/_markbind/variables.md | 6 ++---- packages/core/template/minimal/_markbind/variables.md | 6 ++---- 5 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 packages/cli/test/functional/test_site/sub_site/nested_sub_site/_markbind/variables.md create mode 100644 packages/cli/test/functional/test_site_special_tags/_markbind/variables.md diff --git a/packages/cli/test/functional/test_site/_markbind/variables.md b/packages/cli/test/functional/test_site/_markbind/variables.md index 651c833c20..a654e45ed0 100644 --- a/packages/cli/test/functional/test_site/_markbind/variables.md +++ b/packages/cli/test/functional/test_site/_markbind/variables.md @@ -9,6 +9,5 @@ Global Variable Overriding Included Variable Global Variable Global Variable Overriding Page Variable - 2019-01-01 {{ base2 | date("ddd D MMM", 10) }} diff --git a/packages/cli/test/functional/test_site/sub_site/nested_sub_site/_markbind/variables.md b/packages/cli/test/functional/test_site/sub_site/nested_sub_site/_markbind/variables.md new file mode 100644 index 0000000000..4a19d29999 --- /dev/null +++ b/packages/cli/test/functional/test_site/sub_site/nested_sub_site/_markbind/variables.md @@ -0,0 +1,4 @@ + +To inject this HTML segment in your MarkBind files, use {{ example }} where you want to place it. +More generally, surround the segment's id with double curly braces. + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site_special_tags/_markbind/variables.md b/packages/cli/test/functional/test_site_special_tags/_markbind/variables.md new file mode 100644 index 0000000000..4a19d29999 --- /dev/null +++ b/packages/cli/test/functional/test_site_special_tags/_markbind/variables.md @@ -0,0 +1,4 @@ + +To inject this HTML segment in your MarkBind files, use {{ example }} where you want to place it. +More generally, surround the segment's id with double curly braces. + \ No newline at end of file diff --git a/packages/core/template/default/_markbind/variables.md b/packages/core/template/default/_markbind/variables.md index aab37f29a9..4a19d29999 100644 --- a/packages/core/template/default/_markbind/variables.md +++ b/packages/core/template/default/_markbind/variables.md @@ -1,6 +1,4 @@ -To inject this HTML segment in your markbind files, use {{ example }} where you want to place it. +To inject this HTML segment in your MarkBind files, use {{ example }} where you want to place it. More generally, surround the segment's id with double curly braces. - - - \ No newline at end of file + \ No newline at end of file diff --git a/packages/core/template/minimal/_markbind/variables.md b/packages/core/template/minimal/_markbind/variables.md index aab37f29a9..4a19d29999 100644 --- a/packages/core/template/minimal/_markbind/variables.md +++ b/packages/core/template/minimal/_markbind/variables.md @@ -1,6 +1,4 @@ -To inject this HTML segment in your markbind files, use {{ example }} where you want to place it. +To inject this HTML segment in your MarkBind files, use {{ example }} where you want to place it. More generally, surround the segment's id with double curly braces. - - - \ No newline at end of file + \ No newline at end of file From 2b47891d6142b0b4a8e0ee99f66b17ab40fb7f24 Mon Sep 17 00:00:00 2001 From: tlylt Date: Sat, 29 Apr 2023 07:33:59 +0800 Subject: [PATCH 3/3] fix test cases --- packages/cli/test/functional/test_site/index.md | 4 ++++ .../test/functional/test_site/testPageVariablesInInclude.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cli/test/functional/test_site/index.md b/packages/cli/test/functional/test_site/index.md index 3e3e30736d..c081eda5b9 100644 --- a/packages/cli/test/functional/test_site/index.md +++ b/packages/cli/test/functional/test_site/index.md @@ -71,6 +71,10 @@ Page Variable with {{ global_variable }} **Test Page Variable and Included Variable Integrations** +{% set outerNunjucksVariable %} +Outer Nunjucks Variable +{% endset %} + # Heading with multiple keywords diff --git a/packages/cli/test/functional/test_site/testPageVariablesInInclude.md b/packages/cli/test/functional/test_site/testPageVariablesInInclude.md index f64540ffcc..ffba3e422a 100644 --- a/packages/cli/test/functional/test_site/testPageVariablesInInclude.md +++ b/packages/cli/test/functional/test_site/testPageVariablesInInclude.md @@ -1,3 +1,3 @@ **Outer Page Variable Should Not Leak Into Inner Pages** -{{ nested_page_variable or "Outer Page Variable Should Not Leak Into Inner Pages" }} +{{ outerNunjucksVariable or "Outer Page Variable Should Not Leak Into Inner Pages" }}