This manual is for Blorg (version 0.71).
Copyright © 2006 Bastien Guerry
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License.”(a) The FSF's Back-Cover Text is: “You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.”
--- The Detailed Node Listing ---
Quickstart
Blorg File
Templates
Post Template
Blorg is a tool that helps you to produce a blog based on an org-mode file. If you're here, there are good chances that you've heard about Org-mode. If you don't, please check Org-mode before : http://staff.science.uva.nl/~dominik/Tools/org/
Note that blorg has been developped under GNU Emacs. It should work fine under XEmacs, but it has not been thoroughly tested yet.
Blorg is another blog publishing tool. There are already many of them in the wild, so why would you prefer this one?
Get blorg.el: http://www.cognition.ens.fr/~guerry/u/blorg.el
Then make sure blorg.el is in your load-path and
require it somewhere in your configuration.
For example, if blorg.el is in the ~/elisp/
directory, the following lines should do the trick:
(add-to-list 'load-path "~/elisp/")
(require 'blorg)
Blorg files are just like any other org file except that they understand a few specific keywords.
Here is a minimalistic example of what an blorg file looks like. Copy this example somewhere and try C-c " (blorg-publish).
#+TITLE: The title of my blog
#+BLOG_URL: http://www.server.org/~me/
#+PUBLISH_DIR: /home/me/public_html/
* DONE This is my first entry :misc:
CLOSED: [2006-11-03 ven 16:57]
Hello world!
Please make sure to adapt this example to your environment before trying it! Let's explain the structure of this example a bit.
#+TITLE:#+BLOG_URL:#+PUBLISH_DIR:See The header for further details about available keywords in
blorg.
* DONE This is my first entry :misc:DONE are considered as suitable for publication. Headlines
containing other TODO keywords are simply ignored.
For a full description of all available variables in the header, see The header.
:misc: is what org-mode defines as a tag. it will be used
by blorg to publish two files: misc.html will contain
all posts that are tagged as misc and misc.xml will
contain a feed for this tag.
CLOSED: [2006-11-03 ven 16:57]For this CLOSED: string to be automatically called when
finishing a blog entry, turn on org-log-done.
Calling blorg-publish (C-c ") parse the blorg file and export it as a blog.
By default, blorg does not re-publish a post page if this page already exists on the server. You can force the upload of all post pages by prefixing blorg-publish: C-u C-c ".
Giving a numeric argument will force the index to display the given number of posts and force the upload of all post page. C-u 4 C-c " makes blorg list 4 posts in the index page.
Blorg first parses the header and the content of the blorg file. Then the file is rendered as a blog. The content of the blog is processed in this order.
index is an element of blorg-publish-feed.
tag is an element of blorg-publish-feed.
There are mainly three ways of configuring blorg.
M-x customize-group
RET blorg).
#+CONFIG_FILE keyword.
This section describes the file structure. More precisely it goes through available keywords that you can put in the header and it describes how blorg handles text formatting.
In org-mode, the header is defined by the first lines of the file, each line containing a keyword. This section describes all available keywords in blorg. Each keyword locally assigns a value to the corresponding variable. If you want to modify those variables globally, customize blorg-default-options.
Keywords marked with * are not known by org-mode (but the
* is not part of the keyword.)
#+TITLE, #+BLOG_URL*, #+PUBLISH_DIR*#+AUTHOR, #+EMAIL, #+LANGUAGE#+AUTHOR defaults to user-mail-address.
#+EMAIL defaults to user-full-name.
#+LANGAGE defaults to the first two characters of the
LANG environment variable.
#+ENCODING*#+UPLOAD_DIR*, #+IMAGES_DIR*upload/ and images/.
#+FEED_TYPE*, #+HTML_CSS*, #+XML_CSS*#+FEED_TYPE can be either atom or rss, depending
on weither you prefer Atom 1.0 or RSS 2.0 as the format for your XML
feeds.
#+HTML_CSS defines the CSS stylesheet for the HTML files.
#+XML_CSS defines the CSS stylesheet for the XML feed. This is
now quite obsolete since many browsers (e.g. Firefox) now have a
special handling of XML feeds.
#+SUBTITLE*, #+HOMEPAGE*, #+KEYWORDS*#+KEYWORDS are the keywords that will take inside the
<meta name="keywords" /> of the HTML output.
#+CREATED*#+DONE_STRING*org-todo-keywords is DONE.
blorg will use it as the default keywork for headlines that are
suitable for publication. If #+SEQ_TODO is defined, this will
override org-todo-keywords.
If #+DONE_STRING is defined, it will be used as a special
string marking publishable headlines.
Be aware that if you use a #+DONE_STRINE that is different from
the traditionnal DONE keyword, you will get trouble logging
headlines with CLOSED: string.
Defines the number of posts to process when exporting the index and the tags pages.
Other keywords like #+STARTUP, #+LINK, #+TBLFM, #+SEQ_TODO,
#+CATEGORY, #+TAGS have no special meaning in blorg.
Usual text formatting will be exported without complain.
This section describes the templates mechanism as it is implemented in blorg. Templates allow you to make the HTML output of blorg look the way you want.
Here's an overall view of the blog structure :
Here is the default hierarchy for the HTML page. `Included tag' describes the first tag to appear in the element (if any). `In template' says whether the corresponding HTML element is by default included in templates.
`*' means it's included in all templates. `!page' means it's not included in the `page' template. `!*' means it's not included in any template.
| HTML element | included tag | in templates
|
|---|---|---|
HTML | - | *
|
.BODY | - | *
|
..HEAD | - | *
|
...DIV id:content | - | *
|
....DIV id:blog-title | <h1 /> | *
|
....DIV id:blog-author | <h3 /> | *
|
....DIV id:tags-cloud | <a /> | !post
|
....DIV id:prev-posts | <ul /> | !post
|
....DIV id:archives | <ul /> | !post
|
....DIV class:post | - | *
|
......DIV class:post-title | - | *
|
......DIV class:post-infos | - | *
|
.......P class:author | - | *
|
.......P class:date | - | *
|
.......P class:tags | - | *
|
......DIV class:post-echos | - | !*
|
......DIV class:post-content | - | *
|
.......A class:read-more | - | !post
|
In the next two sections, we get a closer look at two templates: the
index template and the post template, respectively
defined by blorg-index-template and
blorg-post-template.
Each template is a mix of HTML code and emacs-lisp expressions.
Here is blorg-index-template:
<body>
<div id="content">
<div id="blog-title">
<h1><a href="(blorg-insert-index-url)"> \
(blorg-insert-page-title)</a></h1>
</div>
<div id="blog-author">
<h3><a href="(blorg-insert-mailto-email)"> \
(blorg-insert-author)</a></h3>
</div>
(blorg-insert-previous-posts)
(blorg-insert-tags-as-cloud)
(blorg-insert-archives)
(blorg-insert-content)
</div>
</body>
Depending on the template, you have a set of available elisp expressions that you can insert in the template. Check the docstring of each template variable to get the list of available expression.
Here is the list of available elisp defuns you can insert in the index template:
(blorg-insert-index-url) : the URL of the index page
(blorg-insert-homepage) : the URL of the author's homepage
(blorg-insert-page-title) : the page title
(blorg-insert-page-subtitle) : the page subtitle
(blorg-insert-mailto-email) : mailto:your@email.com
(blorg-insert-email) : your@email.com
(blorg-insert-author) : author's name
(blorg-insert-previous-posts) : a list of previous posts
(blorg-insert-tags-as-cloud) : a cloud of tags
(blorg-insert-tags-as-list) : a list of tags
(blorg-insert-archives) : a list of archived months
(blorg-insert-content) : the main content
The post template defines the display of a post in a page.
Attention: we're not talking about the way each post-page is structured (which is defined by blorg-post-page-template) but the way each post appears in a [index/month/tag/post]-page.
Here is the default template for posts:
<div class="post">
<div class="post-title">
<h2><a href="(blorg-insert-post-url)"> \
(blorg-insert-post-title)</a></h2>
</div>
<div class="post-infos">
(blorg-insert-post-author)
(blorg-insert-post-dates)
(blorg-insert-post-tags)
</div>
<div class="post-content">
(blorg-insert-post-content)
</div>
</div>
Here is the list of available elisp defuns you can insert in the post template:
(blorg-insert-post-url) : the URL of the post
(blorg-insert-post-title) : the title of the post
(blorg-insert-post-author) : the author of the post
(blorg-insert-post-dates) : the publication dates
(blorg-insert-post-tags) : the tags for this post
(blorg-insert-post-echos) : the "Submit this post" links
(blorg-insert-post-content) : the main content of the post
Please note that this list slightly differs from that of the index template. The list of potential elements is not exactly the same for each template.
The funny thing is that even in the post template, there are more
(hidden) templates. For example, the display of
blorg-insert-post-author is controlled by
blorg-post-author-template. See
blorg-post-dates-template and
blorg-post-tags-template.
Let's say that you want the full post to be displayed in every page
but in the index. You can do this by setting
blorg-put-full-post. This option is a list of symbols
among index, post, tag and month.
The default is '(index) so that only post pages display
the full content of posts.
Here is a list of other options working the same way:
blorg-put-author-in-post
blorg-put-dates-in-post
blorg-put-tags-in-post
blorg-put-echos-in-post
All these options override the display of a post as set in blorg-post-template. And in fact, you might say they are redundant since the structure of the post is already defined in this template. But
#+CONFIG_FILE.
C-c ": Publishing processC-c ": ExampleC-u C-c ": Publishing processC-u C-c ": Example