You can configure specific emacs configurations for directories like projects adding a .dir-locals.el
This allows for things like setting variables or enabling modes for files in a specific directory.
A good example of this is for exporting my org-roam notes to my digital garden that runs on Quartz, I added the next to ~/notes/.dir-locals.el
:
((org-mode . (
(eval . (org-hugo-auto-export-mode))
(org-hugo-base-dir . "~/projects/quartz/")
(org-hugo-front-matter-format . "yaml")
)))
You can also set this to run in subdirectories, for this case, if I wanted to run the previos code only in the journal
directory it would be:
(("journal" . ((org-mode . (
(eval . (org-hugo-auto-export-mode))
(org-hugo-base-dir . "~/projects/quartz/")
(org-hugo-front-matter-format . "yaml")
)))))