Up until the last commit, the site was being written in Org Mode, exported using ox-hugo, and Hugo was invoked manually to generate the html all locally. The generated
public folder was what was being pushed to SourceHut for the deployment. This will be first post which will only commit the actual content in org format only and the full CI/CD will happen on SourceHut.
I’ll be following along with the System Crafters' Publishing Website with Org Mode to take full advantage of
org-publish and configure multiple outputs (WWW and Gemini). As of the now the following configuration is invoking the correct export function through org-publish but ox-hugo isn’t finding the Hugo sub-trees.
(message "\n==== Exporting Hugo markdown ====") (setq org-publish-project-alist (list (list "org-site:main" :recursive nil :base-directory "./" :publishing-function '(org-hugo-export-wim-to-md :all-subtrees nil :visible-only nil) :publishing-directory "./public" ;; :with-author nil ;; Don't include author name ;; :with-creator t ;; Include Emacs and Org versions in footer ;; :with-toc t ;; Include a table of contents ;; :section-numbers nil ;; Don't include section numbers :time-stamp-file nil))) ;; Don't include time stamp in file ;; Generate the site output (org-publish-all t) (message "\n==== Export complete ====")
Publishing file /home/shom/dev/shom.dev/content.org using `org-hugo-export-wim-to-md' [ox-hugo] No valid Hugo post subtrees were found
Using hugo-export directly
In order to check sanity and solve the issue, I exported directly with
org-hugo-export-wim-to-md which is straightforward since I’ve opted for a single org-content file and it worked as expected. So this is the configuration that is currently building the site:
(message "\n==== Exporting Hugo markdown ====") (with-current-buffer (find-file "./content.org") (org-hugo-export-wim-to-md :all-subtrees nil :visible-only nil)) (message "\n==== Export complete ====")
I would like to get the
org-publish route sorted out so I can publish to the Hugo site and the Gemini capsule with a single commit.