forked from mirrors/bookwyrm
Add microformats to author page
This commit is contained in:
parent
6e9c9e839c
commit
55a3a28d49
1 changed files with 25 additions and 8 deletions
|
@ -22,42 +22,59 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="block content columns">
|
<div class="block content columns" itemscope itemtype="https://schema.org/Person">
|
||||||
{% if author.aliases or author.born or author.died or author.wikipedia_link %}
|
<meta itemprop="name" content="{{ author.name }}">
|
||||||
|
|
||||||
|
{% if author.aliases or author.born or author.died or author.wikipedia_link or author.openlibrary_key or author.inventaire_id %}
|
||||||
<div class="column is-narrow">
|
<div class="column is-narrow">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<dl>
|
<dl>
|
||||||
{% if author.aliases %}
|
{% if author.aliases %}
|
||||||
<div class="is-flex">
|
<div class="is-flex">
|
||||||
<dt class="mr-1">{% trans "Aliases:" %}</dt>
|
<dt class="mr-1">{% trans "Aliases:" %}</dt>
|
||||||
<dd itemprop="aliases">{{ author.aliases|join:', ' }}</dd>
|
<dd>
|
||||||
|
{% for alias in author.aliases %}
|
||||||
|
<span itemprop="alternateName">{{alias}}</span>{% if not forloop.last %},{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if author.born %}
|
{% if author.born %}
|
||||||
<div class="is-flex">
|
<div class="is-flex">
|
||||||
<dt class="mr-1">{% trans "Born:" %}</dt>
|
<dt class="mr-1">{% trans "Born:" %}</dt>
|
||||||
<dd itemprop="aliases">{{ author.born|naturalday }}</dd>
|
<dd itemprop="birthDate">{{ author.born|naturalday }}</dd>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if author.died %}
|
{% if author.died %}
|
||||||
<div class="is-flex">
|
<div class="is-flex">
|
||||||
<dt class="mr-1">{% trans "Died:" %}</dt>
|
<dt class="mr-1">{% trans "Died:" %}</dt>
|
||||||
<dd itemprop="aliases">{{ author.died|naturalday }}</dd>
|
<dd itemprop="deathDate">{{ author.died|naturalday }}</dd>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
{% if author.wikipedia_link %}
|
{% if author.wikipedia_link %}
|
||||||
<p><a href="{{ author.wikipedia_link }}" rel=”noopener” target="_blank">{% trans "Wikipedia" %}</a></p>
|
<p>
|
||||||
|
<link itemprop="sameAs" href="{{ author.wikipedia_link }}" />
|
||||||
|
<a href="{{ author.wikipedia_link }}" rel=”noopener” target="_blank">
|
||||||
|
{% trans "Wikipedia" %}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if author.openlibrary_key %}
|
{% if author.openlibrary_key %}
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
<a href="https://openlibrary.org/authors/{{ author.openlibrary_key }}" target="_blank" rel="noopener">{% trans "View on OpenLibrary" %}</a>
|
<link itemprop="sameAs" href="https://openlibrary.org/authors/{{ author.openlibrary_key }}" />
|
||||||
|
<a href="https://openlibrary.org/authors/{{ author.openlibrary_key }}" target="_blank" rel="noopener">
|
||||||
|
{% trans "View on OpenLibrary" %}
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if author.inventaire_id %}
|
{% if author.inventaire_id %}
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
<a href="https://inventaire.io/entity/{{ author.inventaire_id }}" target="_blank" rel="noopener">{% trans "View on Inventaire" %}</a>
|
<link itemprop="sameAs" href="https://inventaire.io/entity/{{ author.inventaire_id }}" />
|
||||||
|
<a href="https://inventaire.io/entity/{{ author.inventaire_id }}" target="_blank" rel="noopener">
|
||||||
|
{% trans "View on Inventaire" %}
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue