A Liquid Filter to display the domain name of a url. Originally designed for use with...
Ruby
Latest commit 30c0283 Apr 15, 2013 @amaslenn amaslenn Extra '?' in regexp
Failed to load latest commit information.
_plugins Extra '?' in regexp Apr 15, 2013
test Extended to support https and ftp Apr 11, 2013
.gitignore Add unit test Mar 11, 2011
LICENSE.md Import project into repo Mar 10, 2011
README.md Move filter source into _plugins/ Apr 2, 2011

README.md

domain_name

This is a Liquid Filter that will display the domain name of a URL.

Installation

This was originally developed for use with Jekyll, to register it as a plugin, copy _plugins/domain_name.filter.rb to your _plugins directory.

How to use it

If you had a variable such as page.url then you could put {{ page.url|domain_name }} in your text and it would strip any http:// part and the path from the url, leaving you just the domain name.

License

Copyright (c) 2011, Lawrence Woodman
This software is licensed under an MIT License. Please see the file, LICENSE.md, for details.