Merge pull request #3261 from bSolt/book-series-3256

Add book series by title in feed posts
This commit is contained in:
Bart Schuurmans 2024-03-23 20:01:03 +01:00 committed by GitHub
commit caebebeb37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 34 additions and 3 deletions

View file

@ -45,18 +45,22 @@
{% endif %}
{% if book.series %}
<meta itemprop="position" content="{{ book.series_number }}">
{% spaceless %}
<span itemprop="isPartOf" itemscope itemtype="https://schema.org/BookSeries">
{% if book.authors.exists %}
<a href="{% url 'book-series-by' book.authors.first.id %}?series_name={{ book.series | urlencode }}"
itemprop="url">
{% endif %}
<span itemprop="name">{{ book.series }}</span>
{% if book.series_number %} #{{ book.series_number }}{% endif %}
{% if book.authors.exists %}
</a>
{% endif %}
</span>
{% if book.series_number %}
<span>, #</span>
<span itemprop="position">{{ book.series_number }}</span>
{% endif %}
{% endspaceless %}
{% endif %}
</p>
{% endif %}

View file

@ -0,0 +1,3 @@
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}

View file

@ -9,12 +9,15 @@
{% if book.authors.exists %}
{% blocktrans trimmed with path=book.local_path title=book|book_title %}
<a href="{{ path }}">{{ title }}</a> by
<a href="{{ path }}">{{ title }}</a>
by
{% endblocktrans %}&nbsp;{% include 'snippets/authors.html' with book=book limit=3 %}
{% else %}
<a href="{{ book.local_path }}">{{ book|book_title }}</a>
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endcache %}
{% endspaceless %}

View file

@ -17,4 +17,7 @@ commented on <a href="{{ book_path }}">{{ book }}</a>
{% endblocktrans %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endwith %}

View file

@ -17,4 +17,7 @@ quoted <a href="{{ book_path }}">{{ book }}</a>
{% endblocktrans %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endwith %}

View file

@ -19,4 +19,7 @@ finished reading <a href="{{ book_path }}">{{ book }}</a>
{% endblocktrans %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endspaceless %}

View file

@ -19,4 +19,7 @@ started reading <a href="{{ book_path }}">{{ book }}</a>
{% endblocktrans %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endspaceless %}

View file

@ -17,4 +17,7 @@ reviewed <a href="{{ book_path }}">{{ book }}</a>
{% endblocktrans %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endwith %}

View file

@ -19,5 +19,8 @@ stopped reading <a href="{{ book_path }}">{{ book }}</a>
{% endblocktrans %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endspaceless %}

View file

@ -19,4 +19,7 @@ wants to read <a href="{{ book_path }}">{{ book }}</a>
{% endblocktrans %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endspaceless %}