basiscraft: org blogging notes
Table of Contents
- 1 Org Blogging (the gist)
- 1.1 any
.orgfile can define a feed - 1.2 org mode keywords are RSS "categories"
- 1.3 the file feeds combine to form a project snapshot feed
- 1.4 keyword snapshot feeds are filtered from project snapshot feeds
- 1.5 "latest" feeds are filtered from snapshot feeds
- 1.6 more complex feeds are formed by set operations
- 1.7 every snapshot feed can be considered a (minimal) "blog"
- 1.8 indexes, front pages, and "latest" feeds are filtered from blog snapshots
- 1.9 disqus-conventions for comments
- 1.1 any
- 2 file feeds
1 Org Blogging (the gist)
These notes describe one way to maintain a personal blog (or multiple blogs) using org projects.
This is a slightly unusual approach to blog software but here is the gist:
1.1 any .org file can define a feed
An RSS feed can be automatically generated from any org mode file. The generated RSS file will contain exactly one item. That item describes the current state of the file. Meta-data in the org file determines the details of the RSS item.
see file feeds
1.2 org mode keywords are RSS "categories"
In the feed for a given file, the org mode #+KEYWORDS meta-data
becomes a set of RSS categories for the item.
1.3 the file feeds combine to form a project snapshot feed
A merge of all of the individual file feeds forms an overall snapshot RSS feed for the entire org project.
Note that this "project snapshot feed" contains exactly one item for every individual file feed in the project, including file feeds that have not changed in a long time.
1.4 keyword snapshot feeds are filtered from project snapshot feeds
A keyword snapshot feed is formed from a project snapshot feed by removing all items except those which have the keyword as an RSS category.
For example, an org feed file with #+KEYWORDS: emacs would appear
in RSS feeds with the category emacs and would appear in an
emacs keyword snapshot feed.
1.5 "latest" feeds are filtered from snapshot feeds
An (archivable) "latest" feed can be generated from any existing feed by dropping all but "sufficiently new"P items.
1.6 more complex feeds are formed by set operations
Feeds can be formed from other feeds using set union, intersection, and differences applied to the items in the feed.
1.7 every snapshot feed can be considered a (minimal) "blog"
Everything else (especially comments, index, and front page) is optional.
1.8 indexes, front pages, and "latest" feeds are filtered from blog snapshots
Indexes parts and front page parts are automatically generated org files. ("latest" feeds are RSS XML, of coruse).
The index and front page parts generated are suitable for
use on their own and as #+INCLUDE files.
1.9 disqus-conventions for comments
Org files can link to comment threads using a disqus-style interface.
2 file feeds
2.1 file feed RSS
The skeleton of a file feed looks like this:
<?xml version="1.0"?>
<rss version="2.0" xmlns:blog="http://basiscraft.com/ns/20110604-blogging">
<channel>
<title> $CHANNEL_TITLE </title>
<link> $CHANNEL_LINK </link>
<description> $CHANNEL_DESCRIPTION </description>
<langauge> $CHANNEL_LANGUAGE </langauge>
<pubDate> $CHANNEL_PUBDATE </pubDate>
<lastBuildDate> $CHANNEL_LASTBUILDDATE </lastBuildDate>
<docs> $CHANNEL_DOCS </docs>
<generator> $CHANNEL_GENERATOR </generator>
<managingEditor> $CHANNEL_MANAGINGEDITOR </managingEditor>
<webMaster> $CHANNEL_WEBMASTER </webMaster>
<item>
<title> $TITLE </title>
<link> $LINK </link>
<description> $DESCRIPTION </description>
<author> $AUTHOR </author>
<pubDate> $PUBDATE </pubDate>
<guid> $GUID </guid>
<enclosure url=" $ENCL_URL"
type=" $ENCL_TYPE"
length=" $ENCL_LENGTH "/>
<category url=" $CATEGORY_URL "> $CATEGORY </category>
<blog:excerpt> $EXCERPT </blog:excerpt>
</item>
</channel>
</rss>
Not every file feed will have all elements.
2.2 feed parameters
| feed parameter | source | notes |
|---|---|---|
$CHANNEL_TITLE | #+UID | "file-channel:" + uid-value |
$CHANNEL_LINK | supplied externally | |
$CHANNEL_DESCRIPTION | #+DESCRIPTION | |
$CHANNEL_LANGUAGE | #+LANGUAGE | |
$CHANNEL_PUBDATE | #+DATE | |
$CHANNEL_LASTBUILDDATE | #+UPDATE | |
$CHANNEL_DOCS | "http://www.rssboard.org/rss-specification" | |
$CHANNEL_GENERATOR | "org-to-rss" | |
$CHANNEL_MANAGINGEDITOR | #+AUTHOR | |
$CHANNEL_WEBMASTER | supplied externally | |
$TITLE | #+TITLE | |
$LINK | supplied externally | |
$DESCRIPTION | #+DESCRIPTION | |
$AUTHOR | #+AUTHOR | |
$PUBDATE | #+UPDATE or #+DATE | or file timestamp |
$GUID | #+UID | "post:" external guid + ":" + uid-value |
$ENCL_URL | not supported yet | |
$ENCL_TYPE | not supported yet | |
$ENCL_LENGTH | not supported yet | |
$CATEGORY_URL | not supported yet | |
$CATEGORY | #+KEYWORDS | |
$EXCERPT | /see / post excerpts |
2.3 post excerpts
File feeds include a non-standard sub-element of the RSS item element: the blog:excerpt element.
Org version 7.5 with Emacs version 22
Validate XHTML 1.0