mirror of
https://github.com/imfing/hextra.git
synced 2025-05-12 19:36:25 -04:00
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:
parent
fbe1aac123
commit
cb274c8ac5
@ -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" . -}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user