Skip to content

Latest commit

 

History

History
62 lines (54 loc) · 2.42 KB

articles.md

File metadata and controls

62 lines (54 loc) · 2.42 KB
layout title excerpt description search_omit image
page
Articles
An archive of articles sorted by date.
An archive of articles sorted by date.
true
feature
mountain_road.jpg

{% assign getPosts = site.posts %} {% assign getLinkPosts = site.posts | where:"linkpost","true" %} {% assign getPages = site.pages | where:"layout","page" %}

{% assign postsCount = getPosts.size %} {% assign linkPostsCount = getLinkPosts.size %} {% assign articlesCount = postsCount | minus: linkPostsCount %} {% assign pagesCount = getPages.size %}

{% assign postsWordCount = 0 %} {% assign longestWordCount = 0 %} {% assign longestPost = none %} {% assign longestPostUrl = none %} {% for posts in getPosts %} {% assign postWordCount = posts.content | number_of_words %} {% assign postsWordCount = postsWordCount | plus:postWordCount %} {% if postWordCount > longestWordCount %} {% assign longestWordCount = postWordCount %} {% assign longestPost = posts.title %} {% assign longestPostUrl = posts.url %} {% endif %} {% endfor %}

{% assign averageWordCount = postsWordCount | divided_by:postsCount %}

This blog contains {{ postsCount }} posts and {{ pagesCount }} pages. Those {{ postsCount }} posts contain a total of {{ postsWordCount }} words. That's an average of {{ averageWordCount }} words per post. The longest post is "{{longestPost}}", it has a length of {{ longestWordCount }} words.

{% for post in site.posts %} {% assign currentdate = post.date | date: "%Y" %} {% if currentdate != date %} {% unless forloop.first %}{% endunless %}

{{ currentdate }}

{% endif %} {% endfor %}