(setq user-full-name "Mez")
(setq org-export-with-toc nil)
(setq org-export-global-macros
'(("theboy" . "[[https://kes.praze.net/@adt][@adt]]")
("dwuser" . "[[https://$1.dreamwidth.org][~$1]]")
("dwcomm" . "[[https://$1.dreamwidth.org][/$1]]")))
(setq org-html-doctype "html5")
(setq org-html-head-include-default-style nil)
(setq org-html-head-include-scripts nil)
(setq org-html-use-infojs nil)
(setq org-html-divs
'((preamble "nav" "nav")
(content "main" "content")
(postamble "footer" "postamble")))
(setq org-html-preamble "\n\n
\n- Fundamentals\n\n
\n- Projects\n\n
\n- Fan content\n\n
\n- Misc.\n\n
\n
")
(setq org-html-postamble "")
(setq thetitle (cadar (org-collect-keywords '("TITLE"))))
(setq pageurl (replace-regexp-in-string "-" "" (file-name-base)))
(setq thedesc (cadar (org-collect-keywords '("OGDESC"))))
(setq thecategory (cadar (org-collect-keywords '("CATEGORY"))))
(setq havecomments (if
(string-match
(cadar (org-collect-keywords '("COMMENTS"))) "t")
t
nil))
(setq org-html-head (concat "\n\n\n\n\n\n\n\n\n\n\n\n\n"))
(defun org-html-template (contents info)
"Return complete document string after HTML conversion.
CONTENTS is the transcoded contents string. INFO is a plist
holding export options."
(concat
(when (and (not (org-html-html5-p info)) (org-html-xhtml-p info))
(let* ((xml-declaration (plist-get info :html-xml-declaration))
(decl (or (and (stringp xml-declaration) xml-declaration)
(cdr (assoc (plist-get info :html-extension)
xml-declaration))
(cdr (assoc "html" xml-declaration))
"")))
(when (not (or (not decl) (string= "" decl)))
(format "%s\n"
(format decl
(or (and org-html-coding-system
;; FIXME: Use Emacs 22 style here, see `coding-system-get'.
(coding-system-get org-html-coding-system 'mime-charset))
"iso-8859-1"))))))
(org-html-doctype info)
"\n"
(concat "\n")
"\n"
(org-html--build-meta-info info)
(org-html--build-head info)
(org-html--build-mathjax-config info)
"\n"
"\n"
(let ((link-up (org-trim (plist-get info :html-link-up)))
(link-home (org-trim (plist-get info :html-link-home))))
(unless (and (string= link-up "") (string= link-home ""))
(format (plist-get info :html-home/up-format)
(or link-up link-home)
(or link-home link-up))))
;; Preamble.
(org-html--build-pre/postamble 'preamble info)
"\n"
;; Document contents.
(let ((div (assq 'content (plist-get info :html-divs))))
(format "<%s id=\"%s\" class=\"%s h-entry\">\n"
(nth 1 div)
(nth 2 div)
(plist-get info :html-content-class)))
"
\n"
;; Document title.
(when (plist-get info :with-title)
(let ((title (and (plist-get info :with-title)
(plist-get info :title)))
(subtitle (plist-get info :subtitle))
(html5-fancy (org-html--html5-fancy-p info)))
(when title
(format
(if html5-fancy
""
"%s%s
\n")
(org-export-data title info)
(if subtitle
(format
(if html5-fancy
"%s
\n"
(concat "\n" (org-html-close-tag "br" nil info) "\n"
"%s\n"))
(org-export-data subtitle info))
"")))))
"\n"
"\n"
contents
"
\n"
(if havecomments
"\n")
"\n"
"
\n
\n
Mez
\n
\n
" thecategory "\n
\n"
"\n"
(format "%s>\n" (nth 1 (assq 'content (plist-get info :html-divs))))
;; Postamble.
(org-html--build-pre/postamble 'postamble info)
"
\n"
"
\n"
;; Possibly use the Klipse library live code blocks.
(when (plist-get info :html-klipsify-src)
(concat ""))
(if havecomments
"\n")
;; Closing document.
"\n"))
(defun my-html-filter-nobreaks (text backend info)
"Keep non-breaking spaces in HTML org export"
(when (org-export-derived-backend-p backend 'html)
(replace-regexp-in-string " " " " text)))
(if (string-equal system-type "android")
(setq org-export-filter-plain-text-functions
'my-html-filter-nobreaks)
(add-to-list 'org-export-filter-plain-text-functions
'my-html-filter-nobreaks))
(defun my-org-export-add-target-blank-to-http-links (text backend info)
"Add target=\"_blank\" to external links."
(when (and
(org-export-derived-backend-p backend 'html)
(string-match "href=\"http[^\"]+" text)
(not (string-match "target=\"" text)))
(string-match "