fix: "Edit Page" links for multilingual sites

Fix #1232
Fix https://github.com/sourcethemes/academic-www/issues/14
This commit is contained in:
George Cushen committed 2019-11-24 11:05:55 +00:00
1 parent 037d75f6da
commit 15e00e60de
1 file changed
+2 -1
+2 -1
View File
@@ -1,7 +1,8 @@
{{ if site.Params.edit_page }}{{/* Make `edit_page` optional in `params.toml` - prevent errors if it's removed. */}}
{{ if site.Params.edit_page.repo_url | and (index site.Params.edit_page.editable .Type) | and (ne .Params.editable false) | or .Params.editable }}
{{ $content_subfolder := cond site.IsMultiLingual (cond (ne .Site.LanguagePrefix "") (printf "%s/" .Site.LanguagePrefix) "") "" }}
<p class="edit-page">
<a href="{{site.Params.edit_page.repo_url}}/edit/{{site.Params.edit_page.repo_branch | default "master"}}/content/{{.File.Path}}">
<a href="{{site.Params.edit_page.repo_url}}/edit/{{site.Params.edit_page.repo_branch | default "master"}}/content/{{$content_subfolder}}{{.File.Path}}">
<i class="fas fa-pen pr-2"></i>{{ i18n "edit_page" | default "Edit this page" }}
</a>
</p>