Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

Provide a sample Atom feed #79

Open
aprescott opened this issue Apr 30, 2014 · 0 comments
Open

Provide a sample Atom feed #79

aprescott opened this issue Apr 30, 2014 · 0 comments

Comments

@aprescott
Copy link
Owner

The following would be useful in a feed.xml.sample provided by serif new.

layout: none

<?xml version="1.0" encoding="utf-8"?>

{% assign feed_url = "http://example.com/feed" %}
{% assign feed_title = "Example Feed" %}
{% assign feed_alternate = "http://example.com/blog" %}
{% assign feed_global_unique_id = "tag:example.com,2013:TOTALLY-RANDOM-STRING-OF-CHARACTERS-GOES-HERE" %}

{% assign feed_author_name = "J. Smith" %}
{% assign feed_author_url = "http://example.com/about" %}

{% assign feed_entry_tag_domain = "example.com" %}

<feed xmlns="http://www.w3.org/2005/Atom">
    <title>{{ feed_title }}</title>
    <link rel="self" type="application/atom+xml" href="{{ feed_url }}"/>
    <link rel="alternate" type="text/html" href="{{ feed_alternate }}"/>
    <id>{{ feed_global_unique_id }}</id>
    <updated>{{ site.latest_update_time | xmlschema }}</updated>
    <author>
        <name>{{ feed_author_name }}</name>
        <uri>{{ feed_author_url }}</uri>
    </author>
    {% for post in site.posts limit:10 %}
    <entry>
        <id>tag:{{ feed_entry_tag_domain }},{{ post.created | date: "%Y-%m-%d" }}:{{ post.created | date: "%s" }}</id>
        <title type="html">{{ post.title | smarty | replace:"&","&amp;" | replace:"<","&lt;" | replace:">","&gt;" }}</title>
        <updated>{{ post.updated | xmlschema }}</updated>
        <published>{{ post.created | xmlschema }}</published>
        <link href="{{ post.url }}" rel="alternate" type="text/html"/>
        <content type="html">{{ post.content | markdown | escape }}</content>
    </entry>
    {% endfor %}
</feed>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant