How do I generate a system release Atom feed?
I use sblg to track versions for several systems. A blog article, then, consists of release notes for a given version of the system. I usually just want to post the newest version or two on the website, and an Atom feed of the same.
Let's start with the Atom feed.
First, I stipulate that no alternate
links exist, because I don't want to have a separate file for each and every
version.
Second, I make the article contents be inlined in the feed.
<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>Example Feed</title> <link href="http://example.org/atom.xml" rel="self" /> <link href="http://example.org/" /> <id data-sblg-id="1" /> <updated data-sblg-updated="1" /> <entry data-sblg-forall="1" data-sblg-entry="1" data-sblg-content="1" data-sblg-altlink="0" /> </feed>
Alternatively, I might omit the data-sblg-content
attribute and have it print only the <aside>
content within the entry, which is the default.
This is a matter of choice: the data-sblg-content
attribute will make the entire article (including the header) be
included in the feed.
It's up to you.
I then add articles (raw XML) to an ARTICLES
variable in my Makefile, and build an atom.xml
that depends on these files.
ARTICLES = article1.xml article2.xml
atom.xml: $(ARTICLES)
sblg -a -o $@ $(ARTICLES)
Articles (fragments, really) are written as specified in sblg(1).
<article data-sblg-article="1"> <header> <h3>Version 0.0.10</h3> <time datetime="2013-07-09">09/07/2013</time> <address>Kristaps Dzonsons</address> </header> <p> Release notes here. </p> </article>
Finally, I have the blog template note a selection of recent entries and prohibit the permanent link.
<article data-sblg-article="1" data-sblg-permlink="0"></article>
That's it! Now all I need to do is make some release notes and add the release to my Makefile. The rest—feed, list of recent releases—is auto-generated by sblg(1).