1
1
{{ $page_context := . }}
2
2
{{ $softwareLD := dict
3
- "@context" "https://schema.org"
4
- "@type" "SoftwareApplication"
5
- "name" $page_context.Title
6
- "description" $page_context.Description
7
- "applicationCategory" (slice "DeveloperApplication" "ScienceApplication")
8
- "operatingSystem" "Linux, macOS, Windows"
3
+ "@context" "https://schema.org"
4
+ "@type" "SoftwareApplication"
5
+ "name" $page_context.Title
6
+ "description" $page_context.Description
7
+ "applicationCategory" (slice "DeveloperApplication" "ScienceApplication")
8
+ "operatingSystem" "Linux, macOS, Windows"
9
+ "offers" (dict
10
+ "@type" "Offer"
11
+ "price" "0"
12
+ "priceCurrency" "USD"
13
+ )
14
+ "aggregateRating" (dict
15
+ "@type" "AggregateRating"
16
+ "ratingValue" "5"
17
+ "ratingCount" "1"
18
+ )
9
19
}}
10
20
11
21
{{ with $page_context.Params.license }}
12
- {{ $softwareLD = merge $softwareLD (dict "license" (printf "https://spdx.org/licenses/%s.html" .)) }}
22
+ {{ $softwareLD = merge $softwareLD (dict "license" (printf "https://spdx.org/licenses/%s.html" .)) }}
13
23
{{ end }}
14
24
{{ with $page_context.Params.source_code }}
15
- {{ $softwareLD = merge $softwareLD (dict "codeRepository" .) }}
25
+ {{ $softwareLD = merge $softwareLD (dict "codeRepository" .) }}
16
26
{{ end }}
17
27
{{ with $page_context.Params.website }}
18
- {{ $softwareLD = merge $softwareLD (dict "softwareHelp" .) }}
28
+ {{ $softwareLD = merge $softwareLD (dict "softwareHelp" .) }}
19
29
{{ end }}
20
30
{{ with $page_context.Params.language }}
21
- {{ $softwareLD = merge $softwareLD (dict "programmingLanguage" .) }}
31
+ {{ $softwareLD = merge $softwareLD (dict "programmingLanguage" .) }}
22
32
{{ end }}
23
33
24
34
{{ with $page_context.Params.logo }}
25
- {{ with $page_context.Resources.GetMatch . }}
26
- {{ $softwareLD = merge $softwareLD (dict "@type" "ImageObject" "url" .Permalink) }}
27
- {{ end }}
35
+ {{ with $page_context.Resources.GetMatch . }}
36
+ {{ $softwareLD = merge $softwareLD (dict "logo" (dict " @type" "ImageObject" "url" .Permalink) ) }}
37
+ {{ end }}
28
38
{{ end }}
29
39
30
40
{{ with $page_context.Params.maintainer }}
31
- {{ $maintainerList := . }}
32
- {{ if not (reflect.IsSlice .) }}{{ $maintainerList = slice . }}{{ end }}
33
-
34
- {{ $authorsLD := slice }}
35
- {{ range $maintainerList }}
36
- {{ $authorName := . }}
37
- {{ $nameForProcessing := $authorName | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }}
38
- {{ $contributorSlug := $nameForProcessing | anchorize }}
39
- {{ $contributorPage := site.GetPage (printf "contributors/%s" $contributorSlug) }}
41
+ {{ $maintainerList := . }}
42
+ {{ if not (reflect.IsSlice .) }}{{ $maintainerList = slice . }}{{ end }}
43
+
44
+ {{ $authorsLD := slice }}
45
+ {{ range $maintainerList }}
46
+ {{ $authorName := . }}
47
+ {{ $nameForProcessing := $authorName | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }}
48
+ {{ $contributorSlug := $nameForProcessing | anchorize }}
49
+ {{ $contributorPage := site.GetPage (printf "contributors/%s" $contributorSlug) }}
50
+
51
+ {{ $personDict := dict "@type" "Person" "name" $authorName }}
52
+ {{ if $contributorPage }}
53
+ {{ $personDict = merge $personDict (dict "url" ($contributorPage.Permalink | absLangURL)) }}
54
+ {{ end }}
55
+ {{ $authorsLD = $authorsLD | append $personDict }}
56
+ {{ end }}
40
57
41
- {{ $personDict := dict "@type" "Person" "name" $authorName }}
42
- {{ if $contributorPage }}
43
- {{ $personDict = merge $personDict (dict "url" ($contributorPage.Permalink | absLangURL)) }}
44
- {{ end }}
45
- {{ $authorsLD = $authorsLD | append $personDict }}
46
- {{ end }}
47
-
48
- {{ $authorKey := cond (eq (len $authorsLD) 1) "author" "author" }}
49
- {{ $authorValue := cond (eq (len $authorsLD) 1) (index $authorsLD 0) $authorsLD }}
50
- {{ $softwareLD = merge $softwareLD (dict $authorKey $authorValue) }}
58
+ {{ $authorKey := cond (eq (len $authorsLD) 1) "author" "author" }}
59
+ {{ $authorValue := cond (eq (len $authorsLD) 1) (index $authorsLD 0) $authorsLD }}
60
+ {{ $softwareLD = merge $softwareLD (dict $authorKey $authorValue) }}
51
61
{{ end }}
52
62
53
- {{ return $softwareLD }}
63
+ {{ return $softwareLD }}
0 commit comments