Another fix for sitemap sorting

This commit is contained in:
Carsten Dominik 2010-04-23 00:06:10 +02:00
parent 830e0cfe40
commit 238a3d2818
1 changed files with 8 additions and 11 deletions

View File

@ -388,18 +388,15 @@ eventually alphabetically."
(aorg (and (string-match "\\.org$" a) (not adir))) (aorg (and (string-match "\\.org$" a) (not adir)))
(bdir (file-directory-p b)) (bdir (file-directory-p b))
(borg (and (string-match "\\.org$" b) (not bdir))) (borg (and (string-match "\\.org$" b) (not bdir)))
(A (if aorg (org-publish-find-title a) a)) (A (if aorg
(B (if borg (org-publish-find-title b) b))) (concat (file-name-directory a)
;; If we have a directory and an Org file, we need to combine (org-publish-find-title a)) a))
;; directory and title as filename of the Org file: (B (if borg
(when (and adir borg) (concat (file-name-directory b)
(setq B (concat (file-name-directory b) B))) (org-publish-find-title b)) b)))
(when (and bdir aorg)
(setq A (concat (file-name-directory a) A)))
;;
(setq retval (if sitemap-ignore-case (setq retval (if sitemap-ignore-case
(string-lessp (upcase A) (upcase B)) (not (string-lessp (upcase B) (upcase A)))
(string-lessp A B))))) (not (string-lessp B A))))))
;; Directory-wise wins: ;; Directory-wise wins:
(when sitemap-sort-folders (when sitemap-sort-folders