Add length to book pages

This commit is contained in:
HackerNCoder 2024-09-18 17:56:37 +02:00
parent 34810c5ad9
commit 93e5fe92dc
3 changed files with 7 additions and 0 deletions

View file

@ -7,3 +7,5 @@ https://www.marxists.org/archive/kollonta/1921/prostitution.htm
---
epub:
prostitution-and-ways-of-fighting-it.epub
---
length: short

View file

@ -22,6 +22,10 @@ type = string
label = Publication date
type = string
[fields.length]
label = How long the text is
type = string
[fields.epub]
label = epub file name
type = string

View file

@ -14,6 +14,7 @@
{% if this.subtitle %}<p class="subtitle">{{ this.subtitle }}</p>{% endif %}
{% if this.author %}<p>{{ this.author }}</p>{% endif %}
<p class="italics">{% if this.publisher %}{{ this.publisher }}, {% endif %}{{ this.pub_date }}</p>
{% if this.length %}<p>Length: {{ this.length }}</p>{% endif %}
<div class="mt-2">
{% if this.epub %}<p>Download EPUB:</p><p><a href="/lib/epub/{{ this.epub }}">From Comrades Library</a></p>{% endif %}
{% if this.external %}{% for item in this.external %}<p><a href="{{ item }}">From {{ item.split('://')[1].split('/')[0] }}</a></p>{% endfor %}{% endif %}