2022-01-20 01:36:43 +01:00
|
|
|
{{ $parts := slice .Site.Params.docsRepo }}
|
2021-09-18 08:15:41 +02:00
|
|
|
{{ $filePath := replace .File.Path "\\" "/" }}
|
2021-10-08 07:44:49 +02:00
|
|
|
|
2021-10-08 11:10:59 +02:00
|
|
|
{{ if (eq .Site.Params.repoHost "GitHub") }}
|
2022-01-20 01:36:43 +01:00
|
|
|
{{ $parts = $parts | append "blob" .Site.Params.docsRepoBranch }}
|
2021-10-08 11:10:59 +02:00
|
|
|
{{ else if (eq .Site.Params.repoHost "Gitea") }}
|
2022-01-20 01:36:43 +01:00
|
|
|
{{ $parts = $parts | append "_edit" .Site.Params.docsRepoBranch }}
|
2021-10-08 11:10:59 +02:00
|
|
|
{{ else if (eq .Site.Params.repoHost "GitLab") }}
|
2022-01-20 01:36:43 +01:00
|
|
|
{{ $parts = $parts | append "-/blob" .Site.Params.docsRepoBranch }}
|
|
|
|
{{ else if (eq .Site.Params.repoHost "Bitbucket") }}
|
|
|
|
{{ $parts = $parts | append "browse" .Site.Params.docsRepoBranch }}
|
2021-10-08 07:44:49 +02:00
|
|
|
{{ end }}
|
|
|
|
|
2022-01-20 01:36:43 +01:00
|
|
|
{{ if isset .Site.Params "docsreposubpath" }}
|
|
|
|
{{ if not (eq .Site.Params.docsRepoSubPath "") }}
|
|
|
|
{{ $parts = $parts | append .Site.Params.docsRepoSubPath }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if .Site.Params.options.multilingualMode }}
|
|
|
|
{{ $parts = $parts | append "content" .Lang $filePath }}
|
|
|
|
{{ else }}
|
|
|
|
{{ $parts = $parts | append "content" $filePath }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $url := delimit $parts "/" }}
|
2021-10-08 07:44:49 +02:00
|
|
|
|
2022-01-17 19:50:23 +01:00
|
|
|
<div class="edit-page">
|
2021-09-18 08:15:41 +02:00
|
|
|
<a href="{{ $url }}">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2">
|
|
|
|
<path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path>
|
|
|
|
</svg>
|
2021-10-08 07:44:49 +02:00
|
|
|
Edit this page on {{ .Site.Params.repoHost }}
|
2021-09-18 08:15:41 +02:00
|
|
|
</a>
|
2022-01-17 19:50:23 +01:00
|
|
|
</div>
|