Allow to specify branch of git repository

This commit is contained in:
Thom Wiggers committed 2019-07-23 09:38:51 +02:00
1 parent 57ae6c297e
commit ee6cef97ca
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ privacy_pack = false
# Enable visitors to edit pages?
# `repo` defines the repository URL. `editable` defines which page types can be edited.
edit_page = {repo_url = "https://github.com/gcushen/hugo-academic", editable = {docs = true, page = false, post = false}}
edit_page = {repo_url = "https://github.com/gcushen/hugo-academic", repo_branch = "master", editable = {docs = true, page = false, post = false}}
# Date and time format (refer to https://sourcethemes.com/academic/docs/customization/#date-format )
# Examples: "Mon, Jan 2, 2006" or "2006-01-02"
+1 -1
View File
@@ -1,6 +1,6 @@
{{ if site.Params.edit_page.repo_url | and (index site.Params.edit_page.editable .Type) | and (ne .Params.editable false) | or .Params.editable }}
<p class="edit-page">
<a href="{{site.Params.edit_page.repo_url}}/blob/master/content/{{.File.Path}}">
<a href="{{site.Params.edit_page.repo_url}}/blob/{{site.Params.edit_page.repo_branch | default "master" }}/content/{{.File.Path}}">
<i class="fas fa-pen pr-2"></i>{{ i18n "edit_page" | default "Edit this page" }}
</a>
</p>