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
This commit is contained in:
Thomas M Porter II 2019-12-17 15:24:15 -07:00 committed by Alex Shpak
parent e30504802e
commit f5a52e6ed1

View file

@ -17,7 +17,7 @@
{{ 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 }}/{{ .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" /> <img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="Edit" />
<span>{{ i18n "Edit this page" }}</span> <span>{{ i18n "Edit this page" }}</span>
</a> </a>