File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change
1
+ {{- $b := .badge -}}
2
+ {{- $contentId := .curriculaId -}}
3
+ {{- $orgId := .orgId | default "" -}}
4
+
5
+ {{- $svg := cond (partial "is-url.html" $b.svg) $b.svg (partial "banner-url.html" (dict "uuid" $orgId "banner" $b.svg )) -}}
6
+ {{- $png := cond (partial "is-url.html" $b.png) $b.png (partial "banner-url.html" (dict "uuid" $orgId "banner" $b.svg )) -}}
7
+
8
+ {{- $badge := "nil" -}}
9
+
10
+ {{- if $b }}
11
+ {{- $badge = dict
12
+ "title" $b.title
13
+ "description" $b.description
14
+ "label" $contentId
15
+ "svg" $svg
16
+ "png" $png
17
+ -}}
18
+ {{- end -}}
19
+
20
+
21
+ {{- return $badge -}}
Original file line number Diff line number Diff line change
1
+ {{- $s := . -}}
2
+ {{- $isUrl := or (strings.HasPrefix $s "http://") (strings.HasPrefix $s "https://") -}}
3
+ {{- return $isUrl -}}
Original file line number Diff line number Diff line change 23
23
"title": {{ .Title | jsonify }},
24
24
"description": {{ .Description | jsonify }},
25
25
"banner": {{ $banner_url | jsonify }},
26
- "badge": {{ . Params.badge | jsonify }},
26
+ "badge": {{ partial "badge.html" (dict "badge" . Params.badge "curriculaId" $id "orgId" $uuid ) | jsonify }},
27
27
"certificate": {{ .Params.certificate | jsonify }},
28
28
"permalink": {{ .Permalink | jsonify }},
29
29
"categories": {{ .Params.Categories | jsonify }},
You can’t perform that action at this time.
0 commit comments