feat: display word count when hovering over read time

This commit is contained in:
welpo 2023-02-21 02:43:23 +01:00
parent 23f5c6d309
commit d9cd64e5a4
No known key found for this signature in database
GPG Key ID: A2F978CF4EC1F5A6
2 changed files with 9 additions and 1 deletions

View File

@ -119,3 +119,11 @@ table td {
table tbody tr:nth-child(even) {
background-color: var(--bg-0);
}
.meta span:hover::before {
content: attr(word-count);
}
.meta span::before {
content: attr(reading-time);
}

View File

@ -119,7 +119,7 @@
{% endif %}
<span> {{ page.reading_time }} minute read{% if page.taxonomies and page.taxonomies.tags %}&nbsp;{%
<span reading-time="{{ page.reading_time }} min read" word-count="{{ page.word_count }} words">{% if page.taxonomies and page.taxonomies.tags %}&nbsp;{%
endif %}</span>
{% if page.taxonomies and page.taxonomies.tags %}