浏览代码

Publishing: New default for name of sitemap file: sitemap.org

The default for the sitemap file was "index.org" which is really
terrible because it will overwrite the index.html file.  Now the
default is "sitemap.org".
Carsten Dominik 16 年之前
父节点
当前提交
9382d960ca
共有 2 个文件被更改,包括 11 次插入113 次删除
  1. 4 0
      lisp/ChangeLog
  2. 7 113
      lisp/org-publish.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-03-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-publish.el (org-publish-project-alist)
+	(org-publish-projects, org-publish-org-index): Change default anme
+	for the index of file names to "sitemap.org".
+
 	* org-export-latex.el (org-export-latex-tables): Use
 	`org-split-string', for Emacs 21 compatibility.
 

+ 7 - 113
lisp/org-publish.el

@@ -2,7 +2,7 @@
 ;; Copyright (C) 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
 ;; Author: David O'Toole <dto@gnu.org>
-;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
+;; Maintainer: Carsten Dominik <carsten DOT dominik AT gmail DOT com>
 ;; Keywords: hypermedia, outlines, wp
 ;; Version: 6.24a
 
@@ -28,120 +28,14 @@
 ;;
 ;; org-publish.el can do the following:
 ;;
-;; + Publish all one's org-files to HTML or LaTeX
+;; + Publish all one's org-files to HTML or PDF
 ;; + Upload HTML, images, attachments and other files to a web server
 ;; + Exclude selected private pages from publishing
 ;; + Publish a clickable index of pages
 ;; + Manage local timestamps for publishing only changed files
 ;; + Accept plugin functions to extend range of publishable content
 ;;
-;; Special thanks to the org-mode maintainer Carsten Dominik for his
-;; ideas, enthusiasm, and cooperation.
-
-;;; Installation:
-
-;; Put org-publish.el in your load path, byte-compile it, and then add
-;; the following lines to your emacs initialization file:
-
-;; (autoload 'org-publish "org-publish" nil t)
-;; (autoload 'org-publish "org-publish-all" nil t)
-;; (autoload 'org-publish "org-publish-current-file" nil t)
-;; (autoload 'org-publish "org-publish-current-project" nil t)
-
-;; NOTE: When org-publish.el is included with org.el, those forms are
-;; already in the file org-install.el, and hence don't need to be put
-;; in your emacs initialization file in this case.
-
-;;; Usage:
-;;
-;; The program's main configuration variable is
-;; `org-publish-project-alist'. See below for example configurations
-;; with commentary.
-
-;; The main interactive functions are:
-;;
-;; M-x org-publish
-;; M-x org-publish-all
-;; M-x org-publish-current-file
-;; M-x org-publish-current-project
-
-;;;; Simple example configuration:
-
-;; (setq org-publish-project-alist
-;;       (list
-;;        '("org" . (:base-directory "~/org/"
-;;		     :base-extension "org"
-;;		     :publishing-directory "~/public_html"
-;;		     :with-section-numbers nil
-;;		     :table-of-contents nil
-;;		     :recursive t
-;;		     :style "<link rel="stylesheet" href=\"../other/mystyle.css\" type=\"text/css\">")))
-
-;;;; More complex example configuration:
-
-;; Imagine your *.org files are kept in ~/org, your images in
-;; ~/images, and stylesheets in ~/other. Now imagine you want to
-;; publish the files through an ssh connection to a remote host, via
-;; Tramp-mode. To maintain relative links from *.org files to /images
-;; and /other, we should replicate the same directory structure in
-;; your web server account's designated html root (in this case,
-;; assumed to be ~/html)
-
-;; Once you've done created the proper directories, you can adapt the
-;; following example configuration to your specific paths, run M-x
-;; org-publish-all, and it should publish the files to the correct
-;; directories on the web server, transforming the *.org files into
-;; HTML, and leaving other files alone.
-
-;; (setq org-publish-project-alist
-;;       (list
-;;        '("orgfiles" :base-directory "~/org/"
-;;		       :base-extension "org"
-;;		       :publishing-directory "/ssh:user@host:~/html/notebook/"
-;;		       :publishing-function org-publish-org-to-html
-;;		       :exclude "PrivatePage.org"   ;; regexp
-;;		       :headline-levels 3
-;;		       :with-section-numbers nil
-;;		       :table-of-contents nil
-;;		       :style "<link rel="stylesheet" href=\"../other/mystyle.css\" type=\"text/css\">"
-;;		       :auto-preamble t
-;;		       :auto-postamble nil)
-;;	   ("images" :base-directory "~/images/"
-;;		     :base-extension "jpg\\|gif\\|png"
-;;		     :publishing-directory "/ssh:user@host:~/html/images/"
-;;		     :publishing-function org-publish-attachment)
-;;	   ("other"  :base-directory "~/other/"
-;;		     :base-extension "css"
-;;		     :publishing-directory "/ssh:user@host:~/html/other/"
-;;		     :publishing-function org-publish-attachment)
-;;         ("website" :components ("orgfiles" "images" "other"))))
-
-;; For more information, see the documentation for the variable
-;; `org-publish-project-alist'.
-
-;; Of course, you don't have to publish to remote directories from
-;; within emacs. You can always just publish to local folders, and
-;; then use the synchronization/upload tool of your choice.
-
-;;; List of user-visible changes since version 1.27
-
-;; 1.78: Allow list-valued :publishing-function
-;; 1.77: Added :preparation-function, this allows you to use GNU Make etc.
-;; 1.65: Remove old "composite projects". They're redundant.
-;; 1.64: Allow meta-projects with :components
-;; 1.57: Timestamps flag is now called "org-publish-use-timestamps-flag"
-;; 1.52: Properly set default for :index-filename
-;; 1.48: Composite projects allowed.
-;;       :include keyword allowed.
-;; 1.43: Index no longer includes itself in the index.
-;; 1.42: Fix "function definition is void" error
-;;       when :publishing-function not set in org-publish-current-file.
-;; 1.41: Fixed bug where index isn't published on first try.
-;; 1.37: Added interactive function "org-publish". Prompts for particular
-;;       project name to publish.
-;; 1.34: Added force-publish option to all interactive functions.
-;; 1.32: Fixed "index.org has changed on disk" error during index publishing.
-;; 1.30: Fixed startup error caused by (require 'em-unix)
+;; Documentation for publishing is in the manual.
 
 ;;; Code:
 
@@ -256,7 +150,7 @@ index of files or summary page for a given project.
   :auto-index            Whether to publish an index during
                          `org-publish-current-project' or `org-publish-all'.
   :index-filename        Filename for output of index.  Defaults
-                         to 'index.org' (which becomes 'index.html').
+                         to 'sitemap.org' (which becomes 'sitemap.html').
   :index-title           Title of index page.  Defaults to name of file.
   :index-function        Plugin function to use for generation of index.
                          Defaults to `org-publish-org-index', which
@@ -598,7 +492,7 @@ If :auto-index is set, publish the index too."
 	  (exclude-regexp (plist-get project-plist :exclude))
 	  (index-p (plist-get project-plist :auto-index))
 	  (index-filename (or (plist-get project-plist :index-filename)
-			      "index.org"))
+			      "sitemap.org"))
 	  (index-function (or (plist-get project-plist :index-function)
 			      'org-publish-org-index))
 	  (preparation-function (plist-get project-plist :preparation-function))
@@ -614,7 +508,7 @@ If :auto-index is set, publish the index too."
 (defun org-publish-org-index (project &optional index-filename)
   "Create an index of pages in set defined by PROJECT.
 Optionally set the filename of the index with INDEX-FILENAME.
-Default for INDEX-FILENAME is 'index.org'."
+Default for INDEX-FILENAME is 'sitemap.org'."
   (let* ((project-plist (cdr project))
 	 (dir (file-name-as-directory
 	       (plist-get project-plist :base-directory)))
@@ -622,7 +516,7 @@ Default for INDEX-FILENAME is 'index.org'."
 	 (indent-str (make-string 2 ?\ ))
 	 (exclude-regexp (plist-get project-plist :exclude))
 	 (files (nreverse (org-publish-get-base-files project exclude-regexp)))
-	 (index-filename (concat dir (or index-filename "index.org")))
+	 (index-filename (concat dir (or index-filename "sitemap.org")))
 	 (index-title (or (plist-get project-plist :index-title)
 			  (concat "Index for project " (car project))))
 	 (index-style (or (plist-get project-plist :index-style)