hugo-PaperMod/layouts/partials/edit_post.html
Aditya Telange 575cc0ca8c
Use site function instead of .Site or $.Site
- The site function provides global access to the same data as the .Site page method.
- Current context (`.`) is never considered.
2022-03-27 18:44:06 +05:30

9 lines
619 B
HTML

{{- if or .Params.editPost.URL site.Params.editPost.URL -}}
{{- $fileUrlPath := path.Join .File.Path }}
{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}}
<a href="{{ .Params.editPost.URL | default site.Params.editPost.URL }}{{ if .Params.editPost.appendFilePath | default ( site.Params.editPost.appendFilePath | default false ) }}/{{ $fileUrlPath }}{{ end }}" rel="noopener noreferrer" target="_blank">
{{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}}
</a>
{{- end }}