|
9 | 9 | {{ with .Site.Params.ahrefsAnalytics }} |
10 | 10 | <script src="https://analytics.ahrefs.com/analytics.js" data-key="{{ . }}" async></script> |
11 | 11 | {{ end }} |
| 12 | + |
| 13 | +{{/* SEO: canonical + noindex for legacy doc versions. |
| 14 | + Older non-latest doc versions (v0, v1.0, v1.1, …) duplicate content from |
| 15 | + the latest version (v1.2). Without dedup signals, search engines split |
| 16 | + ranking signals across all five copies. We mark old versions as noindex |
| 17 | + (still crawlable for users following links) and canonicalize current |
| 18 | + pages to themselves. */}} |
| 19 | +{{- $latestVersion := .Site.Params.latest_version_id | default "v1.2" -}} |
| 20 | +{{- $isOldDocsVersion := false -}} |
| 21 | +{{- range .Site.Params.versions -}} |
| 22 | + {{- if and .id (ne .id $latestVersion) (ne .id "next") -}} |
| 23 | + {{- if in $.RelPermalink (printf "/docs/%s/" .id) -}} |
| 24 | + {{- $isOldDocsVersion = true -}} |
| 25 | + {{- end -}} |
| 26 | + {{- end -}} |
| 27 | +{{- end -}} |
| 28 | +{{- if $isOldDocsVersion }} |
| 29 | +<meta name="robots" content="noindex, follow" /> |
| 30 | +{{- else }} |
| 31 | +<link rel="canonical" href="{{ .Permalink }}" /> |
| 32 | +{{- end }} |
| 33 | + |
| 34 | +{{/* JSON-LD Organization (every page) */}} |
| 35 | +<script type="application/ld+json"> |
| 36 | +{ |
| 37 | + "@context": "https://schema.org", |
| 38 | + "@type": "Organization", |
| 39 | + "name": "Cozystack", |
| 40 | + "url": "{{ "/" | absURL }}", |
| 41 | + "logo": "{{ "img/cozystack-social.png" | absURL }}", |
| 42 | + "description": {{ .Site.Params.description | jsonify }}, |
| 43 | + "foundingDate": "2023", |
| 44 | + "sameAs": [ |
| 45 | + "https://github.com/cozystack/cozystack", |
| 46 | + "https://landscape.cncf.io/?item=platform--paas-container-service--cozystack", |
| 47 | + "https://kubernetes.slack.com/messages/cozystack", |
| 48 | + "https://t.me/cozystack" |
| 49 | + ] |
| 50 | +} |
| 51 | +</script> |
| 52 | + |
| 53 | +{{/* JSON-LD WebSite (homepage only) */}} |
| 54 | +{{- if .IsHome }} |
| 55 | +<script type="application/ld+json"> |
| 56 | +{ |
| 57 | + "@context": "https://schema.org", |
| 58 | + "@type": "WebSite", |
| 59 | + "name": "Cozystack", |
| 60 | + "url": "{{ "/" | absURL }}", |
| 61 | + "description": {{ .Site.Params.description | jsonify }} |
| 62 | +} |
| 63 | +</script> |
| 64 | + |
| 65 | +{{/* JSON-LD SoftwareApplication (homepage only) — helps AI search engines |
| 66 | + classify Cozystack correctly when answering "what is Cozystack" queries. */}} |
| 67 | +<script type="application/ld+json"> |
| 68 | +{ |
| 69 | + "@context": "https://schema.org", |
| 70 | + "@type": "SoftwareApplication", |
| 71 | + "name": "Cozystack", |
| 72 | + "applicationCategory": "Cloud Platform", |
| 73 | + "operatingSystem": "Linux", |
| 74 | + "url": "{{ "/" | absURL }}", |
| 75 | + "description": {{ .Site.Params.description | jsonify }}, |
| 76 | + "license": "https://www.apache.org/licenses/LICENSE-2.0", |
| 77 | + "offers": { |
| 78 | + "@type": "Offer", |
| 79 | + "price": "0", |
| 80 | + "priceCurrency": "USD" |
| 81 | + }, |
| 82 | + "softwareRequirements": "Kubernetes, KubeVirt, Cilium, LINSTOR, Talos Linux" |
| 83 | +} |
| 84 | +</script> |
| 85 | +{{- end }} |
| 86 | + |
| 87 | +{{/* JSON-LD BlogPosting (single blog posts) */}} |
| 88 | +{{- if and (eq .Section "blog") (not .IsSection) (not .IsHome) }} |
| 89 | +<script type="application/ld+json"> |
| 90 | +{ |
| 91 | + "@context": "https://schema.org", |
| 92 | + "@type": "BlogPosting", |
| 93 | + "headline": {{ .Title | jsonify }}, |
| 94 | + "description": {{ .Description | jsonify }}, |
| 95 | + "datePublished": "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}", |
| 96 | + "dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}", |
| 97 | + "author": { |
| 98 | + "@type": "Person", |
| 99 | + "name": {{ .Params.author | default "Cozystack Team" | jsonify }} |
| 100 | + }, |
| 101 | + "image": "{{ with .Params.images }}{{ index . 0 | absURL }}{{ else }}{{ index $.Site.Params.images 0 | absURL }}{{ end }}", |
| 102 | + "publisher": { |
| 103 | + "@type": "Organization", |
| 104 | + "name": "Cozystack", |
| 105 | + "logo": { |
| 106 | + "@type": "ImageObject", |
| 107 | + "url": "{{ "img/cozystack-social.png" | absURL }}" |
| 108 | + } |
| 109 | + }, |
| 110 | + "mainEntityOfPage": { |
| 111 | + "@type": "WebPage", |
| 112 | + "@id": "{{ .Permalink }}" |
| 113 | + } |
| 114 | +} |
| 115 | +</script> |
| 116 | +{{- end }} |
0 commit comments