improve condition to an if inline

This commit is contained in:
douglastofoli 2023-01-23 23:53:08 -03:00
parent 87ee72b87d
commit d88b401b39
No known key found for this signature in database
GPG Key ID: FB53E61DAF3115F8

View File

@ -1,10 +1,8 @@
{{- if not (or .Params.editPost.disable site.Params.editPost.disable) -}}
{{- if or .Params.editPost.URL site.Params.editPost.URL -}}
{{- if (and (or (.Params.editPost.URL) (site.Params.editPost.URL)) (and (not .Params.editPost.disable) (not site.Params.editPost.disable))) -}}
{{- $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 }}
{{- end }}
{{- end }}