Skip to content

Commit

Permalink
Merge pull request #3 from ASergej/master
Browse files Browse the repository at this point in the history
breadcrumbs structured data in JSON-LD
  • Loading branch information
vgaicuks committed Jan 28, 2020
2 parents 8a2ef4d + bae1816 commit 14e455c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup

setup(name='django-sitemenu',
version='0.1.0',
version='0.1.1',
description='Nested menu for django projects.',
long_description='Nested menu for django projects. Without MPTT and with drag\'n\'drop sorting.'
'Easy customizable. Looks like simple model for using.',
Expand Down
19 changes: 19 additions & 0 deletions sitemenu/templates/sitemenu/_structured_breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% load sitemenu %}
{% if breadcrumbs and breadcrumbs.count > 1 %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{% for breadcrumb in breadcrumbs %}
{
"@type": "ListItem",
"position": {{ forloop.counter }},
"name": "{{ breadcrumb.title }}",
"item": "{{ request.scheme}}://{{request.get_host }}{{ breadcrumb.get_absolute_url }}"
}{% if not forloop.last %},{% endif %}
{% endfor %}
]
}
</script>
{% endif %}

0 comments on commit 14e455c

Please sign in to comment.