Giter Club home page Giter Club logo

jekyll-posts-word-count's Introduction

Jekyll-Posts-Word-Count

Jekyll plugin to give you the total / average word count, as well as shortest & longest post information across all posts.

By Matt Gemmell / Jake Lee, license: CC0 Universal (public domain)

Installation

To install, copy the posts-word-count.rb file into your Jekyll _plugins folder.

Usage

For only published posts: {% published_posts_word_count PARAM %}

For published & draft posts {% posts_word_count PARAM %}

Where PARAM is one of:

  • total (total word count of all posts)
  • average (average word count across all posts)
  • total_characters (total character count of all posts)
  • average_characters (total average count of all posts)
  • longest (longest word count of any post)
  • longest_post_index (index in site.posts of longest post)
  • longest_post_title (title of longest post)
  • longest_post_url (url of longest post)
  • shortest (shortest word count of any post)
  • shortest_post_index (index in site.posts of shortest post)
  • shortest_post_title (title of shortest post)
  • shortest_post_url (url of shortest post)

Example

For example, a page displaying overall stats and the shortest & longest posts could include:

### Totals

Total site words: {% posts_word_count total %} (average {% posts_word_count average %} per post)

Total site characters: {% posts_word_count total_characters %} (average {% posts_word_count average_characters %} per post)

### Published post records 

Longest post: <a href="{% published_posts_word_count longest_post_url %}">{% published_posts_word_count longest_post_title %}</a> ({% published_posts_word_count longest %} words)

Shortest post: <a href="{% published_posts_word_count shortest_post_url %}">{% published_posts_word_count shortest_post_title %}</a> ({% published_posts_word_count shortest %} words)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.