emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Fully featured Web publishing


From: Sébastien Vauban
Subject: [Orgmode] Re: Fully featured Web publishing
Date: Wed, 18 Mar 2009 22:20:49 +0100
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux)

Hi Sebastian,

Sebastian Rose wrote:
> Sébastien Vauban <address@hidden> writes:
>> I'd like to use Org exclusively for composing and then publishing my Web 
>> site.
>> I've done it so far with Emacs Muse, but I have a strong deepish attraction 
>> to
>> go the Org way, for many different reasons you must be aware of -- more than 
>> I
>> am...
>>
>>   [...]
>>
>>   The only real problem that I see (the above being nice-to-have's) is the
>>   following: I want to have a common navigation menu, but whose current
>>   page is highlighted. To do so, I just have to add the class `current' to
>>   the current entry, but this means the navigation menu is not constant
>>   between pages!
>>
>>   I did that with Muse doing so:
>>
>>   (setq nav-menu '((\"Home\" .            \"index.html\")
>>                    (\"About Me\" .        ( (\"CV\"             . 
>> \"curriculum-vitae.html\")
>>                                           (\"PGP Public Key\" . 
>> \"pgp-public-key.html\")
>>                                           (\"Contact Me\"     . 
>> \"contact-me.html\")))
>>                    (\"Resources\" .       ( (\"Ubuntu\"         . 
>> \"ubuntu.html\")
>>                                           (\"Emacs\"          . 
>> \"dot-emacs.html\")))))
>>
>>   and in the footer file:
>>
>>             <div id=\"navigation\">
>>                 <h2>Navigation</h2>
>>                 <lisp>(my-muse-generate-nav-menu)</lisp>
>>             </div>
>>
>>   with:
>>
>>         (defun my-muse-generate-nav-menu ()
>>          [...]
>>                                     (if (string-match
>>                                          (concat ".*" (cdr (car 
>> nav-submenu)) "$")
>>                                          cur-path-html)
>>                                         " class=\"current\""
>>                                       "")
>>          [...]
>>
>>   How can I do such a thing in Org?
>
> #+begin_html
>
>   your menu here
>
> #+end_html

Thanks for the other (useful) info. But, here, your answer is not adequate as
I don't want to have almost identical information duplicated in each page of
my site. Just imagine the pain it is if I want to change the structure (adding
a new page in my menu -- I have to update all my pages!).

The trick I used with Muse was to make that automatically computed:

    o   having a menu defined only once;

    o   per page, adding the `current' keyword on the adequate item --
        automatically done by the above function.

Adding a page in my Web site means just updating one variable: the menu
definition. Nothing more to do...

Is there, then, a similar solution?  Or, at least, one achieving the same
results by other means?

Best regards,
  Seb

-- 
Sébastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]