我在 .emacs 文件中使用以下代码来设置默认发布行为。我将 org 基本目录放在不同计算机的不同位置:
;; define machine specific directories storing my org files
(cond ((system-name-is-home) (setq org-dir "/data/org"))
((system-name-is-work) (setq org-dir "~/org")))
因此,我想使用一个变量来指定:base-directory
,org-dir
而不是将其硬编码为"~/org"
. 我怎样才能做到这一点?
(require 'org-publish)
(setq org-publish-project-alist
'(
("org-notes"
:base-directory "~/org"
:base-extension "org"
:publishing-directory "~/tmp/"
:recursive t
:publishing-function org-publish-org-to-html
:headline-levels 4
:auto-preamble t
:auto-sitemap t ; Generate sitemap.org automagically ...
:sitemap-filename "sitemap.org" ; ... call it sitemap.org (the default) ...
:sitemap-title "Sitemap" ; ... with title 'Sitemap'.
)
("org-static"
:base-directory "~/org"
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
:publishing-directory "~/tmp/"
:recursive t
:publishing-function org-publish-attachment
)
("org" :components ("org-notes" "org-static"))
))