From b4aa4c128c99bcad021717bd9339a2bd5f5245c2 Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 21 Aug 2026 19:59:50 +0300 Subject: [PATCH] updated json-ld Signed-off-by: bidi --- .../page/JSON-LD/author-resource.jsonld.twig | 10 +++++-- .../page/JSON-LD/authors.jsonld.twig | 10 +++++-- .../templates/page/JSON-LD/blog.jsonld.twig | 29 ++++++++++-------- .../page/JSON-LD/categories.jsonld.twig | 23 +++++++------- .../JSON-LD/category-resource.jsonld.twig | 16 ++++++++-- .../page/JSON-LD/tag-resource.jsonld.twig | 30 +++++++++++-------- 6 files changed, 75 insertions(+), 43 deletions(-) diff --git a/src/Blog/templates/page/JSON-LD/author-resource.jsonld.twig b/src/Blog/templates/page/JSON-LD/author-resource.jsonld.twig index aeba1a19..beac5d7d 100644 --- a/src/Blog/templates/page/JSON-LD/author-resource.jsonld.twig +++ b/src/Blog/templates/page/JSON-LD/author-resource.jsonld.twig @@ -13,13 +13,19 @@ }, "hasPart": { "@type": "ItemList", + "name": "Blog posts by {{ author.name }}", + "description": "A list of blog posts written by {{ author.name }}.", + "numberOfItems": {{ data.items|length }}, "itemListElement": [ {% for post in data.items %}{% if not loop.first %},{% endif %} { "@type": "ListItem", "position": {{ loop.index }}, - "url": "{{ app.url ~ path('page::blog-resource', {categorySlug: post.category.slug, slug: post.slug}) }}", - "name": "{{ post.title }}" + "item": { + "@type": "BlogPosting", + "headline": "{{ post.title }}", + "url": "{{ app.url ~ path('page::blog-resource', {categorySlug: post.category.slug, slug: post.slug}) }}" + } } {% endfor %} ] diff --git a/src/Blog/templates/page/JSON-LD/authors.jsonld.twig b/src/Blog/templates/page/JSON-LD/authors.jsonld.twig index 18f2db20..ff683eec 100644 --- a/src/Blog/templates/page/JSON-LD/authors.jsonld.twig +++ b/src/Blog/templates/page/JSON-LD/authors.jsonld.twig @@ -3,9 +3,10 @@ "@context": "https://schema.org", "@type": "CollectionPage", "@id": "{{ app.url ~ path('page::authors') }}#webpage", - "url": "{{ app.url ~ path('page::authors') }}", "name": "Authors", "description": "Browse Dotkernel blog posts by author.", + "url": "{{ app.url ~ path('page::authors') }}", + "numberOfItems": {{ authors|length }}, "isPartOf": { "@id": "{{ app.url }}#website" }, "mainEntity": { "@type": "ItemList", @@ -14,8 +15,11 @@ { "@type": "ListItem", "position": {{ loop.index }}, - "url": "{{ app.url ~ path('page::author-resource', {slug: author.slug}) }}", - "name": "{{ author.name }}" + "item": { + "@type": "Person", + "url": "{{ app.url ~ path('page::author-resource', {slug: author.slug}) }}", + "name": "{{ author.name }}" + } } {% endfor %} ] diff --git a/src/Blog/templates/page/JSON-LD/blog.jsonld.twig b/src/Blog/templates/page/JSON-LD/blog.jsonld.twig index de9d0a0e..6bb591e6 100644 --- a/src/Blog/templates/page/JSON-LD/blog.jsonld.twig +++ b/src/Blog/templates/page/JSON-LD/blog.jsonld.twig @@ -3,22 +3,27 @@ "@context": "https://schema.org", "@type": "CollectionPage", "@id": "{{ app.url ~ path('page::blog') }}#webpage", - "url": "{{ app.url ~ path('page::blog') }}", "name": "Blog", "description": "Latest articles from the Dotkernel blog.", + "url": "{{ app.url ~ path('page::blog') }}", + "numberOfItems": {{ data.items|length }}, "isPartOf": { "@id": "{{ app.url }}#website" }, - "mainEntity": { - "@type": "ItemList", - "itemListElement": [ - {% for article in data.items %}{% if not loop.first %},{% endif %} - { - "@type": "ListItem", - "position": {{ loop.index }}, + "itemListElement": [ + {% for article in data.items %}{% if not loop.first %},{% endif %} + { + "@type": "ListItem", + "position": {{ loop.index }}, + "item": { + "@type": "BlogPosting", "url": "{{ app.url ~ path('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}", - "name": "{{ article.title }}" + "headline": "{{ article.title }}", + "author": { + "@type": "Person", + "name": "{{ article.author.name }}" + } } - {% endfor %} - ] - } + } + {% endfor %} + ] } diff --git a/src/Blog/templates/page/JSON-LD/categories.jsonld.twig b/src/Blog/templates/page/JSON-LD/categories.jsonld.twig index c5a84b08..c1e0c48d 100644 --- a/src/Blog/templates/page/JSON-LD/categories.jsonld.twig +++ b/src/Blog/templates/page/JSON-LD/categories.jsonld.twig @@ -3,22 +3,23 @@ "@context": "https://schema.org", "@type": "CollectionPage", "@id": "{{ app.url ~ path('page::categories') }}#webpage", - "url": "{{ app.url ~ path('page::categories') }}", "name": "Categories", "description": "Browse Dotkernel blog posts by category.", + "url": "{{ app.url ~ path('page::categories') }}", + "numberOfItems": {{ categories|length }}, "isPartOf": { "@id": "{{ app.url }}#website" }, - "mainEntity": { - "@type": "ItemList", - "itemListElement": [ - {% for category in categories %}{% if not loop.first %},{% endif %} - { - "@type": "ListItem", - "position": {{ loop.index }}, + "itemListElement": [ + {% for category in categories %}{% if not loop.first %},{% endif %} + { + "@type": "ListItem", + "position": {{ loop.index }}, + "item": { + "@type": "CollectionPage", "url": "{{ app.url ~ path('page::category-resource', {slug: category.slug}) }}", "name": "{{ category.name }}" } - {% endfor %} - ] - } + } + {% endfor %} + ] } diff --git a/src/Blog/templates/page/JSON-LD/category-resource.jsonld.twig b/src/Blog/templates/page/JSON-LD/category-resource.jsonld.twig index 2854e563..e2625ab9 100644 --- a/src/Blog/templates/page/JSON-LD/category-resource.jsonld.twig +++ b/src/Blog/templates/page/JSON-LD/category-resource.jsonld.twig @@ -3,18 +3,28 @@ "@context": "https://schema.org", "@type": "CollectionPage", "@id": "{{ app.url ~ path('page::category-resource', {slug: category.slug}) }}#webpage", - "url": "{{ app.url ~ path('page::category-resource', {slug: category.slug}) }}", "name": "{{ category.name }}", + "description": "Blog posts from the '{{ category.name }}' category.", + "url": "{{ app.url ~ path('page::category-resource', {slug: category.slug}) }}", "isPartOf": { "@id": "{{ app.url }}#website" }, "mainEntity": { "@type": "ItemList", + "name": "Posts in '{{ category.name }}'", + "numberOfItems": {{ data.items|length }}, "itemListElement": [ {% for article in data.items %}{% if not loop.first %},{% endif %} { "@type": "ListItem", "position": {{ loop.index }}, - "url": "{{ app.url ~ path('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}", - "name": "{{ article.title }}" + "item": { + "@type": "BlogPosting", + "url": "{{ app.url ~ path('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}", + "heading": "{{ article.title }}", + "author": { + "@type": "Person", + "name": "{{ article.author.name }}" + } + } } {% endfor %} ] diff --git a/src/Blog/templates/page/JSON-LD/tag-resource.jsonld.twig b/src/Blog/templates/page/JSON-LD/tag-resource.jsonld.twig index 46979b1e..2175d775 100644 --- a/src/Blog/templates/page/JSON-LD/tag-resource.jsonld.twig +++ b/src/Blog/templates/page/JSON-LD/tag-resource.jsonld.twig @@ -3,21 +3,27 @@ "@context": "https://schema.org", "@type": "CollectionPage", "@id": "{{ app.url ~ path('page::tag-resource', {slug: tag.slug}) }}#webpage", - "url": "{{ app.url ~ path('page::tag-resource', {slug: tag.slug}) }}", "name": "{{ tag.name }}", + "description": "Blog posts that contain the '{{ category.name }}' tag.", + "url": "{{ app.url ~ path('page::tag-resource', {slug: tag.slug}) }}", + "numberOfItems": {{ data.items|length }}, "isPartOf": { "@id": "{{ app.url }}#website" }, - "mainEntity": { - "@type": "ItemList", - "itemListElement": [ - {% for article in data.items %}{% if not loop.first %},{% endif %} - { - "@type": "ListItem", - "position": {{ loop.index }}, + "itemListElement": [ + {% for article in data.items %}{% if not loop.first %},{% endif %} + { + "@type": "ListItem", + "position": {{ loop.index }}, + "item": { + "@type": "BlogPosting", "url": "{{ app.url ~ path('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}", - "name": "{{ article.title }}" + "headline": "{{ article.title }}", + "author": { + "@type": "Person", + "name": "{{ article.author.name }}" + } } - {% endfor %} - ] - } + } + {% endfor %} + ] }