From ef9727e88bf5069dd145d7b72562843064e7cf1e Mon Sep 17 00:00:00 2001 From: Richard JE Cooke Date: Mon, 30 May 2022 16:45:28 +0200 Subject: [PATCH] Corrected partials include directive to quote filenames, to work with modern Liquid templates. Otherwise you have to set "dynamicPartials: false" in your config file. --- eleventy-walkthrough/partials-and-include.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eleventy-walkthrough/partials-and-include.html b/eleventy-walkthrough/partials-and-include.html index 703f7a6..3cd2bea 100644 --- a/eleventy-walkthrough/partials-and-include.html +++ b/eleventy-walkthrough/partials-and-include.html @@ -141,7 +141,7 @@

Partials and Include

Using Include

- The tag {% include %} is how a partial is added to a page. By default, Eleventy looks for partials in the _includes folder. For example, to include header HTML that is in the file _includes/_head.html, the tag would be {% include _head.html %}. Note that it's common practice to start the filename of a partial with "_". + The tag {% include %} is how a partial is added to a page. By default, Eleventy looks for partials in the _includes folder. For example, to include header HTML that is in the file _includes/_head.html, the tag would be {% include `_head.html` %}. Note that it's common practice to start the filename of a partial with "_".

Create a file _includes/_head.html @@ -178,7 +178,7 @@

Using Include

- finch - sparrow --- -{% include _head.html %} +{% include `_head.html` %} <h1>{{ title }}</h1> <ul> @@ -187,7 +187,7 @@

Using Include

{% endfor %} </ul> -{% include _foot.html %} +{% include `_foot.html` %}