diff --git a/layouts/shortcodes/github.html b/layouts/shortcodes/github.html index efb46de3..393586ee 100644 --- a/layouts/shortcodes/github.html +++ b/layouts/shortcodes/github.html @@ -1,26 +1,32 @@ -{{- $githubData := getJSON (print "https://api.github.com/repos/" (.Get "repo")) -}} +{{ $id := delimit (slice "github" .Ordinal now.UnixNano) "-" }} +{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}} +{{- $githubData := getJSON ($githubURL) -}} {{- $githubColors := .Site.Data.githubColors -}} {{- with $githubData -}} - - + + {{ partial "icon.html" "github" }} - + {{ .full_name | markdownify | emojify }} - + {{ .description | markdownify | emojify }} - - + + {{ if .language }} {{ .language }} {{ else }} null {{ end }} @@ -28,19 +34,34 @@ {{ partial "icon.html" "star" }} - + {{ .stargazers_count }} {{ partial "icon.html" "fork" }} - + {{ .forks }} + {{- end -}} \ No newline at end of file diff --git a/layouts/shortcodes/gitlab.html b/layouts/shortcodes/gitlab.html index bf56536c..1f2a8fa9 100644 --- a/layouts/shortcodes/gitlab.html +++ b/layouts/shortcodes/gitlab.html @@ -1,4 +1,7 @@ -{{- $gitLabData := getJSON (print (default "https://gitlab.com/" (.Get "baseURL")) "api/v4/projects/" (.Get "projectID")) -}} +{{ $id := delimit (slice "gitlab" .Ordinal now.UnixNano) "-" }} +{{- $gitlabURL := print (default "https://gitlab.com/" (.Get "baseURL")) "api/v4/projects/" (.Get "projectID") -}} + +{{- $gitLabData := getJSON ($gitlabURL) -}} {{- with $gitLabData -}} @@ -8,12 +11,12 @@ {{ partial "icon.html" "gitlab" }} - + {{ .name_with_namespace | markdownify | emojify }} - + {{ .description | markdownify | emojify }} @@ -21,19 +24,36 @@ {{ partial "icon.html" "star" }} - + {{ .star_count }} {{ partial "icon.html" "fork" }} - + {{ .forks_count }} + {{- end -}}
+
{{ .description | markdownify | emojify }}