Skip to content

davidagee/liquid_time_ago_in_words

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Liquid time_ago_in_words

A rails-style time_ago_in_words filter for the liquid templating language. Intended for use for people who use liquid without rails (e.g. a Jekyll or Octopress blog). If you're using liquid with rails, you don't need this!

The code is based on Klaus Byskov Hoffmann's language-agnostic version.

Installation

In your plugins directory:

curl -L -O https://github.com/stephenalexbrowne/liquid_time_ago_in_words/raw/master/time_ago_in_words.rb

or

wget https://github.com/stephenalexbrowne/liquid_time_ago_in_words/raw/master/time_ago_in_words.rb

Don't forget to restart your server!

Usage

It works like any other filter:

{{ page.date | time_ago_in_words }}

The output looks like 14 minutes ago or about a day ago or etc.

About

A rails-style time_ago_in_words filter for the liquid templating language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published