Commit 783a1ab9 authored by OCram85's avatar OCram85
Browse files

add GitLab to path builder

parent e4514efc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ alertDismissable = true
alertText = "Introducing the Doks child theme, several DX + UX updates, and more! <a class=\"alert-link stretched-link\" href=\"https://getdoks.org/blog/doks-v0.2/\">Check out Doks v0.2</a>"

# Edit Page
# repoHost [Github | Gitea ] is used for building the edit link based on git hoster
# repoHost [Github | Gitea | GitLab] is used for building the edit link based on git hoster
repoHost = "GitHub"
#repoHost = "Gitea"
docsRepo = "https://github.com/h-enk/doks"
+8 −7
Original line number Diff line number Diff line
{{ $filePath := replace .File.Path "\\" "/" }}

{{ $contentPath := "null"}}
{{ $editPath := "null" }}

{{ if (eq .Site.Params.repoHost "GitHub") }}
  {{ $contentPath = print .Site.Params.docsRepo "/blob/" .Site.Params.docsRepoBranch "/content/" }}
  {{ $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 }}