I am working on managing my website with ox-twbs. The directory tree of my site looks like this:

├── bar
│   └── private
├── foo
│   ├── eggs
│   │   └── private
│   └── spam
└── img

I want org-publish to ignore all files under a directory named private. Is this possible?

My project in my .emacs looks like this

(let ((proj-base (file-name-directory load-file-name)))
  (setq org-publish-project-alist
       :base-directory "~/mysite/"
       :recursive t
       :publishing-directory "~/published-pages/"
       :exclude ????
       :publishing-function org-twbs-publish-to-html)
       :base-directory "~/mysite/"
       :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|txt"
       :publishing-directory "~/published-pages/"
       :recursive t
       :exclude ????
       :publishing-function org-publish-attachment)
      ("website" :components ("org" "static"))

My guess is that I can exclude everything under a directory named private with something like :exclude "*/private/*" but this doesn't seem to work.


The :exclude property should do the trick.

I think the reason the property is not working for you is because its value should form a regular expression, whereas your example is a glob pattern.

Try using :exclude ".*/private/.*" or similar.

See also the GNU Emacs Manual node on Regular Expressions for the particularities of its syntax.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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