RSS feed syntax

Galen King's Avatar

Galen King

29 Nov, 2010 08:43 AM via web

Hi guys,

I can't for the life of me get my feeds to validate.

Any suggestions on how to clean up content so non-breaking spaces, normal ampersands (&) etc don't break the validator?

Cheers,

Galen

  1. 2 Posted by John Nunemaker on 29 Nov, 2010 03:33 PM

    John Nunemaker's Avatar

    Here is the template we use:

    <?xml version="1.0" encoding="utf-8"?>
    <feed xmlns="http://www.w3.org/2005/Atom">
      <title>{{ site.title }} by John Nunemaker</title>
      <link href="{{ blog.feed.url }}" rel="self" />
      <link href="{{ blog.url }}" />
      <id>{{ blog.url }}</id>
      <updated>{{ blog.last_updated_at | isodate }}</updated>
    
      {% for post in blog.recent_posts.15 %}
        <entry>
          <title>{{ post.title | h }}</title>
          <link href="{{ post.url }}" />
          <id>{{ post.url }}</id>
          <updated>{{ post.updated_at | isodate }}</updated>
          <published>{{ post.published_at | isodate }}</published>
          {% for label in post.labels %}<category term="{{ label }}"/>{% endfor %}
          <summary type="html">{{ post.data.excerpt | h }}</summary>
          <content type="html">{{ post.data.body | h }}</content>
          <author>
            <name>{{ post.creator.name | h }}</name>
          </author>
        </entry>
      {% endfor %}
    </feed>
    

    http://pastie.org/private/itpqozg7qr1nffqsakslg

    That seems to validate with the exception of object tags here and there.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

17 May, 2012 10:45 PM
20 Mar, 2012 05:05 PM
26 Apr, 2012 01:40 AM
07 Mar, 2012 04:42 PM