Skip to content

Commit b4aa4c1

Browse files
committed
updated json-ld
Signed-off-by: bidi <bidi@apidemia.com>
1 parent dcb4b8d commit b4aa4c1

6 files changed

Lines changed: 75 additions & 43 deletions

File tree

src/Blog/templates/page/JSON-LD/author-resource.jsonld.twig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313
},
1414
"hasPart": {
1515
"@type": "ItemList",
16+
"name": "Blog posts by {{ author.name }}",
17+
"description": "A list of blog posts written by {{ author.name }}.",
18+
"numberOfItems": {{ data.items|length }},
1619
"itemListElement": [
1720
{% for post in data.items %}{% if not loop.first %},{% endif %}
1821
{
1922
"@type": "ListItem",
2023
"position": {{ loop.index }},
21-
"url": "{{ app.url ~ path('page::blog-resource', {categorySlug: post.category.slug, slug: post.slug}) }}",
22-
"name": "{{ post.title }}"
24+
"item": {
25+
"@type": "BlogPosting",
26+
"headline": "{{ post.title }}",
27+
"url": "{{ app.url ~ path('page::blog-resource', {categorySlug: post.category.slug, slug: post.slug}) }}"
28+
}
2329
}
2430
{% endfor %}
2531
]

src/Blog/templates/page/JSON-LD/authors.jsonld.twig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"@context": "https://schema.org",
44
"@type": "CollectionPage",
55
"@id": "{{ app.url ~ path('page::authors') }}#webpage",
6-
"url": "{{ app.url ~ path('page::authors') }}",
76
"name": "Authors",
87
"description": "Browse Dotkernel blog posts by author.",
8+
"url": "{{ app.url ~ path('page::authors') }}",
9+
"numberOfItems": {{ authors|length }},
910
"isPartOf": { "@id": "{{ app.url }}#website" },
1011
"mainEntity": {
1112
"@type": "ItemList",
@@ -14,8 +15,11 @@
1415
{
1516
"@type": "ListItem",
1617
"position": {{ loop.index }},
17-
"url": "{{ app.url ~ path('page::author-resource', {slug: author.slug}) }}",
18-
"name": "{{ author.name }}"
18+
"item": {
19+
"@type": "Person",
20+
"url": "{{ app.url ~ path('page::author-resource', {slug: author.slug}) }}",
21+
"name": "{{ author.name }}"
22+
}
1923
}
2024
{% endfor %}
2125
]

src/Blog/templates/page/JSON-LD/blog.jsonld.twig

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,27 @@
33
"@context": "https://schema.org",
44
"@type": "CollectionPage",
55
"@id": "{{ app.url ~ path('page::blog') }}#webpage",
6-
"url": "{{ app.url ~ path('page::blog') }}",
76
"name": "Blog",
87
"description": "Latest articles from the Dotkernel blog.",
8+
"url": "{{ app.url ~ path('page::blog') }}",
9+
"numberOfItems": {{ data.items|length }},
910
"isPartOf": { "@id": "{{ app.url }}#website" },
10-
"mainEntity": {
11-
"@type": "ItemList",
12-
"itemListElement": [
13-
{% for article in data.items %}{% if not loop.first %},{% endif %}
14-
{
15-
"@type": "ListItem",
16-
"position": {{ loop.index }},
11+
"itemListElement": [
12+
{% for article in data.items %}{% if not loop.first %},{% endif %}
13+
{
14+
"@type": "ListItem",
15+
"position": {{ loop.index }},
16+
"item": {
17+
"@type": "BlogPosting",
1718
"url": "{{ app.url ~ path('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}",
18-
"name": "{{ article.title }}"
19+
"headline": "{{ article.title }}",
20+
"author": {
21+
"@type": "Person",
22+
"name": "{{ article.author.name }}"
23+
}
1924
}
20-
{% endfor %}
21-
]
22-
}
25+
}
26+
{% endfor %}
27+
]
2328
}
2429
</script>

src/Blog/templates/page/JSON-LD/categories.jsonld.twig

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@
33
"@context": "https://schema.org",
44
"@type": "CollectionPage",
55
"@id": "{{ app.url ~ path('page::categories') }}#webpage",
6-
"url": "{{ app.url ~ path('page::categories') }}",
76
"name": "Categories",
87
"description": "Browse Dotkernel blog posts by category.",
8+
"url": "{{ app.url ~ path('page::categories') }}",
9+
"numberOfItems": {{ categories|length }},
910
"isPartOf": { "@id": "{{ app.url }}#website" },
10-
"mainEntity": {
11-
"@type": "ItemList",
12-
"itemListElement": [
13-
{% for category in categories %}{% if not loop.first %},{% endif %}
14-
{
15-
"@type": "ListItem",
16-
"position": {{ loop.index }},
11+
"itemListElement": [
12+
{% for category in categories %}{% if not loop.first %},{% endif %}
13+
{
14+
"@type": "ListItem",
15+
"position": {{ loop.index }},
16+
"item": {
17+
"@type": "CollectionPage",
1718
"url": "{{ app.url ~ path('page::category-resource', {slug: category.slug}) }}",
1819
"name": "{{ category.name }}"
1920
}
20-
{% endfor %}
21-
]
22-
}
21+
}
22+
{% endfor %}
23+
]
2324
}
2425
</script>

src/Blog/templates/page/JSON-LD/category-resource.jsonld.twig

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,28 @@
33
"@context": "https://schema.org",
44
"@type": "CollectionPage",
55
"@id": "{{ app.url ~ path('page::category-resource', {slug: category.slug}) }}#webpage",
6-
"url": "{{ app.url ~ path('page::category-resource', {slug: category.slug}) }}",
76
"name": "{{ category.name }}",
7+
"description": "Blog posts from the '{{ category.name }}' category.",
8+
"url": "{{ app.url ~ path('page::category-resource', {slug: category.slug}) }}",
89
"isPartOf": { "@id": "{{ app.url }}#website" },
910
"mainEntity": {
1011
"@type": "ItemList",
12+
"name": "Posts in '{{ category.name }}'",
13+
"numberOfItems": {{ data.items|length }},
1114
"itemListElement": [
1215
{% for article in data.items %}{% if not loop.first %},{% endif %}
1316
{
1417
"@type": "ListItem",
1518
"position": {{ loop.index }},
16-
"url": "{{ app.url ~ path('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}",
17-
"name": "{{ article.title }}"
19+
"item": {
20+
"@type": "BlogPosting",
21+
"url": "{{ app.url ~ path('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}",
22+
"heading": "{{ article.title }}",
23+
"author": {
24+
"@type": "Person",
25+
"name": "{{ article.author.name }}"
26+
}
27+
}
1828
}
1929
{% endfor %}
2030
]

src/Blog/templates/page/JSON-LD/tag-resource.jsonld.twig

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,27 @@
33
"@context": "https://schema.org",
44
"@type": "CollectionPage",
55
"@id": "{{ app.url ~ path('page::tag-resource', {slug: tag.slug}) }}#webpage",
6-
"url": "{{ app.url ~ path('page::tag-resource', {slug: tag.slug}) }}",
76
"name": "{{ tag.name }}",
7+
"description": "Blog posts that contain the '{{ category.name }}' tag.",
8+
"url": "{{ app.url ~ path('page::tag-resource', {slug: tag.slug}) }}",
9+
"numberOfItems": {{ data.items|length }},
810
"isPartOf": { "@id": "{{ app.url }}#website" },
9-
"mainEntity": {
10-
"@type": "ItemList",
11-
"itemListElement": [
12-
{% for article in data.items %}{% if not loop.first %},{% endif %}
13-
{
14-
"@type": "ListItem",
15-
"position": {{ loop.index }},
11+
"itemListElement": [
12+
{% for article in data.items %}{% if not loop.first %},{% endif %}
13+
{
14+
"@type": "ListItem",
15+
"position": {{ loop.index }},
16+
"item": {
17+
"@type": "BlogPosting",
1618
"url": "{{ app.url ~ path('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}",
17-
"name": "{{ article.title }}"
19+
"headline": "{{ article.title }}",
20+
"author": {
21+
"@type": "Person",
22+
"name": "{{ article.author.name }}"
23+
}
1824
}
19-
{% endfor %}
20-
]
21-
}
25+
}
26+
{% endfor %}
27+
]
2228
}
2329
</script>

0 commit comments

Comments
 (0)