Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
116 lines (98 sloc) 4.04 KB
;;; ~/src/etc/doom/.doom.d/blog.el -*- lexical-binding: t; -*-
;; __...--~~~~~-._ _.-~~~~~--...__
;; // `V' \\
;; // | \\
;; //__...--~~~~~~-._ | _.-~~~~~~--...__\\
;; //__.....----~~~~._\ | /_.~~~~----.....__\\
;; ====================\\|//====================
;; dwb `---`
;;; REQUIRES
(require 'ox-html)
(require 'ox-rss)
;;; GLOBAL VARIABLES
;; where you're storing your files
(setq blog/site-project-path "/home/hazel/Documents/blog/")
;; where you want the exported HTML to go
(setq blog/site-publish-path (concat blog/site-project-path "build/"))
;; extra things to put in the header
(setq blog/site-extra-head "<link rel='stylesheet' href='./static/main.css' />")
;; extra html to put in the header
(setq blog/site-header-file (concat blog/site-project-path "templates/header.html"))
;; extra html to put in the footer
(setq blog/site-footer-file (concat blog/site-project-path "templates/footer.html"))
;; eliminate external deps
(setq blog/mathjax-options
'((path "./static/mj/MathJax.js?config=TeX-AMS-MML_HTMLorMML")
(scale "100") (align "left") (indent "2em") (tagside "right")
(mathml nil) (font "Neo-Euler")))
;;; FUNCTIONS
(defun blog/add-html-file (arg)
(with-temp-buffer
(insert-file-contents arg)
(buffer-string)))
(defun blog/site-format-entry (entry style project)
(format "[[file:%s][%s]] --- %s"
entry
(org-publish-find-title entry project)
(format-time-string "%Y-%m-%d" (org-publish-find-date entry project))))
(setq blog/site-header-raw (blog/add-html-file blog/site-header-file))
(setq blog/site-footer-raw (blog/add-html-file blog/site-footer-file))
;;; ORG-PUBLISH
(setq org-publish-project-alist
`(("site"
:components ("site-static", "site-images", "site-articles", "site-dl", "site-rss"))
("site-static"
:base-directory ,(concat blog/site-project-path "static/")
:base-extension ".*"
:publishing-directory ,(concat blog/site-publish-path "static/")
:publishing-function org-publish-attachment
:recursive t)
("site-images"
:base-directory ,(concat blog/site-project-path "img")
:base-extension ".*"
:publishing-directory ,(concat blog/site-publish-path "img/")
:publishing-function org-publish-attachment
:recursive t)
("site-dl"
:base-directory ,(concat blog/site-project-path "dl")
:base-extension ".*"
:publishing-directory ,(concat blog/site-publish-path "dl/")
:publishing-function org-publish-attachment
:recursive t)
("site-rss"
:base-directory ,(concat blog/site-project-path "articles/")
:base-extension "org"
:publishing-directory ,blog/site-publish-path
:publishing-function org-rss-publish-to-rss
:html-link-home "https://qtp2t.club"
:html-link-use-abs-url t
:title "Ziodyne"
:section-numbers nil
:exclude ".*"
:include ("index.org")
:table-of-contents nil)
("site-articles"
:base-directory ,(concat blog/site-project-path "articles/")
:base-extension "org"
:publishing-directory ,blog/site-publish-path
:html-doctype "html5"
:html-link-home "/"
:html-head nil
:html-head-extra ,blog/site-extra-head
:html-head-include-default-style nil
:html-head-include-scripts nil
:html-home/up-format ""
:html-preamble ,blog/site-header-raw
:html-postamble ,blog/site-footer-raw
:html-mathjax-options ,blog/mathjax-options
:makeindex nil
:auto-sitemap t
:sitemap-filename "index.org"
:sitemap-title "Ramblings"
:sitemap-style list
:sitemap-sort-files anti-chronologically
:sitemap-format-entry blog/site-format-entry
:with-toc nil
:section-numbers nil
:publishing-function org-html-publish-to-html
:recursive t)))
You can’t perform that action at this time.