Skip to main content

Posts about nikola

blog-admin and Nikola

Another post about blogging.

blog-admin now supports Nikola, thanks to yours truly. blog-admin is an Emacs package by CodeFalling that lets you view and manage your (static site generated) blog from within inside Emacs.

Nikola's command line utility is pretty nifty and does a bunch of useful things. I had a few utility functions to do common tasks like create new post and deploy blog. This worked well, but moment I came across this blog-admin's tabular view, I was sold!

org2blog (a blogging tool I used previously) had a tracking file that kept track of all the posts I made, and I used it quite a bit for navigation – thanks to org-mode's search functionality. The tabular view of blog-admin is even better! I really like the fact that the author has tried to keep the package generic enough to support any blog, and adding support for Nikola has been quite easy.

The filtering functionality is crude, but good enough for a start. One thing I want to add is a preview functionality for drafts. Showing some (writing) statistics would also be nice – No. posts in the last month, total published posts, etc. No promises, but you may see some of these things, soon. :)

Recurse Center, 2014-08-05

  • Spent a couple of hours in the morning, trying to revive a html template for blaggregator, that I missed out on committing previously, and wiped out due to negligence in using `git clean`.
  • Spent time post lunch working through the first two chapters of the baking pi course, by myself, reading up different references, and finally getting how I/O is mapped to the memory in ARM.
  • Actually, almost. A variant of the example that I thought should work, doesn't. So, I need to think/talk about it today.
  • I sent a patch to Nikola for the lastdeploy timestamp being UTC. I was hoping to work around an issue with Blaggregator, by somehow fixing it on the client side, but that's probably not the right way to go about it.

Org based posts in Nikola

Chen Bin asked me to share my Nikola+Org work-flow, and share an example post.

The org source for any post can be found by changing the URL of a post from .html to .org.

I don't have much of a work-flow, because I don't post too often, but here is what I typically do, to make a new post.

I start off by creating a new post using

$ nikola new_post

and then give the post a title and start editing the post in Emacs.

I have a simple snippet that lets me insert tags, based on existing tags.

Once I'm happy with the content of a post, I run nikola auto to build the source and serve it locally, and see if the post "looks" reasonable, after being rendered.

Once, I'm happy with it, I commit the post and deploy it using nikola deploy.

GITHUB_SOURCE_BRANCH = 'master'
GITHUB_DEPLOY_BRANCH = 'gh-pages'
GITHUB_REMOTE_NAME = 'origin'

# Commands to execute to deploy. Can be anything, for example,
# you may use rsync:
# "rsync -rav output/* joe@my.site:/srv/www/site"
# And then do a backup, or ping pingomatic.
# To do manual deployment, set it to []

I also have a plugin, that posts captured bookmarks and quotes onto the blog, with a single command. I should probably make the sources of my blog open, and push it onto GitHub.

Update [2015-05-13 Wed]

  • I use my own plugin for Nikola which lets me write posts in org-mode. There is a similar plugin by Chen Bin, that exports posts to intermediate html, that is then used by Nikola.
  • The source for my blog is now on GitHub
  • I also have custom elisp to be able to make a new post, and deploy the site from within Emacs.

Bookmarks and Quotes plugin

I used to have a separate page for bookmarks and quotes on the old blog. They will now be shared as regular posts with 5 or more bookmarks/quotes. I use a bookmarklet in my browser to capture links to an org-file using org-capture protocol and then I have a small plugin to Nikola, that looks at such captured bookmarks and quotes and makes new posts out of them. This workflow is inspired by Brett Trepestra's web excursions plugin.

The plugin is currently a part of my blog source, and not published to Nikola's plugin repository since it is very specific to my setup. But if anybody is interested, I can publish the code somewhere public.

If you are interested to get these links and bookmarks into your feed reader, you can subscribe to their feed: [quotes], bookmarks. These posts will also make it to the main feed, though.

UPDATE [2015-11-15 Sun 20:45]

  • The quotes feed no longer exists!
  • The bookmarks feed doesn't really get too many updates. I use pinboard for my bookmarks, now.