Added new 'GitForge' param for non GitHub repos (#403)
* Added new 'GitForge' param for non-git repos * Solved comments Co-authored-by: Pablo Marcos <codebergflamingo@staplehorse.anonaddy.com> Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
This commit is contained in:
parent
d155f2063b
commit
e8e23ed9a3
1 changed files with 12 additions and 1 deletions
|
@ -70,8 +70,19 @@
|
|||
|
||||
<!--- Improve this page button --->
|
||||
{{ if site.Params.GitRepo }}
|
||||
{{ if site.Params.GitBranch }}
|
||||
{{ .Scratch.Set "GitBranch" site.Params.GitBranch }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "GitBranch" "main" }}
|
||||
{{ end }}
|
||||
<div class="btn-improve-page">
|
||||
<a href="{{ site.Params.GitRepo }}/edit/{{ site.Params.GitBranch }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
|
||||
{{ if ( eq site.Params.GitForge "gitlab" ) }}
|
||||
<a href="{{ site.Params.GitRepo }}/-/edit/{{ .Scratch.Get "GitBranch" }}/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
|
||||
{{ else if ( eq site.Params.GitForge "gitea" ) }}
|
||||
<a href="{{ site.Params.GitRepo }}/_edit/{{ .Scratch.Get "GitBranch" }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
|
||||
{{ else }} <!--- Make Github-style the default -->
|
||||
<a href="{{ site.Params.GitRepo }}/edit/{{ .Scratch.Get "GitBranch" }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener">
|
||||
{{ end }}
|
||||
<i class="fas fa-code-branch"></i>
|
||||
{{ i18n "improve_this_page" }}
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue