(require 'ox-publish) (require 'package) (setq package-user-dir (expand-file-name "./.packages")) (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("elpa" . "https://elpa.gnu.org/packages/"))) ;; Initialize the package system (package-initialize) (unless package-archive-contents (package-refresh-contents)) ;; Install dependencies (package-install 'htmlize) (defun get-org-file-title(entry style project) (setq timestamp (org-timestamp-format (car (org-publish-find-property entry :date project)) "%B %d, %Y")) (setq tag-list (org-publish-find-property entry :filetags project)) (setq tag-list-str (mapconcat 'identity tag-list ",")) (setq result (format "%s created on %s\n#+begin_sitemap_tag\n%s\n#+end_sitemap_tag\n" (org-publish-sitemap-default-entry entry style project) timestamp tag-list-str)) ) (defun my-sitemap-function (title list) (concat "#+TITLE: " title "\n\n" "#+DATE: " (format-time-string "%Y-%m-%d at %H:%M") "\n\n" "#+HTML_LINK_HOME: /\n\n" "#+HTML_LINK_UP: /\n\n" (org-list-to-org list))) (setq org-publish-project-alist (list (list "matthewkosarek.xyz" :recursive t :base-directory "./_posts" :publishing-directory "./posts" :publishing-function: 'org-html-publish-to-html :with-toc nil :with-author nil :section-numbers nil :time-stamp-file nil :with-title nil :with-date nil :html-preamble-format '(("en" "