From cd29262224a080a84f1d9563436ceaff665bae9a Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 6 Oct 2018 10:10:18 +0100 Subject: [PATCH] Use a macro for the canonical URL --- source/_layouts/base.html.twig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/_layouts/base.html.twig b/source/_layouts/base.html.twig index 8e227b0..46f5ece 100644 --- a/source/_layouts/base.html.twig +++ b/source/_layouts/base.html.twig @@ -1,3 +1,10 @@ +{% macro canonicalUrl(site, page) -%} + {{ site.url }} + {{- page.url != '//' ? page.url }} +{%- endmacro %} + +{% import _self as helpers %} + @@ -6,6 +13,7 @@ +