From 1c44d42bd273d6ec4024ca98ce4f90e28c6b09d6 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Sat, 13 Apr 2024 15:52:09 +0800 Subject: [PATCH] Use site metadata in templates --- src/_includes/main/base.njk | 6 +++--- src/_includes/start/base.njk | 10 +++++----- src/index.njk | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/_includes/main/base.njk b/src/_includes/main/base.njk index c4afc66d..b5ff61b4 100644 --- a/src/_includes/main/base.njk +++ b/src/_includes/main/base.njk @@ -10,8 +10,8 @@ {% metagen desc=desc or metadata.desc, url=url + page.url, - locale="en_MY", - site_name="Leilukin's Hub", + locale=sitemeta.siteLocale, + site_name=sitemeta.siteName, img=image, img_alt=alt, twitter_card_type=type, @@ -33,7 +33,7 @@ - {{ title }} | Leilukin's Hub + {{ title }} | {{ sitemeta.siteName }} {% renderTemplate "webc" %} diff --git a/src/_includes/start/base.njk b/src/_includes/start/base.njk index 730f2866..100de440 100644 --- a/src/_includes/start/base.njk +++ b/src/_includes/start/base.njk @@ -6,12 +6,12 @@ {# Meta data #} - + {% metagen desc=desc or metadata.desc, url=url + page.url, - locale="en_MY", - site_name="Leilukin's Hub", + locale=sitemeta.siteLocale, + site_name=sitemeta.siteName, img=image, img_alt=alt, twitter_card_type=type, @@ -27,11 +27,11 @@ - {% if title %} {{ title }} | {% endif %} Leilukin's Hub + {% if title %} {{ title }} | {% endif %} {{ sitemeta.siteName }}
- Leilukin's Hub website banner + {{ sitemeta.siteName }} website banner

{{ h1 }}

{{ content | safe }} diff --git a/src/index.njk b/src/index.njk index fdfc86a1..e201943a 100644 --- a/src/index.njk +++ b/src/index.njk @@ -2,7 +2,8 @@ layout: start/base tags: pages desc: Welcome to Leilukin's personal website. -h1: Welcome to Leilukin's Hub! +eleventyComputed: + h1: Welcome to {{ sitemeta.siteName | safe }}! ---
@@ -11,7 +12,7 @@ h1: Welcome to Leilukin's Hub!
\ No newline at end of file