-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patharticle5.xml
62 lines (62 loc) · 2.92 KB
/
article5.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<article data-sblg-article="1" data-sblg-tags="howto">
<header>
<h2>How do I generate a system release Atom feed?</h2>
<div>Posted by <address>Kristaps Dzonsons</address> on <time datetime="2014-08-14">14 August, 2014</time></div>
</header>
<aside>Tips and tricks for using sblg: articles inlined into blogs and atom feeds.</aside>
<p>
I use <span class="name">sblg</span> 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.
</p>
<p>
Let's start with the Atom feed.
First, I stipulate that no <q>alternate</q> 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.
</p>
<pre class="prettyprint lang-xml"><?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></pre>
<p>
Alternatively, I might omit the <code>data-sblg-content</code> attribute and have it print only the <code class="prettyprint
lang-html"><aside></code> content within the entry, which is the default.
This is a matter of choice: the <code>data-sblg-content</code> 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 <code class="prettyprint">ARTICLES</code> variable in my Makefile, and build an <code
class="prettyprint">atom.xml</code> that depends on these files.
</p>
<p class="code">
<code>ARTICLES = article1.xml article2.xml</code>
<code>atom.xml: $(ARTICLES)</code>
<code class="tab">sblg -a -o $@ $(ARTICLES)</code>
</p>
<p>
Articles (fragments, really) are written as specified in <a href="sblg.1.html">sblg(1)</a>.
</p>
<pre class="prettyprint lang-html"><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></pre>
<p>
Finally, I have the blog template note a selection of recent entries and prohibit the permanent link.
</p>
<pre class="prettyprint lang-html"><article data-sblg-article="1" data-sblg-permlink="0"></article></pre>
<p>
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 <a href="sblg.1.html">sblg(1)</a>.
</p>
</article>