diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c8ca10 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +_site/ +.sass-cache/ +.jekyll-cache/ +.jekyll-metadata +# Ignore folders generated by Bundler +.bundle/ +vendor/ \ No newline at end of file diff --git a/_includes/reading-time.html b/_includes/reading-time.html new file mode 100644 index 0000000..0aedf2e --- /dev/null +++ b/_includes/reading-time.html @@ -0,0 +1,6 @@ +{% capture words %} +{{ content | number_of_words | minus: 180 }} +{% endcapture %} +{% unless words contains '-' %} +{{ words | plus: 150 | divided_by: 150 | append: ' minutes to read' }} +{% endunless %} \ No newline at end of file diff --git a/_layouts/post.html b/_layouts/post.html index 57db5bc..0150144 100755 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -48,6 +48,10 @@

{{ page.title | escape }}

{{site.author.author__name}} +
+ + {% include reading-time.html %} +
diff --git a/_sass/4-layouts/_post.scss b/_sass/4-layouts/_post.scss index cd664e4..da5ca02 100644 --- a/_sass/4-layouts/_post.scss +++ b/_sass/4-layouts/_post.scss @@ -207,8 +207,17 @@ font-weight: 400; color: var(--text-alt-color); } + + .post__reading-time { + position: absolute; + width: 762px; + height: 252px; + font-size: 16px; + font-weight: 500; + } } + .post, .page { max-width: 760px;