I'm wondering if there is a liquid filter that would limit a url to the domain name only.
For example, let's say I wanted to have a link to an article called "The Greatest Article Ever" and the url was something unwieldily like http://example.com/long/ugly/directory/123948/name. Let's also say I had both of these values in my YAML metadata in an array as "title:" and "url:" respectively, and my desired output was something like this:
<div class="cool-articles">
<a href="http://example.com/long/ugly/directory/123948/name">
The Greatest Article Ever
</a>
<span>example.com</span>
</div>
How might I use liquid to limit the array-item.url to the domain name only?
I've been searching through the liquid docs for a nice filter to do it, but I've only found remove (which can nix the "http://") but nothing to just strip out everything but the domain name.
Anyone have any thoughts?
Thanks!