From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Fully featured Web publishing Date: Wed, 18 Mar 2009 17:04:27 +0100 Message-ID: <871vsuakc4.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, I'd like to use Org exclusively for composing and then publishing my Web si= te. 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 tha= n I am... The features I need are: - Conditional CSS [if IE] - Favicon - JavaScript for Google Analytics - Date in the copyright - Contextual navigation menu 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: --8<---------------cut here---------------start------------->8--- (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")))) --8<---------------cut here---------------end--------------->8--- Hence, specifying file names instead of file contents for both the header a= nd 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 ni= ce 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 co= uld 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: --8<---------------cut here---------------start------------->8--- Last Updated: (format-time-string muse-footer-date-format (nth 5 (file-attributes (muse-current-file)))) --8<---------------cut here---------------end--------------->8--- 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 curr= ent 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: --8<---------------cut here---------------start------------->8--- (setq nav-menu '((\"Home\" . \"index.html\") (\"About Me\" . ( (\"CV\" . \"curricu= lum-vitae.html\") (\"PGP Public Key\" . \"pgp-publi= c-key.html\") (\"Contact Me\" . \"contact-m= e.html\"))) (\"Resources\" . ( (\"Ubuntu\" . \"ubuntu.= html\") (\"Emacs\" . \"dot-emacs= .html\"))))) --8<---------------cut here---------------end--------------->8--- and in the footer file: --8<---------------cut here---------------start------------->8---

Navigation

(my-muse-generate-nav-menu)
--8<---------------cut here---------------end--------------->8--- with the following (ugly -- caus' it should be written in a recursive way= !) definition for `my-muse-generate-nav-menu': --8<---------------cut here---------------start------------->8--- (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 "
    \n") (while nav-menu (progn (if (not (listp (cdr (car nav-menu)))) (setq html-menu (concat html-menu "
  • " (caar nav-menu) "
  • \n")) (progn (setq html-menu (concat html-menu "
  • " (caar nav-menu) "\n" "
      \n")) (setq nav-submenu (cdr (car nav-menu))) (while nav-submenu (setq html-menu (concat html-menu "
    • " (caar nav-submenu) "
    • \n")) (setq nav-submenu (cdr nav-submenu))) (setq html-menu (concat html-menu "
    \n
  • \n")))) (setq nav-menu (cdr nav-menu)))) (setq html-menu (concat html-menu "
")) html-menu)) --8<---------------cut here---------------end--------------->8--- 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 --=20 S=C3=A9bastien=C2=A0Vauban _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode