-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new 'GitForge' param for non GitHub repos #403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @MarionMoseby . Can you please acknowledge the comments?
layouts/_default/single.html
Outdated
@@ -71,7 +71,13 @@ <h1>{{ .Page.Title }}</h1> | |||
<!--- Improve this page button ---> | |||
{{ if site.Params.GitRepo }} | |||
<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/{{ site.Params.GitBranch }}/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be "{{ site.Params.GitRepo }}/-/edit/
instead of "{{ site.Params.GitRepo }}-/edit/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum I see, I believe the problem is my GitRepo param is styled as https://codeberg.org/FlyingFlamingo/pablomarcos.me/ instead of https://codeberg.org/FlyingFlamingo/pablomarcos.me, so the {{ site.Params.GitRepo }} makes the / redundant. I guess for backwards compatibility I should add this change, even though I dont know which is more common, to have the final / or not
layouts/_default/single.html
Outdated
{{ if ( eq site.Params.GitForge "gitlab" ) }} | ||
<a href="{{ site.Params.GitRepo }}-/edit/{{ site.Params.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/{{ site.Params.GitBranch }}/content/{{ .File.Path }}" title="{{ i18n "improve_this_page" }}" target="_blank" rel="noopener"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be {{ site.Params.GitRepo }}/_edit/{{ site.Params.GitBranch }}
instead of {{ site.Params.GitRepo }}_edit/{{ site.Params.GitBranch }}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here really
Also, do you see if there is a way of making main the default Gitbranch? So that it does not have to be specified for most projects |
Everything should be ready now :p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now. Thank you @MarionMoseby
Issue
I use a gitea repository; with the current setup, there is no way to use it with toha
Description
Makes the"Improve this page" button compatible with gitea and gitlab repos, while keeping backwards compatibility, I also tried to establish "main" as the default branch by doing:
`
{{ if site.Params.GitBranch }}
{{ $GitBranch = site.Params.GitBranch }}
{{ else }}
{{ $GitBranch = main }}
{{ end }}
`
But I couldnt get it to work