mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-22 03:19:25 +00:00
fix: Fixed edit page support for multilang books (#630)
This commit is contained in:
parent
460d44479b
commit
8d56f3fe84
@ -13,7 +13,8 @@
|
|||||||
|
|
||||||
{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }}
|
{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }}
|
||||||
<div>
|
<div>
|
||||||
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ .Site.Params.contentDir | default "content" }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener">
|
{{- $bookFilePath := (strings.TrimPrefix hugo.WorkingDir .Page.File.Filename | path.Join) -}}
|
||||||
|
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}{{ ($bookFilePath) }}" target="_blank" rel="noopener">
|
||||||
<img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="" />
|
<img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="" />
|
||||||
<span>{{ i18n "Edit this page" }}</span>
|
<span>{{ i18n "Edit this page" }}</span>
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user