From: Sebastian Rose <sebastian_rose@gmx.de>
To: "Sébastien Vauban" <zthjwsqqafhv@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Fully featured Web publishing
Date: Wed, 18 Mar 2009 17:57:22 +0100 [thread overview]
Message-ID: <87ljr2ahvx.fsf@kassiopeya.MSHEIMNETZ> (raw)
In-Reply-To: <871vsuakc4.fsf@mundaneum.com> ("Sébastien Vauban"'s message of "Wed, 18 Mar 2009 17:04:27 +0100")
Sébastien Vauban <zthjwsqqafhv@spammotel.com> writes:
> Hello,
>
> 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 features I need are:
>
> - Conditional CSS [if IE]
> - Favicon
Both can be achieved through the
#+STYLE:
options. Multiple lines possible. Those lines are added to the `<head>'
section of the resulting documents.
Also, you might take a look into the documentation for
org-publish-project-alist in
http://orgmode.org/manual/Sample-configuration.html#Sample-configuration
> - JavaScript for Google Analytics
> - Date in the copyright
> - Contextual navigation menu
#+begin_html
your menu here
#+end_html
#+begin_html
your analytics script here
#+end_html
Regards,
Sebastian
> I'll come back into more details to these.
>
> All of these were coded in the header or footer of each page with Muse. What
> was good, is that I could write:
>
>
> (setq muse-project-alist
> `(
> ("My-Muse-Public-Website"
> ("~/Public/Websites/Muse/source/" :default "index")
> (:base "xhtml"
> :path "~/Public/Websites/Muse/publish/"
> :header "~/Public/Websites/Muse/source/header.html"
> :footer "~/Public/Websites/Muse/source/footer.html"))))
>
> Hence, specifying file names instead of file contents for both the header and
> footer. This is good, as I don't have to change my .emacs file every time I
> wanna change the way my pages have to look like. Such a feature would be nice
> for Org as well. Is it scheduled? Can we achieve the same result otherwise?
>
> Regarding the above features:
>
> - Conditional CSS [if IE]
>
> Can be coded in the common header string. OK.
>
> - Favicon
>
> Can be coded in the common header string -- if it's a common one for all my
> Web site. How can we specify on a per page basis? This more or less comes
> down to the recent addition of the `keywords' and `description' meta tags
> (thanks Carsten).
>
> - JavaScript for Google Analytics
>
> Can be coded in the common header string. OK.
>
> - Date in the copyright
>
> Can be coded in the common footer string. Well, it would be nice if it could
> be computed somehow, and be for example (depending of user prefs) the date
> when the file (or page) has been changed.
>
> Hence, it's not specifically a data that's common to every page of my Web
> site. How can we do this?
>
> This is what I did with Emacs Muse, embedding Emacs Lisp in the footer:
>
>
> Last Updated:
> <lisp>
> (format-time-string muse-footer-date-format
> (nth 5 (file-attributes (muse-current-file))))
> </lisp>
>
> but I think this is not currently possible with Org, right? Is there some
> other solution?
>
> - Contextual navigation menu
>
> Finally, 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 the following (ugly -- caus' it should be written in a recursive way!)
> definition for `my-muse-generate-nav-menu':
>
>
> (defun my-muse-generate-nav-menu ()
> (let* ((html-menu "")
> (cur-path-muse (muse-current-file))
> (cur-path-html
> (replace-regexp-in-string "\\.muse" ".html" cur-path-muse)))
> (setq html-menu "<ul>\n")
> (while nav-menu
> (progn
> (if (not (listp (cdr (car nav-menu))))
> (setq html-menu
> (concat html-menu
> "<li><a href=\"" (cdr (car nav-menu))
> "\" title=\"" (caar nav-menu) "\""
> (if (string-match
> (concat ".*" (cdr (car nav-menu)) "$")
> cur-path-html)
> " class=\"current\""
> "")
> ">" (caar nav-menu) "</a></li>\n"))
> (progn
> (setq html-menu
> (concat html-menu
> "<li>" (caar nav-menu) "\n" "<ul>\n"))
>
> (setq nav-submenu (cdr (car nav-menu)))
> (while nav-submenu
> (setq html-menu
> (concat html-menu
> "<li><a href=\"" (cdr (car nav-submenu))
> "\" title=\"" (caar nav-submenu) "\""
> (if (string-match
> (concat ".*" (cdr (car nav-submenu)) "$")
> cur-path-html)
> " class=\"current\""
> "")
> ">" (caar nav-submenu) "</a></li>\n"))
> (setq nav-submenu (cdr nav-submenu)))
>
> (setq html-menu (concat html-menu "</ul>\n</li>\n"))))
> (setq nav-menu (cdr nav-menu))))
> (setq html-menu (concat html-menu "</ul>"))
> html-menu))
>
> How can I do such a thing in Org?
>
> THANK YOU VERY MUCH for all the hints or help you can provide me with!
>
> I really want to go the Org way for all my composed stuff...
>
> Best regards,
> Seb
--
Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover
Tel.: +49 (0)511 - 36 58 472
Fax: +49 (0)1805 - 233633 - 11044
mobil: +49 (0)173 - 83 93 417
Email: s.rose@emma-stil.de, sebastian_rose@gmx.de
Http: www.emma-stil.de
next prev parent reply other threads:[~2009-03-18 16:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 16:04 Fully featured Web publishing Sébastien Vauban
2009-03-18 16:57 ` Sebastian Rose [this message]
2009-03-18 21:20 ` Sébastien Vauban
2009-03-18 22:38 ` Sebastian Rose
2009-03-18 22:56 ` Rasmus Pank Roulund
2009-03-18 23:19 ` Richard Riley
2009-03-19 7:46 ` Rasmus Pank Roulund
2009-03-19 8:28 ` Richard Riley
2009-03-19 9:43 ` Sébastien Vauban
2009-03-23 11:36 ` Sébastien Vauban
2009-03-23 13:50 ` Taru Karttunen
2009-03-19 10:37 ` Sebastian Rose
2009-03-19 13:38 ` Richard Riley
2009-03-19 15:03 ` Sebastian Rose
2009-03-19 16:12 ` Matthew Lundin
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=87ljr2ahvx.fsf@kassiopeya.MSHEIMNETZ \
--to=sebastian_rose@gmx.de \
--cc=emacs-orgmode@gnu.org \
--cc=zthjwsqqafhv@spammotel.com \
/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.