summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-02-18 19:46:42 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2013-02-18 20:34:55 +0100
commit5c61a34e5bda2eb1c256f99606f6bc53bd35e90c (patch)
treef52f626228cdb0273cb383fea11630baf30dfc77
parent875f5cc69b8f396fa60de38269aa5ce090f6ef43 (diff)
downloadorg-mode-5c61a34e5bda2eb1c256f99606f6bc53bd35e90c.tar.gz
ox-publish: Publish "theindex.org" last
* lisp/ox-publish.el (org-publish-projects): Publish "theindex.org" last, so that "theindex.inc" can be completed.
-rw-r--r--lisp/ox-publish.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index a5da49e..bcdbfcf 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -675,17 +675,24 @@ If `:auto-sitemap' is set, publish the sitemap too. If
(preparation-function
(plist-get project-plist :preparation-function))
(completion-function (plist-get project-plist :completion-function))
- (files (org-publish-get-base-files project exclude-regexp)) file)
+ (files (org-publish-get-base-files project exclude-regexp))
+ (theindex
+ (expand-file-name "theindex.org"
+ (plist-get project-plist :base-directory))))
(when preparation-function (run-hooks 'preparation-function))
(if sitemap-p (funcall sitemap-function project sitemap-filename))
- (dolist (file files) (org-publish-file file project t))
+ ;; Publish all files from PROJECT excepted "theindex.org". Its
+ ;; publishing will be deferred until "theindex.inc" is
+ ;; populated.
+ (dolist (file files)
+ (unless (equal file theindex)
+ (org-publish-file file project t)))
+ ;; Populate "theindex.inc", if needed, and publish
+ ;; "theindex.org".
(when (plist-get project-plist :makeindex)
(org-publish-index-generate-theindex
project (plist-get project-plist :base-directory))
- (org-publish-file
- (expand-file-name
- "theindex.org" (plist-get project-plist :base-directory))
- project t))
+ (org-publish-file theindex project t))
(when completion-function (run-hooks 'completion-function))
(org-publish-write-cache-file)))
(org-publish-expand-projects projects)))