{{ if and .Params.canonicalURL (or .Params.ShowCanonicalLink site.Params.ShowCanonicalLinks) -}} {{ $url := urls.Parse .Params.canonicalURL }} {{ $urlWithoutScheme := replaceRE "^https?://" "" $url.String }} {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL site.Params.editPost.URL) }} | {{- end -}} {{- (site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}}  {{ $urlWithoutScheme}} {{- end }}