Merge pull request #508 from mstanleyjones/try_implementing_reading_time

Implement per-page reading-time stats
This commit is contained in:
Misty Stanley-Jones 2016-11-30 10:35:46 -08:00 committed by GitHub
commit 2c1cd1d565
3 changed files with 24 additions and 0 deletions

9
_includes/read_time.html Normal file
View File

@ -0,0 +1,9 @@
<span class="reading-time" title="Estimated reading time">
<span class="reading-time-label">Estimated reading time: </span>
{% assign words = content | number_of_words %}
{% if words < 360 %}
1 minute
{% else %}
{{ words | divided_by:180 }} minutes
{% endif %}
</span>

View File

@ -206,6 +206,7 @@ ng\:form {
<section class="section" id="DocumentationText">
{% if page.title %}<h1>{{ page.title }}</h1>{% endif %}
{% if page.advisory %}<blockquote><p><strong style="color:black">{{ site.data.advisories.texts[page.advisory] }}</strong></p></blockquote>{% endif %}
{% include read_time.html %}
{{ content }}
{% if page.noratings != true %}
<div style="text-align: center; margin-top: 50px">

View File

@ -346,3 +346,17 @@ color: #F04124;
}
/* end search */
/* begin reading_time */
span.reading-time {
font-style: italic;
font-size: 80%;
display: block;
padding-top: 10px;
padding-bottom: 10px;
color: #999;
}
span.reading-time-label {
}