fix canonical meta header

pull/3/head
Septs 2022-12-05 11:00:14 +08:00
parent 678c7c235c
commit 3285b75866
No known key found for this signature in database
GPG Key ID: 65144037AFA516E1
1 changed files with 4 additions and 1 deletions

View File

@ -13,10 +13,13 @@
{{- with .Description | default (cond .IsPage .Summary .Site.Params.description) }}
<meta name="description" content="{{ . }}">
{{- end }}
{{- range $index, $page := .AllTranslations }}
{{- if eq $index 0 }}
<link rel="canonical" href="{{ .Permalink }}">
{{- range .Translations }}
{{- else }}
<link rel="alternate" href="{{ .Permalink }}" hreflang="{{ .Language }}">
{{- end }}
{{- end }}
{{- range .AlternativeOutputFormats }}
<link rel="{{ .Rel }}" href="{{ .Permalink }}" type="{{ .MediaType.Type }}">
{{- end }}