Linking page in a folder to a parent taxonomy page in a different folder

I have 2 folders, songs and artists. My songs have a tax tag ‘artists’ and every song by an artist is tagged with that. On my artist page I have a page collection with all pages tagged with that artist. My question is, how do i link back to the artist page from the song page? I was thinking something simple like this:

<p><a href="/somebrothers/artists/{{ page.taxonomy.artist }}">Artist Home</a></p>

But that only works if the tax name is the same as the slug of the artist, and it doesn’t work anyway it throws an error.


Ok so this works:

    <a href="/somebrothers/artists/{{ tag }}">{{ tag }}</a>
{% endfor %}

But ONLY if the tag is the same as the artist slug - is there a way to ‘slugify’ a tax tag - currently my tag is ‘Foo Fighters’ - I need that turned into ‘foo-fighters’ and it will work.


Yes, use the hyphenize filter