How do you save a publishing behavior so that only a single org file out of a directory of org files is published?

org-publish-file could be used with a larger unused project definition, but content could be published unintentionally.

1 Answer 1


This was non-obvious and the scenario of single/select files wasn't mentioned in any documentation specifically, so here's my solution: (only the last two lines are relevant)

(setq org-publish-project-alist
         :base-directory "~/org/"
         :publishing-function org-html-publish-to-html
         :publishing-directory "~/html_pub/"
         :exclude ".*"
         :include ["project.org"])))

(specify the parent directory, exclude all files, and explicitly include the file(s) which you intend to publish)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.