Use macros
This commit is contained in:
parent
1ff244c6ca
commit
238b0e5aad
|
@ -1,13 +1,16 @@
|
|||
{% macro htmlTitle(site, page) -%}
|
||||
{% if page.title is defined and page.url != '//' %}
|
||||
{{ page.title }} |
|
||||
{% endif %}
|
||||
{{ site.title }} - {{ site.subtitle }}
|
||||
{%- endmacro %}
|
||||
|
||||
{% import _self as helpers %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js text-sm" lang="en-GB">
|
||||
<head>
|
||||
<title>
|
||||
{% if page.title is defined and page.url != '//' %}
|
||||
{{ page.title }} |
|
||||
{% endif %}
|
||||
{{ site.title }} - {{ site.subtitle }}
|
||||
</title>
|
||||
|
||||
<title>{{ helpers.htmlTitle(site, page) }}</title>
|
||||
{% include 'meta' %}
|
||||
|
||||
<link rel="stylesheet" href="/dist/css/app.css">
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
{% macro canonicalUrl(site, page) -%}
|
||||
{{ site.url }}
|
||||
{{- page.url != '//' ? page.url }}
|
||||
{%- endmacro %}
|
||||
|
||||
{% import _self as helpers %}
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="canonical" href="{{ site.url }}{{ page.url == '//' ? '' : page.url }}" />
|
||||
<link rel="canonical" href="{{ helpers.canonicalUrl(site, page) }}">
|
||||
|
||||
{% if page.meta.description %}
|
||||
<meta name="description" content="{{ page.meta.description|e('html') }}">
|
||||
|
|
Reference in a new issue