feat: rel canonical link using absolute url

This commit is contained in:
Colin
2022-05-07 15:16:40 +08:00
parent 0bc1036aca
commit cbea3b6a9a
2 changed files with 5 additions and 2 deletions

View File

@@ -21,6 +21,9 @@ showReadingTime = false
# leave empty to disable, enter display text to enable
lastModDisplay = "最后修改"
rssFullText = true
# custom params
# The values nested under params: will populate the .Site.Params variable for use in templates
canonicalRelLinkBase = 'https://blog.colinx.one/'
[languages]
[languages.en]
@@ -67,7 +70,7 @@ rssFullText = true
[languages.zh-cn]
title = "Colinx Blog"
subtitle = "Colin的个人博客"
keywords = "Colin,个人博客"
keywords = "Colin,个人博客,技术,后端,Linux,前端"
copyright = ""
menuMore = "显示更多"
writtenBy = "作者"

View File

@@ -12,7 +12,7 @@
content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}"
/>
<meta name="robots" content="noodp" />
<link rel="canonical" href="{{ .Permalink }}" />
<link rel="canonical" href="{{ path.Join $.Site.Params.canonicalRelLinkBase .Permalink }}" />
<!-- head custom -->
{{- partial "prepended_head.html" . }}