Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/calintat/minimal.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcalintat <calintat@gmail.com>2017-08-31 14:06:03 +0300
committercalintat <calintat@gmail.com>2017-08-31 14:06:03 +0300
commit230ecdc0d4009099cd4d499e027a1a5d6d113ca0 (patch)
tree9c3cca01b94a4d1bf8d86683a49d3bd668b32d71
parenta1ef089cd5c44bd9280424b7a72934df17add222 (diff)
Support for gitlab and bitbucket repos
-rw-r--r--layouts/partials/list-item.html11
1 files changed, 10 insertions, 1 deletions
diff --git a/layouts/partials/list-item.html b/layouts/partials/list-item.html
index 445eded..93a993b 100644
--- a/layouts/partials/list-item.html
+++ b/layouts/partials/list-item.html
@@ -1,7 +1,16 @@
<div class="item">
{{ $.Scratch.Set "link" .RelPermalink }}
- {{ with .Params.repo }} {{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }} {{ end }}
+ {{ with .Params.repo }}
+ {{ $repoHost := default "github" $.Params.repoHost }}
+ {{ if eq "github" $repoHost }}
+ {{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }}
+ {{ else if eq "gitlab" $repoHost }}
+ {{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }}
+ {{ else if eq "bitbucket" $repoHost }}
+ {{ printf "https://bitbucket.org/%s/%s/" $.Site.Params.bitbucketUsername . | $.Scratch.Set "link" }}
+ {{ end }}
+ {{ end }}
{{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }}
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "subtitle" }}