| 1 | {{- if and (.Param "editPost.URL") (not (.Param "editPost.disabled")) -}} |
| 2 | {{- if or (.Param "author") (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} |
| 3 | {{- printf " | " | safeHTML -}} |
| 4 | {{- end -}} |
| 5 | |
| 6 | {{- $editURL := .Param "editPost.URL" }} |
| 7 | {{- $appendFilePath := .Param "editPost.appendFilePath" | default false }} |
| 8 | {{- $editText := .Param "editPost.Text" | default (i18n "edit_post" ) -}} |
| 9 | |
| 10 | {{- if $appendFilePath -}} |
| 11 | {{- $fileUrlPath := path.Join .File.Path }} |
| 12 | {{- $editURL = printf "%s/%s" $editURL $fileUrlPath -}} |
| 13 | {{- end -}} |
| 14 | |
| 15 | <span> |
| 16 | <a href="{{ $editURL }}" rel="noopener noreferrer edit" target="_blank"> |
| 17 | {{- $editText -}} |
| 18 | </a> |
| 19 | </span> |
| 20 | {{- end }} |