Skip to content

Commit d049c59

Browse files
committed
fix and test gh pages
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent 1f3865f commit d049c59

File tree

2 files changed

+39
-64
lines changed

2 files changed

+39
-64
lines changed

.github/workflows/test-release-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2828
restore-keys: |
2929
${{ runner.os }}-maven-
30-
- name: Build Javadoc
31-
run: mise run javadoc
30+
- name: Build GitHub Pages
31+
run: mise run build-gh-pages
32+
env:
33+
BASE_URL: "/client_java/"
3234
- name: Build release version
3335
run: mise run build-release
3436
env:
Lines changed: 35 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,43 @@
11
{{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }}
22
{{- if eq .Kind "home" }}
3+
{{- $schema := dict "@context" "http://schema.org" "@type" "WebSite" "name" .Site.Title "url" .Site.BaseURL "inLanguage" .Lang }}
4+
{{- with partial "utils/description" . }}
5+
{{- $schema = merge $schema (dict "description" (. | plainify | htmlUnescape | chomp)) }}
6+
{{- end }}
7+
{{- with partial "utils/featured" . }}
8+
{{- $schema = merge $schema (dict "thumbnailUrl" .) }}
9+
{{- end }}
10+
{{- with .Site.Params.geekdocContentLicense }}
11+
{{- $schema = merge $schema (dict "license" .name) }}
12+
{{- end }}
313
<script type="application/ld+json">
4-
{
5-
"@context": "http://schema.org",
6-
"@type": "WebSite",
7-
"name": {{ .Site.Title }},
8-
"url": {{ .Site.BaseURL }},
9-
{{- with partial "utils/description" . }}
10-
"description": "{{ . | plainify | htmlUnescape | chomp }}",
11-
{{- end }}
12-
{{- with partial "utils/featured" . }}
13-
"thumbnailUrl": {{ . }},
14-
{{- end }}
15-
{{- with .Site.Params.geekdocContentLicense }}
16-
"license": "{{ .name }}",
17-
{{- end }}
18-
"inLanguage": {{ .Lang }}
19-
}
14+
{{- $schema | jsonify | safeJS }}
2015
</script>
2116
{{- else if $isPage }}
17+
{{- $title := partial "utils/title" . }}
18+
{{- $schema := dict "@context" "http://schema.org" "@type" "TechArticle" "articleSection" (.Section | humanize | title) "name" $title "url" .Permalink "headline" $title "wordCount" (string .WordCount) "inLanguage" .Lang "isFamilyFriendly" "true" "copyrightHolder" .Site.Title "copyrightYear" (.Date.Format "2006") "dateCreated" (.Date.Format "2006-01-02T15:04:05.00Z") "datePublished" (.PublishDate.Format "2006-01-02T15:04:05.00Z") "dateModified" (.Lastmod.Format "2006-01-02T15:04:05.00Z") }}
19+
{{- with .Params.lead }}
20+
{{- $schema = merge $schema (dict "alternativeHeadline" .) }}
21+
{{- end }}
22+
{{- with partial "utils/description" . }}
23+
{{- $schema = merge $schema (dict "description" (. | plainify | htmlUnescape | chomp)) }}
24+
{{- end }}
25+
{{- with partial "utils/featured" . }}
26+
{{- $schema = merge $schema (dict "thumbnailUrl" .) }}
27+
{{- end }}
28+
{{- with .Site.Params.geekdocContentLicense }}
29+
{{- $schema = merge $schema (dict "license" .name) }}
30+
{{- end }}
31+
{{- $mainEntity := dict "@type" "WebPage" "@id" .Permalink }}
32+
{{- $schema = merge $schema (dict "mainEntityOfPage" $mainEntity) }}
33+
{{- with $tags := .Params.tags }}
34+
{{- $schema = merge $schema (dict "keywords" $tags) }}
35+
{{- end }}
36+
{{- $logoUrl := default "brand.svg" .Site.Params.logo | absURL }}
37+
{{- $logo := dict "@type" "ImageObject" "url" $logoUrl "width" "32" "height" "32" }}
38+
{{- $publisher := dict "@type" "Organization" "name" .Site.Title "url" .Site.BaseURL "logo" $logo }}
39+
{{- $schema = merge $schema (dict "publisher" $publisher) }}
2240
<script type="application/ld+json">
23-
{
24-
"@context": "http://schema.org",
25-
"@type": "TechArticle",
26-
"articleSection": "{{ .Section | humanize | title }}",
27-
"name": {{ partial "utils/title" . }},
28-
"url" : {{ .Permalink }},
29-
"headline": {{ partial "utils/title" . }},
30-
{{- with .Params.lead }}
31-
"alternativeHeadline": {{ . }},
32-
{{- end }}
33-
{{- with partial "utils/description" . }}
34-
"description": "{{ . | plainify | htmlUnescape | chomp }}",
35-
{{- end }}
36-
{{- with partial "utils/featured" . }}
37-
"thumbnailUrl": {{ . }},
38-
{{- end }}
39-
"wordCount" : "{{ .WordCount }}",
40-
{{- with .Site.Params.geekdocContentLicense }}
41-
"license": "{{ .name }}",
42-
{{- end }}
43-
"inLanguage": {{ .Lang }},
44-
"isFamilyFriendly": "true",
45-
"mainEntityOfPage": {
46-
"@type": "WebPage",
47-
"@id": {{ .Permalink }}
48-
},
49-
{{- with $tags := .Params.tags }}
50-
"keywords" : [ {{ range $i, $tag := $tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}],
51-
{{- end }}
52-
"copyrightHolder" : "{{ .Site.Title }}",
53-
"copyrightYear" : "{{ .Date.Format "2006" }}",
54-
"dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
55-
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
56-
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
57-
"publisher":{
58-
"@type":"Organization",
59-
"name": {{ .Site.Title }},
60-
"url": {{ .Site.BaseURL }},
61-
"logo": {
62-
"@type": "ImageObject",
63-
"url": {{ (default "brand.svg" .Site.Params.logo) | absURL }},
64-
"width":"32",
65-
"height":"32"
66-
}
67-
}
68-
}
41+
{{- $schema | jsonify | safeJS }}
6942
</script>
7043
{{- end }}

0 commit comments

Comments
 (0)