Skip to content
Open
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
41 changes: 41 additions & 0 deletions _includes/breadcrumb_schema.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% comment %}
BreadcrumbList JSON-LD Schema.org markup
Generates breadcrumb navigation structure for SEO
{% endcomment %}
{% if page.url != "/" %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "{{ site.url | default: 'https://docs.falkordb.com' }}"
}
{% assign position = 2 %}
{% if page.parent %}
{% comment %}Find parent page{% endcomment %}
{% assign parent_pages = site.pages | where: "title", page.parent %}
{% if parent_pages.size > 0 %}
{% assign parent = parent_pages | first %}
,{
"@type": "ListItem",
"position": {{ position }},
"name": "{{ parent.title }}",
"item": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ parent.url }}"
}
{% assign position = position | plus: 1 %}
{% endif %}
{% endif %}
,{
"@type": "ListItem",
"position": {{ position }},
"name": "{{ page.title }}",
"item": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ page.url }}"
}
]
}
</script>
Comment on lines +5 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Invalid JSON syntax due to conditional leading commas.

The JSON-LD BreadcrumbList has a fatal flaw in how commas are handled around conditionally-rendered items.

When the parent block (lines 18–31) does not render, the resulting JSON is:

"itemListElement": [
  { "position": 1, ... }
  ,{ "position": 2, ... }  // ← Invalid: leading comma after closing brace
]

This violates JSON syntax and will be rejected by search engines. Similarly, when the parent block does render, you get a double-comma sequence (},\n ,{), which is also invalid.

The root cause: The leading commas at lines 23 and 32 assume a preceding element, but JSON requires commas between elements, not before them.

Suggested fix: Move the comma after the Home item and handle the parent conditionally:

   {
     "@type": "ListItem",
     "position": 1,
     "name": "Home",
     "item": "{{ site.url | default: 'https://docs.falkordb.com' }}"
-  }
+  },
   {% assign position = 2 %}
   {% if page.parent %}
   {% comment %}Find parent page{% endcomment %}
   {% assign parent_pages = site.pages | where: "title", page.parent %}
   {% if parent_pages.size > 0 %}
   {% assign parent = parent_pages | first %}
-  ,{
+  {
     "@type": "ListItem",
     "position": {{ position }},
     "name": "{{ parent.title }}",
     "item": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ parent.url }}"
-  }
+  },
    {% assign position = position | plus: 1 %}
   {% endif %}
   {% endif %}
-  ,{
+  {
     "@type": "ListItem",
     "position": {{ position }},
     "name": "{{ page.title }}",
     "item": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ page.url }}"
   }
 ]

This ensures the JSON array maintains valid syntax regardless of whether the parent element is present.

{% endif %}
4 changes: 4 additions & 0 deletions _includes/head_custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
})(window,document,'script','dataLayer','{{ site.gtm_tracking }}');</script>
<!-- End Google Tag Manager -->
{% endif %}

<!-- JSON-LD Schema.org Structured Data -->
{% include breadcrumb_schema.html %}
{% include techarticle_schema.html %}
39 changes: 39 additions & 0 deletions _includes/techarticle_schema.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% comment %}
TechArticle JSON-LD Schema.org markup
Provides structured data for technical documentation pages
{% endcomment %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TechArticle",
"headline": "{{ page.title | default: site.title }}",
{% if page.description %}
"description": "{{ page.description | strip_html | strip_newlines | escape }}",
{% endif %}
"url": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ page.url }}",
{% if page.date %}
"datePublished": "{{ page.date | date_to_xmlschema }}",
{% endif %}
{% if page.last_modified_at %}
"dateModified": "{{ page.last_modified_at | date_to_xmlschema }}",
{% elsif page.date %}
"dateModified": "{{ page.date | date_to_xmlschema }}",
{% endif %}
Comment on lines +17 to +21
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TechArticle schema is missing the required 'datePublished' field as specified in the requirements. The schema includes 'dateModified' but should include both 'datePublished' (from page.date) and 'dateModified' (from page.last_modified_at with fallback to page.date) as separate fields.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the datePublished field to the TechArticle schema. The schema now includes both datePublished (from page.date) and dateModified (from page.last_modified_at with fallback to page.date) as separate fields as required. Changes in commit e2343f6.

"author": {
"@type": "Organization",
"name": "FalkorDB"
},
"publisher": {
"@type": "Organization",
"name": "FalkorDB",
"logo": {
"@type": "ImageObject",
"url": "{{ site.url | default: 'https://docs.falkordb.com' }}/images/falkor-logo.png"
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logo URL path does not match the path specified in the requirements. According to the PR description, the logo should be at '/assets/logo.png', but this implementation uses '/images/falkor-logo.png'. This will result in a broken logo URL unless the file exists at this alternate location.

Suggested change
"url": "{{ site.url | default: 'https://docs.falkordb.com' }}/images/falkor-logo.png"
"url": "{{ site.url | default: 'https://docs.falkordb.com' }}/assets/logo.png"

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot the logo is in images/falkor-logo.png

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed - the logo path /images/falkor-logo.png is correct and matches the site configuration in _config.yml (line 4). The file exists and the schema is using the correct path.

}
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ site.url | default: 'https://docs.falkordb.com' }}{{ page.url }}"
}
}
</script>
Loading