From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Babel for blogging Date: Mon, 18 Oct 2010 23:36:24 +0200 Message-ID: <87eibnmbdz.fsf@gmx.de> References: <87y69zqw20.fsf@univ-nantes.fr> <87ocavfkqu.fsf@gmail.com> <87pqvbm53q.wl%ucecesf@ucl.ac.uk> <871v7nmvgd.fsf@univ-nantes.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=58470 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7xNj-0002rP-3R for emacs-orgmode@gnu.org; Mon, 18 Oct 2010 17:36:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7xNg-0006bV-6Y for emacs-orgmode@gnu.org; Mon, 18 Oct 2010 17:36:34 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:53371 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1P7xNf-0006b9-SA for emacs-orgmode@gnu.org; Mon, 18 Oct 2010 17:36:32 -0400 In-Reply-To: <871v7nmvgd.fsf@univ-nantes.fr> (Manuel Giraud's message of "Mon, 18 Oct 2010 16:22:58 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Manuel Giraud Cc: emacs-orgmode@gnu.org Manuel Giraud writes: > Eric S Fraga writes: > >> On Fri, 15 Oct 2010 11:07:05 -0600, "Eric Schulte" wrote: >>> >>> Hi Manuel, >>> >>> The following works for me, it creates an index of all files in the same >>> directory as the Org-mode file. >>> >>> --8<---------------cut here---------------start------------->8--- >>> * index >>> >>> Create an index automatically with an elisp code block. >>> >>> #+begin_src emacs-lisp :exports results :results raw >>> (mapconcat >>> (lambda (file) >>> (unless (file-directory-p file) >>> (format "- [[%s][%s]]" (file-name-sans-extension file) file))) >>> (directory-files (or default-directory >>> (file-name-directory (buffer-file-name)))) >>> "\n") >>> #+end_src >>> --8<---------------cut here---------------end--------------->8--- >> >> Maybe the format statement should look like this instead (swap the two >> arguments to the format string around): >> >> : (format "- [[%s][%s]]" file (file-name-sans-extension file)))) >> >> Also, maybe change the link to include the current directory: >> >> : (format "- [[./%s][%s]]" file (file-name-sans-extension file)))) >> >> Just some thoughts late on a Friday night... ;-) > > Thanks that does the trick. But searching the org-mode source (version > 7.01trans) , I discovered that this function is already here (called > sitemap instead of index). So now, I can generate the correct sitemap > with the following project: > > > (setq org-publish-project-alist > '(("orgfiles" > :base-directory "~/org/" > :base-extension "org" > :publishing-directory "~/public_html/" > :publishing-function org-publish-org-to-html > :section-numbers nil > :table-of-contents nil > :auto-sitemap t > :sitemap-title "Blog" > :style " href=\"blog.css\" > type=\"text/css\"/>") > ("css" > :base-directory "~/org/" > :base-extension "css" > :publishing-directory "~/public_html/" > :publishing-function org-publish-attachment) > ("blog" :components ("orgfiles" "css")))) > > What's missing now is that the sitemap list is ordered alphabetically > and I'd like to have it sorted by modification time or, even better, by > there #+date tag. It's there, too. See C-h v org-publish-project-alist " If you create a sitemap file, adjust the sorting like this: :sitemap-sort-folders Where folders should appear in the sitemap. Set this to `first' (default) or `last' to display folders first or last, respectively. Any other value will mix files and folders. :sitemap-alphabetically The site map is normally sorted alphabetically. Set this explicitly to nil to turn off sorting. :sitemap-ignore-case Should sorting be case-sensitive? Default nil. " Sebastian