diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2022-03-27 18:44:06 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2022-03-27 18:44:06 +0530 |
| commit | 575cc0ca8c4e5904c7ae77e76db812c52e5f8ed1 (patch) | |
| tree | 29b83f765f6ccae88651886167681b4afdb71069 /layouts/partials/edit_post.html | |
| parent | 975972e04181007c61302054d18735dc440a0586 (diff) | |
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.
Diffstat (limited to 'layouts/partials/edit_post.html')
| -rw-r--r-- | layouts/partials/edit_post.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/layouts/partials/edit_post.html b/layouts/partials/edit_post.html index 1d90ebd..efa4c70 100644 --- a/layouts/partials/edit_post.html +++ b/layouts/partials/edit_post.html @@ -1,8 +1,8 @@ -{{- if or .Params.editPost.URL .Site.Params.editPost.URL -}} +{{- 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")) -}} +{{- 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 }} |
