Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
{{ if .Params.externalLink }}
<meta http-equiv="refresh" content="0;url={{ .Params.externalLink }}" />
{{ end }}
<script type="application/ld+json">
{{ partial "structureddata/structureddata.looker.html" (dict "Page" . "Site" .Site) | safeJS }}
</script>
</head>
<body class="td-{{ .Kind }}">
{{ partial "gtm-body.html" }}
Expand Down
38 changes: 38 additions & 0 deletions docs/layouts/partials/header-menu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<nav class="gd-docs-header-nav__center gd-header" aria-label="Main">
<input type="checkbox" hidden tabindex="-1" id="gd-header-mobile-menu-trigger-input" name="gd-header-mobile-menu-trigger-input" class="gd-header-mobile gd-header-mobile-menu-trigger-input" aria-label="Open navigation menu" aria-controls="gd-header-mobile-menu" aria-expanded="false">
<button id="gd-header-mobile-menu-button" tabindex="5" type="button" class="gd-header-mobile gd-header-mobile-menu-trigger" aria-controls="gd-header-mobile-menu" aria-expanded="false" aria-label="Open navigation menu">
<span aria-hidden="true"></span>
</button>
<ul id="gd-header-mobile-menu" class="gd-docs-header-nav__menu gd-header-links">
<li class="gd-docs-header-nav__menuitem gd-header-link-item gd-header-link-item-mobile-only">
<a href="https://www.gooddata.com/learn/" class="gd-docs-header-nav__menulink gd-header-link gd-header-link__main">
Learn
</a>
</li>
<li class="gd-docs-header-nav__menuitem gd-header-link-item">
<a href="https://university.gooddata.com/" class="gd-docs-header-nav__menulink gd-header-link">
University
</a>
</li>
<li class="gd-docs-header-nav__menuitem gd-header-link-item">
<a href="https://community.gooddata.com/" class="gd-docs-header-nav__menulink gd-header-link">
Community
</a>
</li>
<li class="gd-docs-header-nav__menuitem gd-header-link-item">
<a href="https://www.gooddata.com/docs/" class="gd-docs-header-nav__menulink gd-header-link gd-header-link__active">
Documentation
</a>
</li>
<li class="gd-docs-header-nav__menuitem gd-header-link-item">
<a href="https://support.gooddata.com/hc/en-us" class="gd-docs-header-nav__menulink gd-header-link">
Support
</a>
</li>
<li class="gd-docs-header-nav__menuitem gd-header-link-item gd-header-link-item-mobile-only">
<a href="https://www.gooddata.com/" class="gd-docs-header-nav__menulink gd-header-link">
Go to GoodData.com
</a>
</li>
</ul>
</nav>
1 change: 0 additions & 1 deletion docs/layouts/partials/hooks/body-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<script src="/js/tab-order.js"></script>

{{/* additional scripts */}}
<script src="/js/archive-link.js"></script>
<script
async
src="https://widget.kapa.ai/kapa-widget.bundle.js"
Expand Down
116 changes: 116 additions & 0 deletions docs/layouts/partials/parseUrlBreadcrumbs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{{- $url := . -}}
{{- $variant := "full" -}}

{{- /* Check if variant is passed as context (dict) or just the URL string */ -}}
{{- if reflect.IsMap . -}}
{{- $url = .url -}}
{{- $variant = .variant | default "full" -}}
{{- end -}}

{{- $urlObj := urls.Parse $url -}}
{{- $host := printf "%s://%s" $urlObj.Scheme $urlObj.Host -}}
{{- $pathname := $urlObj.Path -}}

{{- $breadcrumbs := slice -}}
{{- $segments := split $pathname "/" -}}
{{- $currentPath := "" -}}

{{- if eq $variant "before-version" -}}
{{/* Variant 1: Return only the base path up to and including /latest/ or any version from Site.Params.versions */}}
{{- $versionFound := false -}}
{{- $versionIndex := 0 -}}

{{- range $index, $segment := $segments -}}
{{- if ne $segment "" -}}
{{/* Check if segment is "latest" */}}
{{- if eq $segment "latest" -}}
{{- $versionFound = true -}}
{{- $versionIndex = $index -}}
{{- else -}}
{{/* Check if segment matches any version in Site.Params.versions or is a semantic version */}}
{{- if and ($.Site.Params) ($.Site.Params.versions) -}}
{{- range $.Site.Params.versions -}}
{{- if eq $segment .version -}}
{{- $versionFound = true -}}
{{- $versionIndex = $index -}}
{{- end -}}
{{- end -}}
{{- else -}}
{{/* Fallback: check if segment looks like a version (1.51, 1.52, etc.) */}}
{{- if or (eq $segment "dev") (eq $segment "master") (findRE `^\d+\.\d+` $segment) -}}
{{- $versionFound = true -}}
{{- $versionIndex = $index -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- if $versionFound -}}
{{- $currentPath = "" -}}
{{- range $index, $segment := $segments -}}
{{- if and (le $index $versionIndex) (ne $segment "") -}}
{{- $currentPath = printf "%s%s/" $currentPath $segment -}}
{{- end -}}
{{- end -}}
{{- $fullUrl := printf "%s/%s" $host $currentPath -}}
{{- $breadcrumbs = $breadcrumbs | append $fullUrl -}}
{{- end -}}

{{- else if eq $variant "after-version" -}}
{{/* Variant 2: Start parsing from /latest/ or any version from Site.Params.versions */}}
{{- $versionFound := false -}}
{{- $startIndex := 0 -}}

{{- range $index, $segment := $segments -}}
{{- if ne $segment "" -}}
{{/* Check if segment is "latest" */}}
{{- if eq $segment "latest" -}}
{{- $versionFound = true -}}
{{- $startIndex = $index -}}
{{- else -}}
{{/* Check if segment matches any version in Site.Params.versions or is a semantic version */}}
{{- if and ($.Site.Params) ($.Site.Params.versions) -}}
{{- range $.Site.Params.versions -}}
{{- if eq $segment .version -}}
{{- $versionFound = true -}}
{{- $startIndex = $index -}}
{{- end -}}
{{- end -}}
{{- else -}}
{{/* Fallback: check if segment looks like a version (1.51, 1.52, etc.) */}}
{{- if or (eq $segment "dev") (eq $segment "master") (findRE `^\d+\.\d+` $segment) -}}
{{- $versionFound = true -}}
{{- $startIndex = $index -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- if $versionFound -}}
{{- $currentPath = "" -}}
{{- range $index, $segment := $segments -}}
{{- if and (ge $index $startIndex) (ne $segment "") -}}
{{- $currentPath = printf "%s%s/" $currentPath $segment -}}
{{- $fullUrl := printf "%s/%s" $host $currentPath -}}
{{- $breadcrumbs = $breadcrumbs | append $fullUrl -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- else -}}
{{/* Default variant: Parse all segments */}}
{{- range $segments -}}
{{- if ne . "" -}}
{{- $currentPath = printf "%s%s/" $currentPath . -}}
{{- $fullUrl := printf "%s/%s" $host $currentPath -}}
{{- $breadcrumbs = $breadcrumbs | append $fullUrl -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- if gt (len $breadcrumbs) 0 -}}
{{- $breadcrumbs | jsonify }}
{{- else -}}
[]{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{{- $pageData := .Page -}}
{{- $siteData := .Site -}}

{{- $pageUrl := printf "https://www.gooddata.com%s" $pageData.RelPermalink -}}
{{- $basePathVersionJson := partial "parseUrlBreadcrumbs.html" (dict "url" $pageUrl "variant" "before-version") -}}
{{- $basePathVersionArray := $basePathVersionJson | unmarshal -}}
{{- $basePathVersion := cond (gt (len $basePathVersionArray) 0) (index $basePathVersionArray 0) "https://www.gooddata.com/docs/python-sdk/latest/" -}}
{{- $breadcrumbsJson := partial "parseUrlBreadcrumbs.html" (dict "url" $pageUrl "variant" "after-version") -}}
{{- $breadcrumbs := $breadcrumbsJson | unmarshal -}}

{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ $basePathVersion }}#website",
"url": {{ $basePathVersion | jsonify }}
},
{
"@type": "Organization",
"@id": "https://www.gooddata.com/#organization",
"name": "GoodData",
"url": "https://www.gooddata.com"
},
{
"@type": "TechArticle",
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#article",
"headline": "{{ $pageData.Params.title }} | GoodData Python SDK",
"description": {{ if $pageData.Params.description }}{{ $pageData.Params.description | jsonify }}{{ else }}{{ $pageData.Summary | jsonify }}{{ end }},
"url": "https://www.gooddata.com{{ $pageData.RelPermalink }}",
"dateModified": {{ $pageData.Params.lastmod | jsonify }},
"author": {
"@id": "https://www.gooddata.com/#organization"
},
"publisher": {
"@id": "https://www.gooddata.com/#organization"
},
"isPartOf": {
"@id": "{{ $basePathVersion }}#website"
},
"about": {
"@id": "{{ $basePathVersion }}#software"
},
"articleSection": {{ $pageData.Parent.Title | jsonify }},
"inLanguage": "en",
"mainEntity": {
"@type": "SoftwareSourceCode",
"name": {{ $pageData.Params.title | jsonify }},
"description": {{ if $pageData.Params.description }}{{ $pageData.Params.description | jsonify }}{{ else }}{{ $pageData.Summary | jsonify }}{{ end }},
"programmingLanguage": "Python",
"codeSampleType": "full",
"codeRepository": "https://github.com/gooddata/gooddata-python-sdk",
"runtimePlatform": "Python 3.13+",
"targetProduct": {
"@id": "{{ $basePathVersion }}#software"
}
}
},
{
"@type": "WebPage",
"@id": "https://www.gooddata.com/docs/python-sdk/latest/administration/organization/update_name/#webpage",
"url": "https://www.gooddata.com/docs/python-sdk/latest/administration/organization/update_name/",
"name": "{{ $pageData.Params.title }} | GoodData Python SDK",
"isPartOf": {
"@id": "{{ $basePathVersion }}#website"
},
"breadcrumb": {
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#breadcrumb"
}
},
{
"@type": "BreadcrumbList",
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#breadcrumb",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.gooddata.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Documentation",
"item": "https://www.gooddata.com/docs/"
}{{- range $index, $breadcrumb := $breadcrumbs }}
{{- $segments := split (trim $breadcrumb "/") "/" }}
{{- $name := cond (eq (add $index 3) 3) "Python SDK" (index $segments (sub (len $segments) 1) | humanize) }},
{
"@type": "ListItem",
"position": {{ add $index 3 }},
"name": {{ $name | jsonify }},
"item": {{ $breadcrumb | jsonify }}
}{{- end }}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{{- $pageData := .Page -}}
{{- $siteData := .Site -}}

{{- $pageUrl := printf "https://www.gooddata.com%s" $pageData.RelPermalink -}}
{{- $basePathVersionJson := partial "parseUrlBreadcrumbs.html" (dict "url" $pageUrl "variant" "before-version") -}}
{{- $basePathVersionArray := $basePathVersionJson | unmarshal -}}
{{- $basePathVersion := cond (gt (len $basePathVersionArray) 0) (index $basePathVersionArray 0) "https://www.gooddata.com/docs/python-sdk/latest/" -}}
{{- $breadcrumbsJson := partial "parseUrlBreadcrumbs.html" (dict "url" $pageUrl "variant" "after-version") -}}
{{- $breadcrumbs := $breadcrumbsJson | unmarshal -}}

{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ $basePathVersion }}#website",
"url": {{ $basePathVersion | jsonify }}
},
{
"@type": "Organization",
"@id": "https://www.gooddata.com/#organization",
"name": "GoodData",
"url": "https://www.gooddata.com"
},
{
"@type": "TechArticle",
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#article",
"headline": "{{ $pageData.Params.title }} | GoodData Python SDK",
"description":{{ if $pageData.Params.description }}{{ $pageData.Params.description | jsonify }}{{ else }}{{ $pageData.Summary | jsonify }}{{ end }},
"url": "https://www.gooddata.com{{ $pageData.RelPermalink }}",
"dateModified": {{ $pageData.Params.lastmod | jsonify }},
"author": {
"@id": "https://www.gooddata.com/#organization"
},
"publisher": {
"@id": "https://www.gooddata.com/#organization"
},
"isPartOf": {
"@id": "{{ $basePathVersion }}#website"
},
"about": {
"@id": "{{ $basePathVersion }}#software"
},
"articleSection": {{ $pageData.Parent.Title | jsonify }},
"inLanguage": "en"
},
{
"@type": "WebPage",
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#webpage",
"url": "https://www.gooddata.com{{ $pageData.RelPermalink }}",
"name": "{{ $pageData.Params.title }} | GoodData Python SDK",
"isPartOf": {
"@id": "{{ $basePathVersion }}#website"
},
"breadcrumb": {
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#breadcrumb"
}
},
{
"@type": "BreadcrumbList",
"@id": "https://www.gooddata.com{{ $pageData.RelPermalink }}#breadcrumb",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.gooddata.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Documentation",
"item": "https://www.gooddata.com/docs/"
}{{- range $index, $breadcrumb := $breadcrumbs }}
{{- $segments := split (trim $breadcrumb "/") "/" }}
{{- $name := cond (eq (add $index 3) 3) "Python SDK" (index $segments (sub (len $segments) 1) | humanize) }},
{
"@type": "ListItem",
"position": {{ add $index 3 }},
"name": {{ $name | jsonify }},
"item": {{ $breadcrumb | jsonify }}
}{{- end }}
]
}
]
}
Loading
Loading