Middleman feed.xml.builder issues with iTunes tags

199 views Asked by At

I need to be able to include iTunes style XML tags in my feed.

I see that you can make custom tags with xml.<WHATEVER> but what I need is support for : tags like in a podcast feed. middleman build pukes when you try something like xml.itunes:summary and xml.itunes_summary (like some gems use) doesn't convert to the : format.

Are these kinds of XML tags not supported or am I using the wrong syntax?

1

There are 1 answers

0
lyonsinbeta On BEST ANSWER

The nice Middlemanapp twitter account directed me to the Builder project which is the code actually doing the work.

If your goal is to get the namespaced, iTunes-y output like:

<itunes:summary>The best damn thing ever.</itunes:summary>

You can do it one of two recommended ways. I recommend the second way though because the first method adds a bunch of extra whitespace as noted in this issue on Github.

xml.itunes :summary { xml.text! "The best damn thing ever." }

or

xml.tag!("itunes:summary", "The best damn thing ever.")