Blogger Enclosure Links

For a site that I’m working on, I needed access to Blogger’s enclosure links from the template.
After quite a bit of searching through Blogger’s official documentation and other sources, I was unable to find anything useful at all.

I guess this is an undocumented feature.

Fortunately, Blogger’s layout data tags are quite logical, and it only took a few minutes of playing around before I stumbled upon the correct tag names.

I was able to add the following code to my site to access Blogger’s enclosure links in my layout.

<b:if cond='data:post.enclosures'>
	<audio>
		<b:loop values='data:post.enclosures' var='i'>
			<source expr:src='data:i.url' expr:type='data:i.mimeType'/>
		</b:loop>
	</audio>
</b:if>

Using this, I can include multiple formats in my enclosures, and the browser will select the best format. Unless the browser is Internet Explorer…

Hopefully, Blogger In Draft will get around to supporting enclosure links as well.