Skip to content

Commit d0d3d58

Browse files
docs: add structured data support for documentation pages
risk: low JIRA: DP-3290
1 parent 1ee2b68 commit d0d3d58

File tree

7 files changed

+239
-0
lines changed

7 files changed

+239
-0
lines changed

docs/layouts/docs/baseof.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
{{ if .Params.externalLink }}
88
<meta http-equiv="refresh" content="0;url={{ .Params.externalLink }}" />
99
{{ end }}
10+
<script type="application/ld+json">
11+
{{ partial "structureddata/structureddata.looker.html" (dict "Page" . "Site" .Site) | safeJS }}
12+
</script>
13+
<script>
14+
console.log("{{ .Page.RelPermalink }}");
15+
</script>
1016
</head>
1117
<body class="td-{{ .Kind }}">
1218
{{ partial "gtm-body.html" }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- $url := . -}}
2+
{{- $urlObj := urls.Parse $url -}}
3+
{{- $host := printf "%s://%s" $urlObj.Scheme $urlObj.Host -}}
4+
{{- $pathname := $urlObj.Path -}}
5+
6+
{{- /* Split pathname and build breadcrumbs */ -}}
7+
{{- $breadcrumbs := slice -}}
8+
9+
{{- /* Split path by "/" and filter out empty strings */ -}}
10+
{{- $segments := split $pathname "/" -}}
11+
{{- $currentPath := "" -}}
12+
13+
{{- range $segments -}}
14+
{{- if ne . "" -}}
15+
{{- $currentPath = printf "%s%s/" $currentPath . -}}
16+
{{- $fullUrl := printf "%s/%s" $host $currentPath -}}
17+
{{- $breadcrumbs = $breadcrumbs | append $fullUrl -}}
18+
{{- end -}}
19+
{{- end -}}
20+
21+
{{- return $breadcrumbs -}}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
]
2+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"@context": "https://schema.org",
3+
"@graph": [
4+
{
5+
"@type": "Organization",
6+
"@id": "https://www.gooddata.com#organization",
7+
"url": "https://www.gooddata.com",
8+
"name": "GoodData",
9+
"logo": {
10+
"@type": "ImageObject",
11+
"@id": "https://www.gooddata.com#logo",
12+
"url": "https://www.gooddata.com/img/generic/logo-gd-b.svg"
13+
},
14+
"image": {
15+
"@id": "https://www.gooddata.com#logo"
16+
}
17+
},
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{{- $pageData := .Page -}}
2+
{{- $siteData := .Site -}}
3+
4+
{
5+
"@context": "https://schema.org",
6+
"@graph": [
7+
{
8+
"@type": "WebSite",
9+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#website",
10+
"url": "https://www.gooddata.com{{ $pageData.RelPermalink }}",
11+
"name": "GoodData Python SDK Documentation",
12+
"description": "Official documentation for GoodData Python SDK - Python interface for GoodData Agentic data intelligence platform",
13+
"inLanguage": "en",
14+
"publisher": {
15+
"@id": "https://www.gooddata.com/#organization"
16+
},
17+
"potentialAction": {
18+
"@type": "SearchAction",
19+
"target": {
20+
"@type": "EntryPoint",
21+
"urlTemplate": "https://www.gooddata.com{{ $pageData.RelPermalink }}?q={search_term_string}"
22+
},
23+
"query-input": "required name=search_term_string"
24+
}
25+
},
26+
{
27+
"@type": "Organization",
28+
"@id": "https://www.gooddata.com/#organization",
29+
"name": "GoodData",
30+
"url": "https://www.gooddata.com",
31+
"logo": {
32+
"@type": "ImageObject",
33+
"@id": "https://www.gooddata.com#logo",
34+
"url": "https://www.gooddata.com/img/generic/logo-gd-b.svg"
35+
},
36+
"image": {
37+
"@id": "https://www.gooddata.com#logo"
38+
},
39+
"sameAs": [
40+
"https://www.facebook.com/gooddata/",
41+
"https://www.linkedin.com/company/gooddata",
42+
"https://www.youtube.com/gooddata",
43+
"https://en.wikipedia.org/wiki/GoodData",
44+
"https://twitter.com/gooddata"
45+
]
46+
},
47+
{
48+
"@type": "SoftwareSourceCode",
49+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#software",
50+
"name": "GoodData Python SDK",
51+
"description": "Python SDK for programmatic access to GoodData Agentic data intelligence platform",
52+
"programmingLanguage": {
53+
"@type": "ComputerLanguage",
54+
"name": "Python",
55+
"url": "https://www.python.org"
56+
},
57+
"codeRepository": "https://github.com/gooddata/gooddata-python-sdk",
58+
"license": "https://github.com/gooddata/gooddata-python-sdk/blob/master/LICENSE.txt",
59+
"runtimePlatform": "Python 3.13 or higher",
60+
"author": {
61+
"@id": "https://www.gooddata.com/#organization"
62+
}
63+
},
64+
{
65+
"@type": "TechArticle",
66+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#article",
67+
"headline": "{{ $pageData.Params.title }} | GoodData Python SDK",
68+
"description": "Introduction to GoodData Python SDK - overview, key concepts, and getting started guide",
69+
"url": "https://www.gooddata.com{{ $pageData.RelPermalink }}",
70+
"dateModified": {{ $pageData.Params.lastmod | jsonify }},
71+
"author": {
72+
"@id": "https://www.gooddata.com/#organization"
73+
},
74+
"publisher": {
75+
"@id": "https://www.gooddata.com/#organization"
76+
},
77+
"isPartOf": {
78+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#website"
79+
},
80+
"about": {
81+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#software"
82+
},
83+
"articleSection": {{ $pageData.Parent.Title | jsonify }},
84+
"inLanguage": "en"
85+
},
86+
{
87+
"@type": "WebPage",
88+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#webpage",
89+
"url": "https://www.gooddata.com{{ $pageData.RelPermalink }}",
90+
"name": "Python SDK - GoodData Documentation",
91+
"description": "Complete documentation for GoodData Python SDK including installation, getting started, API reference, and examples",
92+
"isPartOf": {
93+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#website"
94+
},
95+
"about": {
96+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#software"
97+
},
98+
"breadcrumb": {
99+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#breadcrumb"
100+
}
101+
},
102+
{
103+
"@type": "BreadcrumbList",
104+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#breadcrumb",
105+
"itemListElement": [
106+
{
107+
"@type": "ListItem",
108+
"position": 1,
109+
"name": "Home",
110+
"item": "https://www.gooddata.com"
111+
},
112+
{
113+
"@type": "ListItem",
114+
"position": 2,
115+
"name": "Documentation",
116+
"item": "https://www.gooddata.com/docs/"
117+
},
118+
{
119+
"@type": "ListItem",
120+
"position": 3,
121+
"name": "Python SDK"
122+
}
123+
]
124+
}
125+
]
126+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{- $pageData := .Page -}}
2+
{{- $siteData := .Site -}}
3+
4+
{{ if eq $pageData.Params.title "Introduction" }}
5+
{{ partial "structureddata/structureddata.introduction.html" (dict "Page" $pageData "Site" $siteData) }}
6+
{{ end }}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{{- $pageData := .Page -}}
2+
{{- $siteData := .Site -}}
3+
{{- $pageUrl := printf "https://www.gooddata.com%s" $pageData.RelPermalink -}}
4+
{{- $breadcrumbs := partial "parseUrlBreadcrumbs.html" $pageUrl -}}
5+
6+
{{ partial "structureddata/structureddata.common-top.html" }}
7+
{
8+
"@type": "WebPage",
9+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#webpage",
10+
"url": "https://www.gooddata.com{{ $pageData.RelPermalink }}",
11+
"name": "{{ $pageData.Params.title }} | GoodData Cloud Documentation",
12+
"description": {{ if $pageData.Params.description }}{{ $pageData.Params.description | jsonify }}{{ else }}{{ $pageData.Summary | jsonify }}{{ end }},
13+
"isPartOf": {
14+
"@id": "https://www.gooddata.com#website"
15+
},
16+
"mainEntityOfPage": {
17+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#techarticle"
18+
},
19+
"breadcrumb": {
20+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#breadcrumb"
21+
}
22+
},
23+
{
24+
"@type": "BreadcrumbList",
25+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#breadcrumb",
26+
"itemListElement": [
27+
{{- range $index, $breadcrumb := $breadcrumbs -}}
28+
{{- $position := add $index 1 -}}
29+
{{- $pathSegments := split $breadcrumb "/" -}}
30+
{{- $lastSegment := index $pathSegments (sub (len $pathSegments) 2) -}}
31+
{{- $name := cond (eq $position 1) "Documentation" (cond (eq $lastSegment "cloud") "GoodData Cloud" $lastSegment) -}}
32+
{{- if gt $index 0 }},{{ end }}
33+
{
34+
"@type": "ListItem",
35+
"position": {{ $position }},
36+
"name": {{ humanize $name | jsonify }},
37+
"item": {{ $breadcrumb | jsonify }}
38+
}
39+
{{- end }}
40+
]
41+
},
42+
{
43+
"@type": "TechArticle",
44+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#techarticle",
45+
"mainEntityOfPage": {
46+
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#webpage",
47+
"@type": "WebPage"
48+
},
49+
"headline": {{ $pageData.Params.title | jsonify }},
50+
"description": {{ if $pageData.Params.description }}{{ $pageData.Params.description | jsonify }}{{ else }}{{ $pageData.Summary | jsonify }}{{ end }},
51+
"image": "https://www.gooddata.com/docs/og/OG_cloud_doc.webp",
52+
"author": {
53+
"@id": "https://www.gooddata.com#organization"
54+
},
55+
"publisher": {
56+
"@id": "https://www.gooddata.com#organization"
57+
},
58+
"dateModified": {{ $pageData.Params.lastmod | jsonify }},
59+
"articleSection": {{ $pageData.Parent.Title | jsonify }}
60+
}
61+
{{ partial "structureddata/structureddata.common-bottom.html" }}

0 commit comments

Comments
 (0)