π

💻 Emacs integrations for efficient blogging

Show Sidebar

Here I will try to describe a few of the customizations I made to simplify and streamline my blogging experience within Emacs. General information of requirements for lazyblorg are well described on the github page Readme file. We start from some org-mode file where you already have a heading and text section for something you want to blog about.

Emacs helper function and configuration

Let's make the heading lazyblorg-ready with a little Emacs function:

  ;; lazyblorg blog entry generation
  (defun mvb/lazyblorg-new-entry ()
    "Process the current heading in an Org mode buffer to become a
  blog entry."
    (interactive)
    (org-set-tags-to ":blog_sl:")
    (org-id-get-create)
    (org-entry-put (point) "CREATED" (format-time-string "[%Y-%m-%d %a %H:%M]" (current-time)))
    (org-todo 'done))	  

Note that because I plan to manage several blogs, I changed the default :blog: tag to :blog_sl:, where the last two letters are my convention to make the tag blog-specific (here _sl for s mp l inux). I want a shortcut for this so that when the point is on the heading line I can just press it to instantiate the blog metadata.

  (general-define-key "C-c B" 'mvb/lazyblorg-new-entry)	  

Note that I use the general package (general.el github) to manage my key bindings.

Furthermore it is required that a logbook entry is created for the DONE status, which is not necessarily the default. Check the org-todo-keywords variable. The sequence specific to DONE needs to contain the exclamation mark as shown below in "DONE(d!)".

    (setq org-todo-keywords
          '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
    :	  

Now you should be all set to mark some of your writing for being processed as a blog entry. Once that is done, you need to run the lazyblorg.py python script with a list of all org-files that contain such metadata for the blog generation.

Comment via email (persistent) or via Disqus (ephemeral), comments below: