Use block for page and meta title

This commit is contained in:
Helen Chong 2024-04-19 07:13:50 +08:00
parent 4333a82e15
commit 6b465c3587
1 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,3 @@
{%- set pageTitle %}{{ title + " | " if title }}{{ sitemeta.siteName | safe }}{% endset -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" dir="ltr" id="page-top"> <html lang="en" dir="ltr" id="page-top">
<head> <head>
@ -7,7 +6,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
{# Meta data #} {# Meta data #}
{% block metaTitle %}
<meta property="og:title" content="{{ title if title else sitemeta.siteName }}"> <meta property="og:title" content="{{ title if title else sitemeta.siteName }}">
{% endblock %}
{% include "global/metagen.njk" %} {% include "global/metagen.njk" %}
{# CSS #} {# CSS #}
@ -25,7 +26,9 @@
<link rel="manifest" href="/assets/favicon/site.webmanifest"> <link rel="manifest" href="/assets/favicon/site.webmanifest">
{% endblock %} {% endblock %}
<title>{{ pageTitle }}</title> <title>
{% block pageTitle %}{{ title + " | " if title }}{{ sitemeta.siteName | safe }}{% endblock %}
</title>
</head> </head>
<body> <body>
{% block name %}{% include "global/hero.njk" %}{% endblock %} {% block name %}{% include "global/hero.njk" %}{% endblock %}