(require 'package) (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("elpa" . "https://elpa.gnu.org/packages/"))) (package-initialize) (unless package-archive-contents (package-refresh-contents)) (setq org-export-with-broken-links 'mark) (package-install 'htmlize) (require 'htmlize) (package-install 'simple-httpd) (package-install 'websocket) (package-install 'org-roam) (package-install 'org-roam-ui) (package-install 'f) (require 'org-roam) (require 'org-roam-ui) (require 'ox-publish) (setq org-export-html-coding-system 'utf-8-unix) (setq org-html-doctype "html5") (defvar fschlde-html-head "") (setq fschlde-html-footer " ") ;; following two funcs are taken from ;; https://www.orgroam.com/manual.html#How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f ;; sitemap function for my roam-publish (defun roam-sitemap (title list) (concat "#+OPTIONS: ^:nil author:nil html-postamble:nil\n" "#+SETUPFILE: ./simple_inline.theme\n" "#+TITLE: " title "\n\n" (org-list-to-org list) "\nfile:sitemap.svg")) (setq my-publish-time 0) ; see the next section for context ;; (defun roam-publication-wrapper (plist filename pubdir) (org-roam-graph) (org-html-publish-to-html plist filename pubdir) (setq my-publish-time (cadr (current-time)))) (defun org-roam-custom-link-builder (node) (let ((file (org-roam-node-file node))) (concat (file-name-base file) ".html"))) (setq org-roam-graph-link-builder 'org-roam-custom-link-builder) (add-hook 'org-roam-graph-generation-hook (lambda (dot svg) (if (< (- (cadr (current-time)) my-publish-time) 5) (progn (copy-file svg "~/projects/blog-fschlde/pkb/sitemap.svg" 't) (kill-buffer (file-name-nondirectory svg)) (setq my-publish-time 0))))) (setq org-publish-project-alist '(("website" :components ("org-journal", "project-notes", "org-sites", "blog-rss", "blog-images")) ("org-journal" :base-directory "~/Documents/Org/" :base-extension "org" :publishing-directory "~/projects/blog-fschlde/reads/" :recursive nil :publishing-function org-html-publish-to-html :headline-levels 4 :with-author t :with-creator nil :with-date t :with-toc t :with-drawers nil :html-link-home "/" :html-head nil ;; cleans up anything that would have been in there. ;; :html-head-extra ,my-blog-extra-head :html-head-include-default-style nil :html-head-include-scripts nil ;; :html-preamble my-blog-header ;; :html-postamble ,my-blog-footer ) ("project-notes" :base-directory "~/projects/" :base-extension "org" :publishing-directory "~/projects/blog-fschlde/projects/" :recursive nil :publishing-function org-html-publish-to-html :headline-levels 4) ("org-sites" :base-directory "~/projects/fschlde-static/" :base-extension "org\\|css\\|js\\|ico\\|png\\|html" :publishing-directory "~/projects/blog-fschlde/" :recursive t :publishing-function org-publish-attachment :html-link-home "/" ;; :html-head ,fschlde-html-head ;; cleans up anything that would have been in there. :html-head-include-default-style nil :html-head-include-scripts nil :with-drawers nil :with-creator nil ;; :html-head-extra fschlde-html-head ;; :html-postamble fschlde-html-footer :headline-levels 4) ("roam" :base-directory "~/org-roam/" :auto-sitemap t :recursive nil :base-extension "org" :exclude ".stversions/\\|.stfolder" :sitemap-function roam-sitemap :sitemap-title "Roam notes" :publishing-function roam-publication-wrapper :publishing-directory "~/projects/blog-fschlde/pkb/" :section-number nil :table-of-contents nil :style "") ) )