Use site metadata in templates

This commit is contained in:
Helen Chong 2024-04-13 15:52:09 +08:00
parent 7623364218
commit 1c44d42bd2
3 changed files with 11 additions and 10 deletions

View File

@ -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 @@
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png">
<link rel="manifest" href="/assets/favicon/site.webmanifest">
<title>{{ title }} | Leilukin's Hub</title>
<title>{{ title }} | {{ sitemeta.siteName }}</title>
</head>
<body>
{% renderTemplate "webc" %}

View File

@ -6,12 +6,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{# Meta data #}
<meta property="og:title" content="{% if title %}{{ title }}{% else %}Leilukin's Hub{% endif %}">
<meta property="og:title" content="{% if title %}{{ title }}{% else %}{{ sitemeta.siteName }}{% endif %}">
{% 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 @@
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png">
<link rel="manifest" href="/assets/favicon/site.webmanifest">
<title>{% if title %} {{ title }} | {% endif %} Leilukin's Hub</title>
<title>{% if title %} {{ title }} | {% endif %} {{ sitemeta.siteName }}</title>
</head>
<body>
<main>
<img src="/assets/leilukin/Leilukins-Hub-website-banner.png" alt="Leilukin's Hub website banner">
<img src="/assets/leilukin/Leilukins-Hub-website-banner.png" alt="{{ sitemeta.siteName }} website banner">
<h1>{{ h1 }}</h1>
{{ content | safe }}

View File

@ -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 }}!
---
<section class="index__btn-wrapper">
@ -11,7 +12,7 @@ h1: Welcome to Leilukin's Hub!
</section>
<footer>
<a href="/feed.xml" target="blank" title="Leilukin's Hub RSS Feed">
<a href="/feed.xml" target="blank" title="{{ sitemeta.siteName }} RSS Feed">
<img src="/assets/buttons/rss-button.gif" alt="RSS feed button">
</a>
</footer>