Skip to content

Commit 02cf6b0

Browse files
committed
Fix json-ld
1 parent 1657ad2 commit 02cf6b0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pytorch_sphinx_theme2/templates/layout.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@
191191
<script type="application/ld+json">
192192
{
193193
"@context": "https://schema.org",
194-
"@type": "Article",
195-
"headline": "{{ title|striptags }}",
194+
"@type": "TechArticle",
195+
"name": {{ title|striptags|trim|tojson }},
196+
"headline": {{ title|striptags|trim|tojson }},
196197
"description": "PyTorch Documentation. Explore PyTorch, an open-source machine learning library that accelerates the path from research prototyping to production deployment. Discover tutorials, API references, and guides to help you build and deploy deep learning models efficiently.",
197198
"url": "{{ canonical_url|default((url_root if url_root is defined else '/') + pagename + '.html', true) }}",
198199
"author": {
@@ -205,9 +206,8 @@
205206
"@type": "WebPage",
206207
"@id": "{{ canonical_url|default((url_root if url_root is defined else '/') + pagename + '.html', true) }}"
207208
},
208-
"datePublished": "{{ doc_created|default('') }}{% if doc_created %}T00:00:00Z{% endif %}",
209-
"dateModified": "{{ doc_updated|default('') }}{% if doc_updated %}T00:00:00Z{% endif %}",
210-
"articleBody": "{{ (body|striptags|truncate(3000, true))|replace('\\', '\\\\')|replace('"', '\\"')|e }}"
209+
"datePublished": "{{ doc_created|default('') }}{% if doc_created %}T00:00:00Z{% endif %}",
210+
"dateModified": "{{ doc_updated|default('') }}{% if doc_updated %}T00:00:00Z{% endif %}"
211211
}
212212
</script>
213213
{% endblock %}

0 commit comments

Comments
 (0)