This site is build with Hugo which is a static site generator using markdown. The usual way of doing github action with hugo is using the actions-hugo workflow. Since I’m using org-mode for literally everything, it’s only natural that I also use it for blogging.
Create a script for exporting org-files to markdown#
We need to be able to export the org-mode files into markdown format. Depending on how the files are organized, we need to have a function that could export them. Here I’m using per file layout1.
1
2
3
4
5
6
7
8
9
10
11
12
13
(require'package)(add-to-list'package-archives'("melpa"."https://melpa.org/packages/")t)(package-refresh-contents)(package-initialize)(package-install'ox-hugo)(require'ox-hugo)(defunexport-org-files()"Export files to hugo markdown."(interactive)(dolist(f(append(file-expand-wildcards"content-org/**/*.org")))(with-current-buffer(find-filef)(org-hugo-export-to-md))))