Setting up a static-site Blog with Emacs ox-hugo and Hugo
Disclaimer
I have no idea what I am doing at the moment and following the exact steps I outline in this blogpost could lead to wildly unadvisable outcomes, so if you want to follow along, please take everything with a giant grain of salt!
With this disclaimer out of the way, have fun!
The mission
As a total beginner with web technologies but a little bit of prior programming experience I want to start a blog using hugo that’s reachable on my domain and has a look and feel that’s tolerable on mobile and desktop browsers. At the same time I try to write a homepage in pure HTML/CSS to get a feel for what is going on in the templates and to “reverse engineer” a similar style for content on my webpage that is not generated by hugo.
What are my goals for the blog
- Easy to edit and publish
- Normal Emacs workflow
- Inline Dynamic Content if needed
- Easy markup syntax -> org-mode!
Embedding p5.js sketches to showcase my creative coding fun :)
- Simply put an iframe into the org source for your blog
tst set
:EXPORT_FILE_NAME: writing-hugo-blog-in-org-subtree-export :EXPORT_DATE: 2017-09-10 :EXPORT_HUGO_MENU: :menu “Posts” :EXPORT_HUGO_CUSTOM_FRONT_MATTER: :foo bar :baz zoo :alpha 1 :beta “two words” :gamma 10
First heading within the post
- This post will be exported as
content/posts/writing-hugo-blog-in-org-subtree-export.md.
- Its title will be “Writing Hugo blog in Org”.
- It will have hugo and org tags and emacs as category.
- The menu item weight and post weight are auto-calculated.
- The menu item identifier is auto-set.
- The lastmod property in the front-matter is set automatically to the time of export.
A sub-heading under that heading
- It’s draft state will be marked as trueas the subtree has the todo state set to TODO.
With the point anywhere in this Writing Hugo blog in Org post
subtree, do C-c C-e H H to export just this post.
2 + 2;
function() {
    return 3 + 5;
}
\(\epsilon\) \[\Sigma_{k=1}^{n} K_k\]
 
 
| Test | Test2 | Test3 | Test 5 | 
|---|---|---|---|
| 1 | 2 | ||
| 2 | 3 | ||
| 4 | 5 | 
The exported Markdown has a little comment footer as set in the Local Variables section below.
