|
| 1 | +{% capture page_url %}{{ site.url }}{{ page.url | remove: "index.html" | remove: ".html" }}{% endcapture %} |
| 2 | + |
| 3 | +{% comment %}Organization schema on every page{% endcomment %} |
| 4 | +<script type="application/ld+json"> |
| 5 | +{ |
| 6 | + "@context": "https://schema.org", |
| 7 | + "@type": "Organization", |
| 8 | + "name": "{{ site.title }}", |
| 9 | + "url": "{{ site.url }}", |
| 10 | + "logo": "{{ site.image }}", |
| 11 | + "description": "{{ site.description | smartify }}", |
| 12 | + "sameAs": [ |
| 13 | + "https://github.com/OpenIdentityPlatform", |
| 14 | + "https://github.com/orgs/OpenIdentityPlatform/discussions" |
| 15 | + ] |
| 16 | +} |
| 17 | +</script> |
| 18 | + |
| 19 | +{% comment %}Product schema on product pages{% endcomment %} |
| 20 | +{%- if page.product -%} |
| 21 | +{%- assign product_data = site.data.products | where: "product", page.product | first -%} |
| 22 | +{%- if product_data == nil -%} |
| 23 | + {%- for p in site.data.products -%} |
| 24 | + {%- assign p_name = p.name | downcase -%} |
| 25 | + {%- assign page_product = page.product -%} |
| 26 | + {%- if p_name == page_product -%} |
| 27 | + {%- assign product_data = p -%} |
| 28 | + {%- endif -%} |
| 29 | + {%- endfor -%} |
| 30 | +{%- endif -%} |
| 31 | +<script type="application/ld+json"> |
| 32 | +{ |
| 33 | + "@context": "https://schema.org", |
| 34 | + "@type": "SoftwareSourceCode", |
| 35 | + "name": "{{ page.title }}", |
| 36 | + "description": "{{ page_description }}", |
| 37 | + "url": "{{ page_url }}", |
| 38 | + "codeRepository": "{{ product_data.link }}", |
| 39 | + "programmingLanguage": "Java", |
| 40 | + "license": "https://spdx.org/licenses/CDDL-1.1", |
| 41 | + "isPartOf": { |
| 42 | + "@type": "Organization", |
| 43 | + "name": "{{ site.title }}", |
| 44 | + "url": "{{ site.url }}" |
| 45 | + } |
| 46 | +} |
| 47 | +</script> |
| 48 | +{%- endif -%} |
| 49 | + |
| 50 | +{% comment %}Article schema on blog posts{% endcomment %} |
| 51 | +{%- if page.url contains "/blog/" and page.date -%} |
| 52 | +<script type="application/ld+json"> |
| 53 | +{ |
| 54 | + "@context": "https://schema.org", |
| 55 | + "@type": "BlogPosting", |
| 56 | + "headline": "{%- if page.landing-title -%}{{ page.landing-title }}{%- else -%}{{ page.title }}{%- endif -%}", |
| 57 | + "description": "{{ page_description }}", |
| 58 | + "url": "{{ page_url }}", |
| 59 | + "datePublished": "{{ page.date | date_to_xmlschema }}", |
| 60 | + {%- if page.lastmod %} |
| 61 | + "dateModified": "{{ page.lastmod | date_to_xmlschema }}", |
| 62 | + {%- else %} |
| 63 | + "dateModified": "{{ page.date | date_to_xmlschema }}", |
| 64 | + {%- endif %} |
| 65 | + "author": { |
| 66 | + "@type": "Organization", |
| 67 | + "name": "{{ site.authors }}" |
| 68 | + }, |
| 69 | + "publisher": { |
| 70 | + "@type": "Organization", |
| 71 | + "name": "{{ site.title }}", |
| 72 | + "logo": { |
| 73 | + "@type": "ImageObject", |
| 74 | + "url": "{{ site.image }}" |
| 75 | + } |
| 76 | + }, |
| 77 | + {%- if page.imageurl %} |
| 78 | + "image": "{{ site.url }}/assets/img/{{ page.imageurl }}", |
| 79 | + {%- else %} |
| 80 | + "image": "{{ site.image }}", |
| 81 | + {%- endif %} |
| 82 | + "mainEntityOfPage": { |
| 83 | + "@type": "WebPage", |
| 84 | + "@id": "{{ page_url }}" |
| 85 | + } |
| 86 | +} |
| 87 | +</script> |
| 88 | +{%- endif -%} |
0 commit comments