This is a Liquid Filter that will display a rating as a series of nought to five star images. It was originally developed for use with Jekyll and therefore the following instructions relate to that.
star_rating.filter.rb
to your _plugins
directory.images
to your images
directory.If you want to put the images in an alternative directory then you will need to alter Star_imagesLoc
in star_rating.filter.rb
to point to the correct location.
If you had a variable such as page.rating
then you could put {{ page.rating|star_rating }}
in your text
and the relevant number of images would be displayed.
To see this working run jekyll --server
in the root directory of this repository and point your browser to
http://localhost:4000
Copyright (c) 2011, Lawrence Woodman
This software is licensed under an MIT License. Please see the file, LICENSE.md, for details.
The images are alterations from originals at stackoverflow and are licensed under the Creative Commons Attribution-ShareAlike 2.5 Generic License.