Skip to content

Commit

Permalink
✨ feat: display word count when hovering over read time
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Feb 21, 2023
1 parent 23f5c6d commit d9cd64e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions sass/parts/_misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion templates/macros/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit d9cd64e

Please sign in to comment.