replacing any backslashes with forward slashes for edit file url(#116)

Seems to be a Windows related thing. `.File.Path` returns a path with backslashes this adds a replace to make those forward slashes. This appears to fix #115
soper-book
Thomas M Porter II 2019-12-17 15:24:15 -07:00 committed by Alex Shpak
parent e30504802e
commit f5a52e6ed1
1 changed files with 1 additions and 1 deletions

View File

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