From: Manuel Giraud <manuel.giraud@univ-nantes.fr>
To: Eric S Fraga <e.fraga@ucl.ac.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: Babel for blogging
Date: Mon, 18 Oct 2010 16:22:58 +0200 [thread overview]
Message-ID: <871v7nmvgd.fsf@univ-nantes.fr> (raw)
In-Reply-To: <87pqvbm53q.wl%ucecesf@ucl.ac.uk> (Eric S. Fraga's message of "Sat, 16 Oct 2010 00:03:05 +0100")
Eric S Fraga <ucecesf@ucl.ac.uk> writes:
> On Fri, 15 Oct 2010 11:07:05 -0600, "Eric Schulte" <schulte.eric@gmail.com> 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
next prev parent reply other threads:[~2010-10-18 14:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-15 16:07 Babel for blogging Manuel Giraud
2010-10-15 17:07 ` Eric Schulte
2010-10-15 17:44 ` Pere Quintana Seguí
2010-10-15 20:32 ` Eric Schulte
2010-10-15 22:13 ` Pere Quintana Seguí
2010-10-16 17:17 ` Olivier Schwander
2010-10-15 23:03 ` Eric S Fraga
2010-10-18 14:22 ` Manuel Giraud [this message]
2010-10-18 21:36 ` Sebastian Rose
2010-10-20 17:09 ` Manuel Giraud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871v7nmvgd.fsf@univ-nantes.fr \
--to=manuel.giraud@univ-nantes.fr \
--cc=e.fraga@ucl.ac.uk \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.