feat: add canonical to head.html (#269)

By adding `canonical` parameter to the front matter and specifying the URL, the canonical URL is added. 
If no canonical URL is needed to be specified, the layout will use the current page address for canonical tag. 

Example: 

```
---
title: "Page Title"
description: "Page description"
canonical: "https://canonicalurl.com"
---
This commit is contained in:
mafendi 2024-02-02 00:52:41 +02:00 committed by GitHub
parent fbe1aac123
commit cb274c8ac5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,7 +16,12 @@
{{ end -}}
</title>
<meta name="description" content="{{ partial "utils/page-description.html" . }}" />
<link rel="canonical" href="{{ .Permalink }}">
{{ with .Params.canonical }}
<link rel="canonical" href="{{ . }}" itemprop="url" />
{{ else }}
<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
{{ end }}
{{ partial "opengraph.html" . }}
{{ template "_internal/schema.html" . -}}