Creating a new blog post using the previously describe setup should be easy and comfortable. These are the generic steps for adding a blog-post.
-
Create the content in org-mode: Open any org-file on the computer and write a blogpost.
- Any existing org-mode heading could be turned into a blogpost, but most generic notes dont make for a good blog post. Some of them can be a good basis though.
-
Tag it so i can find it again later: Tag it with “blog” so I can find it through the agenda. Enables me to list how much time i spend blogging in a week / month / year.
-
Create hugo variable placeholders: Navigate to the headline and press `M-x hugo`
-
Fill in the hugo variables. An example is below:
:PROPERTIES: :TITLE: Setting up the blog :HUGO_TAGS: emacs blogging :HUGO_TOPICS: emacs :HUGO_FILE: setting_up_the_blog.md :HUGO_DATE: [2017-08-15 Di 22:14] :END:- It is hidden in an org-mode drawer which makes it easy to hide
-
Convert the headline into a markdown file according to the hugo variables: Navigate to the headline and press `M-x hugo`
-
Regenerate the website including the new markdown file: Open a shell (I use git bash on Windows), navigate to the blog directory and execute `hugo`
- Optional: Debugging, check the blog post formatting before uploading it
- For this execute “hugo server” and navigate to the local blog
- Downside: pictures dont get resolved correctly
-
Publish the website
cd public git add * && git commit -m "site update" && git push origin master