24 Sep 2022
- Mauro ArandaSo, I finally decide to set up a blog for myself, where I can, you know, write about things (mostly about code and Emacs).
But I'm writing this post before I have anything working, except the web host, the domain and that stuff. I did some research looking for a static site generator, and I'm going to try Jekyll. https://jekyllrb.com/
So this first post is going to mutate into a log about the things I had to do to finally put this first post online so no one can read it. If it doesn't work, then I might try another static site generator, or it might never see the internet.
Let's see what happens. (I don't know Ruby at all)
Obviously, I'm going to try the quickstart at https://jekyllrb.com/docs/
I've got no ruby for local testing, so that seems to be the first step:
Now check if that worked:
says "Hello World!", so it's going fine.
Set up a gem installation directory.
And now install Jekyll and Bundler.
Ok, 27 gems installed. Now, how do I test?
After cding to the directory where I want to store this test blog:
And… New jekyll site installed in …
So, cd to myblog and
That gives a load error because cannot load such file – webrick (LoadError)
But fortunately, the guide says that I should
And now repeating the exec command says that the server is running.
And it is! http:/localhost:4000 shows a nice empty blog.
Starting from here https://jekyllrb.com/docs/step-by-step/01-setup/ I followed every step to end up with a really ugly but functional blog.
To create this post, I need to export this org file that I'm writing to markdown or something, so Jekyll can process it. But that's for later, now I'll go to configure Apache to serve this site.
I used Tramp to copy the contents of the _site directory to the host, and now I just need to add the configuration for the new site, tell it the name, where's the root, alias static, oh my god, enable the site, aaaand: online! http://blog.mauroaranda.com
I've got no patience to spend a lot of time with CSS for the first post, so I'm going to use w3.css.
And after a few tweaks to the _layouts directory, I've got something good enough for a first post.
Now it's time to dive into the Org manual to figure out how to do this export thingy. I'm sure this is going to take time to make it smooth, so I'll describe what I'd like to do, but not necesssarily what I end up doing for this post.
I'm writing this post in blog/org/posts and I'd like to export it into blog/jekyll/posts with the format that Jekyll expects it (YEAR-MONTH-DAY-title.MARKUP) so I need org-publish-file to pickup the name on the fly.
Since a TOC interferes with the Jekyll Front Matter, I set org-export-with-toc to nil. Speaking about the Front Matter, I need the resulting html to begin with that, so I stick it under a EXPORT Org Block.
Next thing is that I need to figure out how to do syntax highlighting in my posts. Jekyll uses Rouge but to use that I need a way for the SRC Org blocks to export into a highlight tag. Or maybe try another way.
Anyway, that's almost what I ended up doing, and I'm pretty happy with my progress so far, so I'll end this post right now.