From 42f4028f2d37b9d1db1e3c7704acd2670ec3e546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Thu, 16 Jun 2022 19:57:49 +0800 Subject: [PATCH] :bug: Fixed the post creative commons link & post end style only work in page section. --- exampleSite/config.yaml | 1 + layouts/partials/head/style.html | 5 ++++- layouts/partials/post/footer_meta/copyright.html | 7 +++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 63dae73..8e8ed5a 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -7,6 +7,7 @@ baseURL: / theme: hugo-theme-next +canonifyURLs: true paginate: 8 diff --git a/layouts/partials/head/style.html b/layouts/partials/head/style.html index c74a448..7b54c39 100644 --- a/layouts/partials/head/style.html +++ b/layouts/partials/head/style.html @@ -23,8 +23,11 @@ {{- $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }} +{{- if .IsPage }} \ No newline at end of file + +{{- end }} + \ No newline at end of file diff --git a/layouts/partials/post/footer_meta/copyright.html b/layouts/partials/post/footer_meta/copyright.html index d048896..403975d 100644 --- a/layouts/partials/post/footer_meta/copyright.html +++ b/layouts/partials/post/footer_meta/copyright.html @@ -19,16 +19,15 @@ {{- if isset .Params "link" }} {{ print (T "PostCROriginLink") (T "SymbolColon") }} {{ .Params.Link }} - {{- else }} + {{- else }} {{ print (T "PostCRLink") (T "SymbolColon") }} - {{ .Permalink }} + {{ .RelPermalink | absLangURL }} {{- end }}
  • {{ print (T "PostCRLicenseTitle") (T "SymbolColon") }} {{- $ccText := .Site.Params.creativeCommons.license | upper }} - {{- $lang := .Scratch.Get "lang" }} - {{- $ccLink := printf "%s" (substr $lang 0 2) $ccText }} + {{- $ccLink := printf "%s" (substr .Site.LanguageCode 0 2) $ccText }} {{ printf (T "PostCRLicenseContent") $ccLink | safeHTML }}