fix: Fixed edit page support for multilang books (#630)

This commit is contained in:
Rojax 2024-10-01 22:17:03 +02:00 committed by GitHub
parent 460d44479b
commit 8d56f3fe84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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>