aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2023-05-05 01:40:11 +0300
committerValentin Popov <valentin@popov.link>2023-05-05 01:40:11 +0300
commit62c64165ce59138972161a41bf2ec6fea00d474f (patch)
tree96f567aac05d5c64e6c151c62806b66148e0b814
parentd642309d6429abaea1ff86ae31a85d8caf1c4c21 (diff)
downloadpopov.link-62c64165ce59138972161a41bf2ec6fea00d474f.tar.xz
popov.link-62c64165ce59138972161a41bf2ec6fea00d474f.zip
feat(1): Added canonical URLs
Signed-off-by: Valentin Popov <valentin@popov.link>
-rw-r--r--templates/base.html3
-rw-r--r--templates/includes/canonical.html2
2 files changed, 5 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html
index a3ad884..43437c8 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -18,6 +18,9 @@
<!-- Title -->
{% include 'includes/title.html' %}
+
+ <!-- Canonical URL -->
+ {% include 'includes/canonical.html' %}
</head>
<body>
diff --git a/templates/includes/canonical.html b/templates/includes/canonical.html
new file mode 100644
index 0000000..8c7e29f
--- /dev/null
+++ b/templates/includes/canonical.html
@@ -0,0 +1,2 @@
+{% set url = current_url | default(value='/') %}
+<link href="{{ url | trim | safe }}" rel="canonical" /> \ No newline at end of file