[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Babel for blogging
From: |
Manuel Giraud |
Subject: |
Re: [Orgmode] Babel for blogging |
Date: |
Mon, 18 Oct 2010 16:22:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) |
Eric S Fraga <address@hidden> writes:
> On Fri, 15 Oct 2010 11:07:05 -0600, "Eric Schulte" <address@hidden> 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:
--8<---------------cut here---------------end--------------->8---
(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 "<link rel=\"stylesheet\"
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"))))
--8<---------------cut here---------------end--------------->8---
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.
--
Manuel Giraud