website/publish.el
2024-04-14 20:08:26 -05:00

86 lines
3.5 KiB
EmacsLisp

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(setq package-load-list '((htmlize t)))
(package-initialize)
(unless (package-installed-p 'htmlize)
(package-refresh-contents)
(package-install 'htmlize)
(package-install 'ox-rss))
(require 'org)
(require 'ox-html)
(require 'ox-rss)
(defun my/org-publish-org-sitemap-format (entry style project)
(cond ((not (directory-name-p entry))
(format "(%s) [[file:%s][%s]]\n"
(format-time-string "%Y-%m-%d"
(org-publish-find-date entry project))
entry
(org-publish-find-title entry project)))))
(setq org-publish-project-alist
'(
("org-notes"
:base-directory "~/website/"
:base-extension "org"
:publishing-directory "~/public_html/"
:recursive t
:publishing-function org-html-publish-to-html
:with-toc nil
:headline-levels 4
:section-numbers nil
:html-head "<link rel='stylesheet' href='/css/stylesheet.css' type='text/css'/>"
:html-preamble "<div class='topnav'><a href='/'>Home</a><a href='/projects.html'>Projects</a><a href='/blog'>Blog</a><a href='/config.html'>Dotfiles</a><a href='/about.html'>About Me</a></div>"
:html-postamble nil)
("org-static"
:base-directory "~/website/"
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
:publishing-directory "~/public_html"
:recursive t
:publishing-function org-publish-attachment)
("org-blog"
:base-directory "~/blog/"
:base-extension "org"
:publishing-directory "~/public_html/blog"
:recursive t
:publishing-function org-html-publish-to-html
:with-toc nil
:with-properties t
:with-date t
:with-timestamps nil
:headline-levels 4
:section-numbers nil
:html-head "<link rel='stylesheet' href='/css/stylesheet.css' type='text/css'/>"
:html-preamble "<div class='topnav'><a href='/'>Home</a><a href='/projects.html'>Projects</a><a href='/blog'>Blog</a><a href='/config.html'>Dotfiles</a><a href='/about.html'>About Me</a></div>"
:html-postamble nil
:auto-sitemap t
:sitemap-filename "index.org"
:sitemap-format-entry my/org-publish-org-sitemap-format
:sitemap-sort-files anti-chronologically
:sitemap-title "Blog")
("org-rss"
:base-directory "~/blog/"
:base-extension "org"
:html-link-home "https://jjanzen.ca"
:html-link-use-abs-url t
:rss-extension "xml"
:publishing-directory "~/public_html/rss"
:publishing-function (org-rss-publish-to-rss)
:section-numbers nil
:exclude ".*"
:include ("index.org")
:table-of-contents nil)
("org-config"
:base-directory "~/.doom.d/"
:base-extension "org"
:html-head "<link rel='stylesheet' href='/css/stylesheet.css' type='text/css'/>"
:html-preamble "<div class='topnav'><a href='/'>Home</a><a href='/projects.html'>Projects</a><a href='/blog'>Blog</a><a href='/config.html'>Dotfiles</a><a href='/about.html'>About Me</a></div>"
:html-postamble nil
:publishing-directory "~/public_html"
:publishing-function org-html-publish-to-html
:headline-levels 4
:auto-preamble t)
("org" :components ("org-notes" "org-static" "org-config"))))
(org-publish-all t)