Skip to content

Commit e34bb84

Browse files
committed
Add datePublished/dateModified to BlogPosting schema and BreadcrumbList JSON-LD
1 parent cd72d13 commit e34bb84

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docs/overrides/main.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"headline": {{ page.title | tojson }},
1212
"description": {{ description | tojson }},
1313
"url": {{ page.canonical_url | tojson }},
14+
{% if page.meta.git_creation_date_localized_raw_iso_date %}
15+
"datePublished": {{ page.meta.git_creation_date_localized_raw_iso_date | tojson }},
16+
{% endif %}
17+
{% if page.meta.git_revision_date_localized_raw_iso_date %}
18+
"dateModified": {{ page.meta.git_revision_date_localized_raw_iso_date | tojson }},
19+
{% endif %}
1420
"author": {
1521
"@type": "Person",
1622
"name": "Will Dean",
@@ -19,6 +25,33 @@
1925
}
2026
</script>
2127
{% endif %}
28+
{% if not page.is_homepage and page.title %}
29+
<script type="application/ld+json">
30+
{
31+
"@context": "https://schema.org",
32+
"@type": "BreadcrumbList",
33+
"itemListElement": [
34+
{
35+
"@type": "ListItem",
36+
"position": 1,
37+
"name": {{ config.site_name | tojson }},
38+
"item": {{ config.site_url | tojson }}
39+
},{% if "blog/posts/" in page.url %}
40+
{
41+
"@type": "ListItem",
42+
"position": 2,
43+
"name": "Blog",
44+
"item": {{ (config.site_url + "blog/") | tojson }}
45+
},
46+
{% endif %}{
47+
"@type": "ListItem",
48+
"position": {% if "blog/posts/" in page.url %}3{% else %}2{% endif %},
49+
"name": {{ page.title | tojson }}
50+
}
51+
]
52+
}
53+
</script>
54+
{% endif %}
2255
<script type="application/ld+json">
2356
{
2457
"@context": "https://schema.org",

0 commit comments

Comments
 (0)