Skip to content

Commit 83e9030

Browse files
Copilotgkorland
andcommitted
Add JSON-LD schemas for BreadcrumbList and TechArticle
Co-authored-by: gkorland <[email protected]>
1 parent 4ca42d3 commit 83e9030

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

_includes/breadcrumb_schema.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{% comment %}
2+
BreadcrumbList JSON-LD Schema.org markup
3+
Generates breadcrumb navigation structure for SEO
4+
{% endcomment %}
5+
{% if page.url != "/" %}
6+
<script type="application/ld+json">
7+
{
8+
"@context": "https://schema.org",
9+
"@type": "BreadcrumbList",
10+
"itemListElement": [
11+
{
12+
"@type": "ListItem",
13+
"position": 1,
14+
"name": "Home",
15+
"item": "{{ site.url | default: 'https://docs.falkordb.com' }}"
16+
}
17+
{% assign position = 2 %}
18+
{% if page.parent %}
19+
{% comment %}Find parent page{% endcomment %}
20+
{% assign parent_pages = site.pages | where: "title", page.parent %}
21+
{% if parent_pages.size > 0 %}
22+
{% assign parent = parent_pages | first %}
23+
,{
24+
"@type": "ListItem",
25+
"position": {{ position }},
26+
"name": "{{ parent.title }}",
27+
"item": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ parent.url }}"
28+
}
29+
{% assign position = position | plus: 1 %}
30+
{% endif %}
31+
{% endif %}
32+
,{
33+
"@type": "ListItem",
34+
"position": {{ position }},
35+
"name": "{{ page.title }}",
36+
"item": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ page.url }}"
37+
}
38+
]
39+
}
40+
</script>
41+
{% endif %}

_includes/head_custom.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@
1111
})(window,document,'script','dataLayer','{{ site.gtm_tracking }}');</script>
1212
<!-- End Google Tag Manager -->
1313
{% endif %}
14+
15+
<!-- JSON-LD Schema.org Structured Data -->
16+
{% include breadcrumb_schema.html %}
17+
{% include techarticle_schema.html %}

_includes/techarticle_schema.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% comment %}
2+
TechArticle JSON-LD Schema.org markup
3+
Provides structured data for technical documentation pages
4+
{% endcomment %}
5+
<script type="application/ld+json">
6+
{
7+
"@context": "https://schema.org",
8+
"@type": "TechArticle",
9+
"headline": "{{ page.title | default: site.title }}",
10+
{% if page.description %}
11+
"description": "{{ page.description | strip_html | strip_newlines | escape }}",
12+
{% endif %}
13+
"url": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ page.url }}",
14+
{% if page.last_modified_at %}
15+
"dateModified": "{{ page.last_modified_at | date_to_xmlschema }}",
16+
{% elsif page.date %}
17+
"dateModified": "{{ page.date | date_to_xmlschema }}",
18+
{% endif %}
19+
"author": {
20+
"@type": "Organization",
21+
"name": "FalkorDB"
22+
},
23+
"publisher": {
24+
"@type": "Organization",
25+
"name": "FalkorDB",
26+
"logo": {
27+
"@type": "ImageObject",
28+
"url": "{{ site.url | default: 'https://docs.falkordb.com' }}/images/falkor-logo.png"
29+
}
30+
},
31+
"mainEntityOfPage": {
32+
"@type": "WebPage",
33+
"@id": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ page.url }}"
34+
}
35+
}
36+
</script>

0 commit comments

Comments
 (0)