I have recently blogged about moving to _emacs_ and the reasons behind it.
Since then, I have used _Orgmode_ a lot more. And I have begun to like it even more. I had a plan to move the blog to _[Hugo](https://gohugo.io/)_. After giving it a try, I had inconsistent results. I must've been doing something wrong. I've spend a lot more time than I anticipated on it. At some point, it becomes an endeavor with diminishing returns. So I ditched that idea.
But why did I want to move to _Hugo_ in the first place ?
<!--more-->
## Why _Hugo_ you may ask {#why-hugo-you-may-ask}
Well, the answer to that question is very simple; _Orgmode_.
The long answer is that the default _Nikola_ markup language and the most worked on is _reStructuredText_. It can support other formats. _Orgmode_ also seems widely supported and can be easily manipulated. So I want to move to _Orgmode_ instead of _rst_.
But what are the odds ?
Damn... It has plugins and you can find an [orgmode](https://plugins.getnikola.com/v8/orgmode/) page where you find
```text
$ nikola plugin -i orgmode
```
Where the heck did that come from ? Okay that was easy.
Turns out _Nikola_ supports _Orgmode_.
## Nikola _Orgmode_ plugin installation {#nikola-orgmode-plugin-installation}
The page suggests running.
```text
$ nikola plugin -i orgmode
```
Followed by
```python
# NOTE: Needs additional configuration in init.el file.
# Add the orgmode compiler to your COMPILERS dict.
[2020-08-31 23:16:29] INFO: auto: Serving on http://127.0.0.1:8000/ ...
[2020-08-31 23:16:36] INFO: auto: Server is shutting down.
```
I knew there was a catch !
You might be looking for the error message and it might take you a while. It took me a bit to find out what was wrong. The error is actually the following.
```text
Please install htmlize from https://github.com/hniksic/emacs-htmlize
```
It turns out that the plugin is a _python_ script that calls _emacs_ with a configuration `init.el`. I know I have _htmlize_ installed on my _doom_ system but _Nikola_ does not see it.
After looking around the internet, I found the `init.el` file I'm looking for. It's in `plugins/orgmode/init.el` and it has the following few lines at the top.
```emacs-lisp
(require 'package)
(setq package-load-list '((htmlize t)))
(package-initialize)
```
Okay, that's what's trying to load _htmlize_. Let's try to add it to the `load-path` as follows.
In my case, the path to `htmlize` is `~/.emacs.d/.local/straight/build/htmlize`.
If you don't have it installed, simply `git clone` the repository in a directory and `load-path` that path.
</div>
Now, let's try _Nikola_.
```text
$ nikola auto
[2020-08-31 23:30:32] INFO: auto: Rebuilding the site...
Scanning posts..........done!
[2020-08-31 23:30:36] INFO: auto: Serving on http://127.0.0.1:8000/ ...
```
Woohoo ! It works. Now let's move to the next steps. Writing our first blog post.
## First _Org_ post {#first-org-post}
Let's create this blog post.
<divclass="admonition warning">
<pclass="admonition-title">warning</p>
It is very important to use the `nikola` command line interface to create the post. I spent too much time trying to figure out the _header_ settings.
</div>
```text
$ nikola new_post -1 -f orgmode -t orgmode posts/misc/welcome-back-to-the-old-world.org
```
Now edit the _org_ file and save it. _Nikola_ should pick it up and render it.
## Yes, I have made more changes {#yes-i-have-made-more-changes}
### Theme {#theme}
I have moved the blog to the _[willy-theme](https://themes.getnikola.com/v8/willy-theme/)_ which offers _light_ and **dark** modes and good code highlighting.
### Blog post format {#blog-post-format}
You might have also noticed that there were big changes to the repository. All the blog posts have been converted to _Orgmode_ now, both _pages_ and _posts_.
I used [pandoc](https://pandoc.org/) to do the initial conversion from _rst_ to _Orgmode_ as follows.
I know, I know. It does a pretty good initial job but you will need to touch up the posts. Fortunately, I did not have a lot of blog posts yet. Unfortunately, I had enough for the task to take a few days. For me, it was worth it.
## Conclusion {#conclusion}
This was a long overdue project, I am happy to finally put it behind me and move foward with something simple that works with my current flow.