fix: correct bitbucket

Bitbucket (bitbucket.org) is different to BitbucketServer, so made sure to add the distinction. Also moved a declaration closer to where it's used.
This commit is contained in:
James Elliott 2022-01-20 11:43:20 +11:00
parent 1b6a1ca0cd
commit b063faaf37
No known key found for this signature in database
GPG Key ID: 0F1C4A096E857E49
2 changed files with 5 additions and 2 deletions

View File

@ -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>" 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 # Edit Page
# repoHost [Github | Gitea | GitLab | Bitbucket ] is used for building the edit link based on git hoster # repoHost [Github | Gitea | GitLab | Bitbucket | BitbucketServer ] is used for building the edit link based on git hoster
repoHost = "GitHub" repoHost = "GitHub"
#repoHost = "Gitea" #repoHost = "Gitea"
docsRepo = "https://github.com/h-enk/doks" docsRepo = "https://github.com/h-enk/doks"

View File

@ -1,5 +1,4 @@
{{ $parts := slice .Site.Params.docsRepo }} {{ $parts := slice .Site.Params.docsRepo }}
{{ $filePath := replace .File.Path "\\" "/" }}
{{ if (eq .Site.Params.repoHost "GitHub") }} {{ if (eq .Site.Params.repoHost "GitHub") }}
{{ $parts = $parts | append "blob" .Site.Params.docsRepoBranch }} {{ $parts = $parts | append "blob" .Site.Params.docsRepoBranch }}
@ -8,6 +7,8 @@
{{ else if (eq .Site.Params.repoHost "GitLab") }} {{ else if (eq .Site.Params.repoHost "GitLab") }}
{{ $parts = $parts | append "-/blob" .Site.Params.docsRepoBranch }} {{ $parts = $parts | append "-/blob" .Site.Params.docsRepoBranch }}
{{ else if (eq .Site.Params.repoHost "Bitbucket") }} {{ else if (eq .Site.Params.repoHost "Bitbucket") }}
{{ $parts = $parts | append "src" .Site.Params.docsRepoBranch }}
{{ else if (eq .Site.Params.repoHost "BitbucketServer") }}
{{ $parts = $parts | append "browse" .Site.Params.docsRepoBranch }} {{ $parts = $parts | append "browse" .Site.Params.docsRepoBranch }}
{{ end }} {{ end }}
@ -17,6 +18,8 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ $filePath := replace .File.Path "\\" "/" }}
{{ if .Site.Params.options.multilingualMode }} {{ if .Site.Params.options.multilingualMode }}
{{ $parts = $parts | append "content" .Lang $filePath }} {{ $parts = $parts | append "content" .Lang $filePath }}
{{ else }} {{ else }}