emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Thole <dthole@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Blogs, org-mode, and wordpress
Date: Thu, 28 Jan 2010 08:42:12 -0600	[thread overview]
Message-ID: <b7b383411001280642i4a49b810h3277f4ba3ff69c81@mail.gmail.com> (raw)

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	other threads:[~2010-01-28 14:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7b383411001280642i4a49b810h3277f4ba3ff69c81@mail.gmail.com \
    --to=dthole@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).