This is out of date. I’m now using a vibecoded base to create my website.
Description of tools
ox-hugois an emacs package which exports individual.orgfiles into hugo-style.mdfiles.Hugois a static site generator which uses.mdsources to create a static site.
Workflow
Site generation is not finished yet, so this is subject to extreme change. The basic workflow is likely fixed however.
- Use emacs and org to write notes.
- Use
org-hugo-export-to-mdto export (a single note) to hugo-like markdown. - Put that markdown in the content folder of a hugo site.
- Run
hugo server --buildDrafts --navigateToChangedto generate site.
ToDo
- Write scripts in emacs to fascilitate multiple
org -> mdexports at once, in particular, add the ability to automatically export linked org files. - Add a tag/property
publishin org files which flags whether a given org file should be published or not. Only publish those which are publishable. If a published file links to an unpublished file, link to 404 or to a “this page is not yet published (or may never be published)” page. - Update the theme of the Hugo site to be nicer.
Known issues and fixes
- calls to
org-hugo-export-as-mdinitially threw an error: “invalid function: org-export-with-buffer-copy”. This is because in the branch of org I use, needed for betterorg-latex-previewfunctionality, the functionorg-html-format-latexincludes a call to the deprecatedorg-export-with-buffer-copyfunction. This is now a macro, defined at runtime, not a builtin function. The fix includes overriding theorg-html-format-latexcall, and is handled in the doom.org source config file in the “Website” section. The fix is copy and pasted from this github thread. - in the current test instantiation of the site (
~/Desktop/websites/hugo-site/), math-jax does not automatically work, it must be switched on. To do this, one follows the instructions here in the Hugo docs. However, I spent a while troubleshooting before I realized that the two files one creates, the partial template/layouts/_partial/math.htmland/layouts/baseof.htmlmust be place in the theme layout folder not the site layout folder. That is, the paths ought to be/<base-site-dir>/themes/my-theme/layouts/_partial/math.htmland/<base-site-dir>/themes/my-theme/_defaults/baseof.htmlrespectively. The directory/<base-site-dir>/layouts/seems to be empty, I don’t think anything should go in here.