emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Blogs, org-mode, and wordpress


From: David Thole
Subject: [Orgmode] Blogs, org-mode, and wordpress
Date: Thu, 28 Jan 2010 08:42:12 -0600

Hey all,

I wasn't sure if anyone tried to do something similar or not.

I am moving web services, and moving blog engines to wordpress - and I
thought about org-mode and how much it'd be better to have blogs
inside org mode.  For the past month and a half or so, I've been
working on that solution.  The reason I'm emailing the group is to get
a feel for all those who've done something like this before, what
their solution was, and if anyone is interested in this solution.  So
this email I hope to gather that feedback, and explain what I've done
in a fair bit of detail as well.

The organization of the blog-setup is fairly simple.  In a dedicated
directory, named blogs, I have an index.org file.  Inside that org
file, I have the following general structure:

#+CATEGORIES: Blog_Category_1 Blog_Category_2 ...
...

* <BLOG TITLE>
   Status: <Published, Publish, Draft>
   Categories: Blog_Category_1 Blog_Category_2 ...
   File: [[file:YYYY-MM-DD.org][YYYY-MM-DD]]
   CMD5: <MD5 in hex>

For each blog file, there's 1 per day.  The general format of the file
is just the straight up content of the blog.  Right now it supports
links, bold, and italics.  I hope to add others as needed, including
images later.

For the actual program itself, there are two parts:
org-sync.lisp
cl-wordpress

cl-wordpress is simply a library for common lisp, that will interface
with wordpress through XMLRPC.  I spent a large amount of time on
this, and this project itself will be published fairly soon.

org-sync.lisp does the following operations on a sync:
- Parse index.org
- For any blogs that are in state "Publish", create a MD5Sum of the
file, convert the org-specific tags to HTML tags, and push to
cl-wordpress.  After that, change the state from "Publish" to
"Published"
- For any blogs that are in state "Draft", do nothing.
- For any blogs that are in state "Published", read the blog file
itself.  Generate an MD5 of the file contents, and compare with the
stored value for the MD5.  If they differ, call an updateBlogEntry
function within cl-wordpress which will update the blog.  In short,
this is determined by the title, that doesn't change in this system.
- At the end, write all the index.org file once again, with the
changes to the org-objects.

The goal of this was to be able to write the org-files locally, and
when I want them to be published, I change the state accordingly.  I
would then have a cron job that would:
- Update museorg (my git repository of org, org-notes, and some
muse-mode documents)
- Run the sync function from the org-sync.lisp file
- Run git commit && git push.

I hope this makes sense on the general way I went with this, and why.
I hope to eventually be able to change this to using cl-org-mode, but
that depends on how useful it'd be for others to have this library
published.  Right now as it stands, I'll have cl-wordpress up by the
end of next week, hopefully on common-lisp.net, but org-sync is the
one I'm not sure yet.  If others find it interesting, and helpful,
I'll clean up the code, document, test, and push it out to github or
common-lisp.net.

Thoughts and feedback definitely welcome.

-David
http://www.thedarktrumpet.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]