Don't show word count if there isn't one
This mostly covers spotify pages, which use a custom reading time but don't have words.
This commit is contained in:
parent
71f74251bb
commit
c7e56ab038
2 changed files with 7 additions and 1 deletions
|
@ -15,7 +15,9 @@
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<div class="tags has-addons">
|
<div class="tags has-addons">
|
||||||
<span class="tag is-dark"><i class="far fa-clock"></i></span>
|
<span class="tag is-dark"><i class="far fa-clock"></i></span>
|
||||||
<span class="tag is-light" title="{{ page.word_count }} words">{{ page.reading_time|naturaldelta }}</span>
|
<span class="tag is-light" {% if page.word_count %}title="{{ page.word_count }} words"{% endif %}>
|
||||||
|
{{ page.reading_time|naturaldelta }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -48,6 +48,10 @@ class SpotifyPlaylistPage(BaseContentPage):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def word_count(self) -> int:
|
||||||
|
return 0
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def subtitle(self) -> str:
|
def subtitle(self) -> str:
|
||||||
return self.playlist_data["description"]
|
return self.playlist_data["description"]
|
||||||
|
|
Loading…
Reference in a new issue