Edit this page content dir lang independent (#202)

#200
This commit is contained in:
tyler71 2020-04-16 08:40:17 -07:00 committed by GitHub
parent 0f58a77354
commit b88d5f6b12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -73,8 +73,8 @@ enableGitInfo = true
# Enable "Edit this page" links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Path must point to 'content' directory of repo.
BookEditPath = 'edit/master/exampleSite/content'
# Edit path must point to root directory of repo.
BookEditPath = 'edit/master/exampleSite'
# Configure the date format used on the pages
# - In git information

View file

@ -69,8 +69,8 @@ params:
# Enable "Edit this page" links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Path must point to 'content' directory of repo.
BookEditPath: edit/master/exampleSite/content
# Edit path must point to root directory of repo.
BookEditPath: edit/master/exampleSite
# Configure the date format used on the pages
# - In git information

View file

@ -15,7 +15,7 @@
{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }}
<div>
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener">
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ .Site.Params.contentDir }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener">
<img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="Edit" />
<span>{{ i18n "Edit this page" }}</span>
</a>