add GitLab to path builder

This commit is contained in:
OCram85
2021-10-08 11:10:59 +02:00
parent e4514efcdb
commit 783a1ab978
2 changed files with 9 additions and 8 deletions

View File

@ -1,14 +1,15 @@
{{ $filePath := replace .File.Path "\\" "/" }}
{{ $editPath := "null" }}
{{ $contentPath := "null"}}
{{ if (eq .Site.Params.repoHost "GitHub")}}
{{ $contentPath = print .Site.Params.docsRepo "/blob/" .Site.Params.docsRepoBranch "/content/" }}
{{ if (eq .Site.Params.repoHost "GitHub") }}
{{ $editPath = "/blob/" }}
{{ else if (eq .Site.Params.repoHost "Gitea") }}
{{ $editPath = "/_edit/"}}
{{ else if (eq .Site.Params.repoHost "GitLab") }}
{{ $editPath = "/-/blob/" }}
{{ end }}
{{ if (eq .Site.Params.repoHost "Gitea")}}
{{ $contentPath = print .Site.Params.docsRepo "/_edit/" .Site.Params.docsRepoBranch "/content/" }}
{{ end }}
{{ $contentPath := print .Site.Params.docsRepo $editPath .Site.Params.docsRepoBranch "/content/" }}
{{ $url := print $contentPath $filePath }}