Hi! I'd like to include several files into an org-mode project that live outside the project tree. I tried to just symlink them into the appropriate place into my project, and thought that might suffice to get them published correctly, but that doesn't work out, as org-mode doesn't consider the symlink's name, but the "true" filename; for example, I have this:
(setq org-publish-project-alist '(("homepage" :base-directory "~/homepage" :base-extension "org" :publishing-directory "~/public_html" ...) ...)) % ls -l ~/homepage/software/SPE.org lrwxrwxrwx 1 rotty rotty 26 Jul 14 15:01 /home/rotty/homepage/software/SPE.org -> /home/rotty/src/spe/README org-mode publishes this as ~/public_html/README.html, while I'd like it to use ~/public_html/software/SPE.html. After playing around with EDebug for a while, I've come up with the following horrible hack, which does what I want, but is nowhere near a general solution:
diff --git a/lisp/org-publish.el b/lisp/org-publish.el index 38e1c7b..2c42685 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -414,6 +414,9 @@ PUB-DIR is the publishing directory." (init-buf (current-buffer)) (init-point (point)) (init-buf-string (buffer-string)) + ;; dirty hack to allow symlinking; this is likely to + ;; break stuff --rotty + (buffer-file-name filename) export-buf-or-file) ;; run hooks before exporting (run-hooks 'org-publish-before-export-hook) @@ -501,8 +504,8 @@ See `org-publish-org-to' to the list of arguments." (setq tmp-pub-dir (file-name-directory (concat pub-dir - (and (string-match (regexp-quote base-dir) ftname) - (substring ftname (match-end 0)))))) + (and (string-match (regexp-quote base-dir) filename) + (substring filename (match-end 0)))))) (if (listp publishing-function) ;; allow chain of publishing functions (mapc (lambda (f)
Is there a "proper" way to do this? Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>
_______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode