From d3d12bcc4c010dd005afd54ee2749a28a7642867 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Sun, 14 Apr 2024 01:52:18 +0800 Subject: [PATCH] Move the metagen shortcode block to its own template --- src/_includes/main/base.njk | 11 +---------- src/_includes/metagen.njk | 11 +++++++++++ src/_includes/start/base.njk | 11 +---------- 3 files changed, 13 insertions(+), 20 deletions(-) create mode 100644 src/_includes/metagen.njk diff --git a/src/_includes/main/base.njk b/src/_includes/main/base.njk index b5ff61b4..0263fab3 100644 --- a/src/_includes/main/base.njk +++ b/src/_includes/main/base.njk @@ -7,16 +7,7 @@ {# Meta data #} - {% metagen - desc=desc or metadata.desc, - url=url + page.url, - locale=sitemeta.siteLocale, - site_name=sitemeta.siteName, - img=image, - img_alt=alt, - twitter_card_type=type, - twitter_handle=twitter - %} + {% include "metagen.njk" %} {# CSS #} diff --git a/src/_includes/metagen.njk b/src/_includes/metagen.njk new file mode 100644 index 00000000..767e9623 --- /dev/null +++ b/src/_includes/metagen.njk @@ -0,0 +1,11 @@ +{% metagen + desc=desc or metadata.desc, + url=url + page.url, + locale=sitemeta.siteLocale, + site_name=sitemeta.siteName, + img=image, + img_alt=alt, + twitter_card_type=type, + twitter_handle=twitter, + generator=eleventy.generator +%} diff --git a/src/_includes/start/base.njk b/src/_includes/start/base.njk index 100de440..e4e0bc33 100644 --- a/src/_includes/start/base.njk +++ b/src/_includes/start/base.njk @@ -7,16 +7,7 @@ {# Meta data #} - {% metagen - desc=desc or metadata.desc, - url=url + page.url, - locale=sitemeta.siteLocale, - site_name=sitemeta.siteName, - img=image, - img_alt=alt, - twitter_card_type=type, - twitter_handle=twitter - %} + {% include "metagen.njk" %} {# CSS #}