In Org-roam, there is a function to slug a string that may contain blank characters. Previously, I have to manually add :EXPORT_FILE_NAME: file_name to the subtree’s properties to let hugo index the file correctly. Now, before the push the blog, this tiny function can do the automation.

1
2
3
(org-set-property "EXPORT_FILE_NAME"
                    (org-hugo-slug
                     (nth 4 (org-heading-components))))