mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
⚡ Perf: optimize path splicing (#139)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
{{- $gravatar := .Site.Params.gravatar -}}
|
||||
{{- with $gravatar -}}
|
||||
{{- $avatar = printf "https://%v/avatar/%v?s=240&d=%v"
|
||||
(.Host | default "www.gravatar.com")
|
||||
(path.Clean .Host | default "www.gravatar.com")
|
||||
(md5 $profile.gravatarEmail)
|
||||
(.Style | default "mp")
|
||||
-}}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
{{- with $params.edit -}}
|
||||
{{- if .Enable -}}
|
||||
<span>
|
||||
{{- $options := dict "Class" "link-to-edit" "Destination" (printf "%v/%v" .Url $.File.Path) "Title" (T "editThisPage") "Content" (T "editThisPage") "externalIcon" false -}}
|
||||
{{- $options := dict "Class" "link-to-edit" "Destination" (path.Join .Url $.File.Path) "Title" (T "editThisPage") "Content" (T "editThisPage") "externalIcon" false -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
{{- if (not $avatar | or $params.gravatarForce) | and $author.email -}}
|
||||
{{- $gravatar := .Site.Params.gravatar -}}
|
||||
{{- with $gravatar -}}
|
||||
{{- $avatar = printf "https://%v/avatar/%v?s=32&d=%v" (.Host | default "www.gravatar.com") (md5 $author.email) (.Style | default "") -}}
|
||||
{{- $avatar = printf "https://%v/avatar/%v?s=32&d=%v"
|
||||
(path.Clean .Host | default "www.gravatar.com")
|
||||
(md5 $author.email)
|
||||
(.Style | default "")
|
||||
-}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<span class="post-author">
|
||||
|
||||
Reference in New Issue
Block a user