I use org-mode
to publish a blog which is based on org files in a particular directory. I've customized values in html-head, html-preamble, and html-postamble with some Bootstrap code to get the desired html code marked up and everything works well. Accordingly, I've set org-html-head-include-default-style
and org-html-head-include-scripts
to nil
.
I also sometimes use org-mode
to export files in other locations to html which I may sometimes share (e.g., with coworkers). However, because I've set org-html-head-include-default-style
and org-html-head-include-scripts
to nil
, those exports are boring (lack HTML tags that are included by default). I'd like to toggle org-html-head-include-default-style
and org-html-head-include-scripts
depending on where I'm publishing from (e.g., nil
when exporting from my blog directory, other t
when exporting from anywhere else). How do I achieve this?
My org-mode
config is something like the following:
(setq org-html-htmlize-output-type 'css)
(setq org-html-head-include-default-style nil)
(setq org-html-head-include-scripts nil)
(setq org-publish-project-alist
'(("orgfiles"
:base-directory "~/blog/content/"
:base-extension "org"
:publishing-directory "/ssh:[email protected]#22:/blog/"
:recursive t
:html-head "<!-- 3rd party css and js -->
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://blog.com/site/3rdParty.css\"/>
<script src=\"https://blog.com/site/3rdParty.js\"></script>
<!-- Site css and js -->
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://blog.com/site/site.css\"/>
<script src=\"https://blog.com/site/site.js\"></script>"
:html-preamble "... preamble code ..."
:html-postamble "... postamble code ...")))
Do I need to create some function (to toggle org-html-head-include-default-style
and org-html-head-include-scripts
) and a hook for org-publish
depending on my present working directory?