work.el: Handle files both under en/, fr/, and root.

This commit is contained in:
Sergiu Ivanov 2018-09-30 21:38:51 +02:00
parent 7732e866ad
commit 57d0d22d7f

35
work.el
View file

@ -32,17 +32,24 @@
(make-powered-by lang) (make-powered-by lang)
"</span>")) "</span>"))
;; Produce the <link> tag including the stylesheet relative to the
;; given root.
(defun make-styles (root)
(concat "<link rel=\"stylesheet\" type=\"text/css\" href=\"" root "content/css/default.css\" />"))
;; Produce the preamble with links relative to the given root.
(defun make-preamble (root)
(concat "
<span class=\"myname\">Sergiu Ivanov</span>
<span class=\"logos\">
<a href=\"https://www.ibisc.univ-evry.fr/\"><img src=\"" root "content/imgs/ibisc.png\" alt=\"lab logo\" class=\"ibisclogo\" /></a>
<a href=\"https://www.univ-evry.fr/accueil.html\"><img src=\"" root "content/imgs/ueve.png\" alt=\"university logo\" class=\"uevelogo\" /></a>
</span>"))
;; Set up org-publish for my work site. ;; Set up org-publish for my work site.
(let* ((work-base "~/Candies/Sites/work/") (let* ((work-base "~/Candies/Sites/work/")
(publishing-base (concat work-base "www/")) (publishing-base (concat work-base "www/")))
(my-styles "<link rel=\"stylesheet\" type=\"text/css\" href=\"../content/css/default.css\" />")
(my-preamble "
<span class=\"myname\">Sergiu Ivanov</span>
<span class=\"logos\">
<a href=\"https://www.ibisc.univ-evry.fr/\"><img src=\"../content/imgs/ibisc.png\" alt=\"lab logo\" class=\"ibisclogo\" /></a>
<a href=\"https://www.univ-evry.fr/accueil.html\"><img src=\"../content/imgs/ueve.png\" alt=\"university logo\" class=\"uevelogo\" /></a>
</span>"))
(setq org-publish-project-alist (setq org-publish-project-alist
@ -62,8 +69,8 @@
:html-head-include-default-style nil :html-head-include-default-style nil
:html-head-include-scripts nil :html-head-include-scripts nil
:html-head-extra ,my-styles :html-head-extra ,(make-styles "../")
:html-preamble ,my-preamble :html-preamble ,(make-preamble "../")
:html-postamble ,(make-postamble 'en)) :html-postamble ,(make-postamble 'en))
@ -82,8 +89,8 @@
:html-head-include-default-style nil :html-head-include-default-style nil
:html-head-include-scripts nil :html-head-include-scripts nil
:html-head-extra ,my-styles :html-head-extra ,(make-styles "")
:html-preamble ,my-preamble :html-preamble ,(make-preamble "")
:html-postamble ,(make-postamble 'en)) :html-postamble ,(make-postamble 'en))
@ -99,8 +106,8 @@
:html-head-include-default-style nil :html-head-include-default-style nil
:html-head-include-scripts nil :html-head-include-scripts nil
:html-head-extra ,my-styles :html-head-extra ,(make-styles "../")
:html-preamble ,my-preamble :html-preamble ,(make-preamble "../")
:html-postamble ,(make-postamble 'fr)) :html-postamble ,(make-postamble 'fr))