diff --git a/test/test_site/expected/siteData.json b/test/test_site/expected/siteData.json
index fd33f3e089..65aaabefe0 100644
--- a/test/test_site/expected/siteData.json
+++ b/test/test_site/expected/siteData.json
@@ -50,6 +50,18 @@
"include-from-another-markbind-site": "Include from another Markbind site",
"trimmed-include": "Trimmed include",
"fragment-with-leading-spaces-and-newline": "Fragment with leading spaces and newline",
+ "include-with-custom-variables": "Include with custom variables",
+ "test-included-variable": "Test included variable",
+ "test-included-variable-with-markdown": "Test included variable with markdown",
+ "test-included-variable-as-attribute": "Test included variable as attribute",
+ "test-included-variable-as-html-element": "Test included variable as html element",
+ "test-included-variable-overridden-by-variables-md": "Test included variable overridden by variables.md",
+ "test-included-variables-in-included-file": "Test included variables in included file",
+ "inner-included-variables-should-not-leak-into-other-files": "Inner included variables should not leak into other files",
+ "test-included-variable-with-global-variable": "Test included variable with global variable",
+ "test-included-variable-overridden-by-set": "Test included variable overridden by set",
+ "test-missing-variable-with-default": "Test missing variable with default",
+ "included-variables-should-not-leak-into-other-files": "Included variables should not leak into other files",
"panel-without-src": "Panel without src",
"panel-with-normal-src": "Panel with normal src",
"panel-with-src-from-a-page-segment": "Panel with src from a page segment",
diff --git a/test/test_site/index.md b/test/test_site/index.md
index 036dc60110..623743bc4a 100644
--- a/test/test_site/index.md
+++ b/test/test_site/index.md
@@ -95,6 +95,24 @@ head: myCustomHead.md, myCustomHead2.md
##
+# Include with custom variables
+
+
+ Included variable
+ __**Included variable with markdown**__
+ color: blue
+ Included variable within html element
+ Included variable overridden by global variable
+ Included variable overriding inner variable
+ Included variable in outer included file
+ Included variable should not leak into other files
+ Included variable with {{ included_global_variable }}
+
+
+# Included variables should not leak into other files
+
+
+
# Panel without src
diff --git a/test/test_site/testIncludeVariableLeak.md b/test/test_site/testIncludeVariableLeak.md
new file mode 100644
index 0000000000..ddd0e97965
--- /dev/null
+++ b/test/test_site/testIncludeVariableLeak.md
@@ -0,0 +1 @@
+Should be blank: {{ included_variable_should_not_leak }}
diff --git a/test/test_site/testIncludeVariableLeakInner.md b/test/test_site/testIncludeVariableLeakInner.md
new file mode 100644
index 0000000000..11d716589a
--- /dev/null
+++ b/test/test_site/testIncludeVariableLeakInner.md
@@ -0,0 +1 @@
+Should be blank: {{ included_variable_should_not_leak_inner }}
diff --git a/test/test_site/testIncludeVariables.md b/test/test_site/testIncludeVariables.md
new file mode 100644
index 0000000000..b2e174d685
--- /dev/null
+++ b/test/test_site/testIncludeVariables.md
@@ -0,0 +1,36 @@
+# Test included variable
+{{ included_variable }}
+
+# Test included variable with markdown
+{{ included_variable_with_markdown }}
+
+# Test included variable as attribute
+Test
+
+# Test included variable as html element
+{{ included_variable_as_html_element }}
+
+# Test included variable overridden by variables.md
+{{ global_variable_overriding_included_variable }}
+
+# Test included variables in included file
+
+ Included variable overridden by outer variable
+ Included variable should not leak into other files
+
+
+# Inner included variables should not leak into other files
+
+
+# Test included variable with global variable
+{{ included_variable_with_global_variable }}
+
+{% set included_variable = "Inner variable overridden by set" %}
+{% set included_global_variable = "Global variable overridden by set" %}
+
+# Test included variable overridden by set
+{{ included_variable }}
+{{ included_global_variable }}
+
+# Test missing variable with default
+{{ missing_variable or "Missing Variable" }}
diff --git a/test/test_site/testIncludeVariablesIncludedFile.md b/test/test_site/testIncludeVariablesIncludedFile.md
new file mode 100644
index 0000000000..db4ccc4cc7
--- /dev/null
+++ b/test/test_site/testIncludeVariablesIncludedFile.md
@@ -0,0 +1,3 @@
+{{ included_variable_in_outer_included_file }}
+
+{{ included_variable_inner_overridden }}