forked from kristapsdz/sblg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
article5.xml
68 lines (68 loc) · 3.8 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
63
64
65
66
67
68
<article data-sblg-article="1" data-sblg-tags="howto">
<header>
<h2>Tips and Tricks: System Release Notes</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>
<p class="code">
<code class="prettyprint lang-html"><?xml version="1.0" encoding="utf-8"?></code>
<code class="prettyprint lang-html"><feed xmlns="http://www.w3.org/2005/Atom"></code>
<code class="prettyprint lang-html tab"><title>Example Feed</title></code>
<code class="prettyprint lang-html tab"><link href="http://example.org/atom.xml" rel="self" /></code>
<code class="prettyprint lang-html tab"><link href="http://example.org/" /></code>
<code class="prettyprint lang-html tab"><id data-sblg-id="1" /></code>
<code class="prettyprint lang-html tab"><updated data-sblg-updated="1" /></code>
<code class="prettyprint lang-html tab"><entry data-sblg-forall="1" data-sblg-entry="1" data-sblg-content="1" data-sblg-altlink="0" /></code>
<code class="prettyprint lang-html"></feed></code>
</p>
<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 class="prettyprint">ARTICLES = article1.xml article2.xml</code>
<code class="prettyprint">atom.xml: $(ARTICLES)</code>
<code class="prettyprint 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>
<p class="code">
<code class="prettyprint lang-html"><article data-sblg-article="1"></code>
<code class="prettyprint lang-html tab"><header></code>
<code class="prettyprint lang-html dtab"><h3>Version 0.0.10</h3></code>
<code class="prettyprint lang-html dtab"><time datetime="2013-07-09">09/07/2013</time></code>
<code class="prettyprint lang-html dtab"><address>Kristaps Dzonsons</address></code>
<code class="prettyprint lang-html tab"></header></code>
<code class="prettyprint lang-html tab"><p></code>
<code class="prettyprint lang-html dtab">Release notes here.</code>
<code class="prettyprint lang-html tab"></p></code>
<code class="prettyprint lang-html"></article></code>
</p>
<p>
Finally, I have the blog template note a selection of recent entries and prohibit the permanent link.
</p>
<p class="code">
<code class="prettyprint lang-html"><article data-sblg-article="1" data-sblg-permlink="0" /></code>
</p>
<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>