Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zzossig/hugo-theme-zdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/main/component/edit-this-page.html')
-rw-r--r--layouts/partials/main/component/edit-this-page.html13
1 files changed, 8 insertions, 5 deletions
diff --git a/layouts/partials/main/component/edit-this-page.html b/layouts/partials/main/component/edit-this-page.html
index edc27ab..03d3791 100644
--- a/layouts/partials/main/component/edit-this-page.html
+++ b/layouts/partials/main/component/edit-this-page.html
@@ -1,7 +1,10 @@
{{ if $.Param "enableEditBtn" }}
- <a href="{{ $.Param "editBaseURL" }}{{ strings.TrimSuffix "/" (.Permalink | relLangURL) }}.md" target="_blank" rel="noreferrer">
- <button class="editBtn" aria-label="Edit This Page Button">
- {{ i18n "edit-this-page" | default "EDIT THIS PAGE" }}
- </button>
- </a>
+ {{ $root := .}}
+ {{ with .FirstSection }}
+ <a href="{{ .Params.editBaseURL | default ($.Param "editBaseURL") }}{{ strings.TrimSuffix "/" ($root.Permalink | relLangURL) }}.md" target="_blank" rel="noreferrer">
+ <button class="editBtn" aria-label="Edit This Page Button">
+ {{ i18n "edit-this-page" | default "EDIT THIS PAGE" }}
+ </button>
+ </a>
+ {{ end }}
{{ end }} \ No newline at end of file