2021-04-09 17:57:49 -04:00
|
|
|
|
{% spaceless %}
|
|
|
|
|
|
2021-03-29 13:21:48 -04:00
|
|
|
|
{% load i18n %}
|
2021-04-19 19:30:15 -04:00
|
|
|
|
{% load humanize %}
|
2021-04-09 17:57:49 -04:00
|
|
|
|
|
2021-10-15 16:59:07 -04:00
|
|
|
|
{% firstof book.physical_format_detail book.get_physical_format_display as format %}
|
2021-10-01 13:08:56 -04:00
|
|
|
|
{% firstof book.physical_format book.physical_format_detail as format_property %}
|
|
|
|
|
{% with pages=book.pages %}
|
|
|
|
|
{% if format or pages %}
|
2021-04-09 17:57:49 -04:00
|
|
|
|
|
2021-10-01 13:22:30 -04:00
|
|
|
|
{% if format_property %}
|
|
|
|
|
<meta itemprop="bookFormat" content="{{ format_property }}">
|
|
|
|
|
{% endif %}
|
2021-04-09 17:57:49 -04:00
|
|
|
|
|
2021-10-01 13:22:30 -04:00
|
|
|
|
{% if pages %}
|
|
|
|
|
<meta itemprop="numberOfPages" content="{{ pages }}">
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
<p>
|
2021-10-01 13:08:56 -04:00
|
|
|
|
{% if format and not pages %}
|
2021-10-15 16:59:07 -04:00
|
|
|
|
{{ format }}
|
2021-10-01 13:08:56 -04:00
|
|
|
|
{% elif format and pages %}
|
|
|
|
|
{% blocktrans %}{{ format }}, {{ pages }} pages{% endblocktrans %}
|
|
|
|
|
{% elif pages %}
|
|
|
|
|
{% blocktrans %}{{ pages }} pages{% endblocktrans %}
|
|
|
|
|
{% endif %}
|
2021-03-29 13:21:48 -04:00
|
|
|
|
</p>
|
2021-10-01 13:08:56 -04:00
|
|
|
|
{% endif %}
|
|
|
|
|
{% endwith %}
|
2021-04-09 17:57:49 -04:00
|
|
|
|
|
2021-03-29 13:21:48 -04:00
|
|
|
|
{% if book.languages %}
|
2021-04-09 17:57:49 -04:00
|
|
|
|
{% for language in book.languages %}
|
|
|
|
|
<meta itemprop="inLanguage" content="{{ language }}">
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
{% with languages=book.languages|join:", " %}
|
|
|
|
|
{% blocktrans %}{{ languages }} language{% endblocktrans %}
|
|
|
|
|
{% endwith %}
|
|
|
|
|
</p>
|
2021-03-29 13:21:48 -04:00
|
|
|
|
{% endif %}
|
2021-04-09 17:57:49 -04:00
|
|
|
|
|
2021-10-01 13:08:56 -04:00
|
|
|
|
{% with date=book.published_date|naturalday publisher=book.publishers|join:', ' %}
|
|
|
|
|
{% if date or book.first_published_date or book.publishers %}
|
2021-10-01 13:22:30 -04:00
|
|
|
|
{% if date or book.first_published_date %}
|
|
|
|
|
<meta
|
|
|
|
|
itemprop="datePublished"
|
|
|
|
|
content="{{ book.first_published_date|default:book.published_date|date:'Y-m-d' }}"
|
|
|
|
|
>
|
|
|
|
|
{% endif %}
|
2021-03-29 13:21:48 -04:00
|
|
|
|
<p>
|
2021-04-09 17:57:49 -04:00
|
|
|
|
|
2021-10-01 13:08:56 -04:00
|
|
|
|
{% comment %}
|
|
|
|
|
@todo The publisher property needs to be an Organization or a Person. We’ll be using Thing which is the more generic ancestor.
|
|
|
|
|
@see https://schema.org/Publisher
|
|
|
|
|
{% endcomment %}
|
|
|
|
|
{% if book.publishers %}
|
|
|
|
|
{% for publisher in book.publishers %}
|
|
|
|
|
<meta itemprop="publisher" content="{{ publisher }}">
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% endif %}
|
2021-04-09 17:57:49 -04:00
|
|
|
|
|
2021-10-01 13:08:56 -04:00
|
|
|
|
{% if date and publisher %}
|
|
|
|
|
{% blocktrans %}Published {{ date }} by {{ publisher }}.{% endblocktrans %}
|
|
|
|
|
{% elif date %}
|
|
|
|
|
{% blocktrans %}Published {{ date }}{% endblocktrans %}
|
|
|
|
|
{% elif publisher %}
|
|
|
|
|
{% blocktrans %}Published by {{ publisher }}.{% endblocktrans %}
|
|
|
|
|
{% endif %}
|
2021-03-29 13:21:48 -04:00
|
|
|
|
</p>
|
2021-10-01 13:08:56 -04:00
|
|
|
|
{% endif %}
|
|
|
|
|
{% endwith %}
|
2021-04-09 17:57:49 -04:00
|
|
|
|
{% endspaceless %}
|