Publishing org-mode notes as a website

A summary of my note taking and publishing process with org-mode.


I have a ~/notes/2019/ folder, which I put all of my notes. Inside this, I have many sub-folders for the categories, for example, emacs, css, javascript,… and inside each category, there will be a lot of articles as .org files.

I manage my notes offline with org-journal-list.el (alert: shameless PR), sometimes, I also use deft for quick search, but its auto file creating feature just doesn't fit my workflow.

The following config helps me publish my notes into HTML files and put them at ~/notes/html, I also have a _css folder containing a copy of tufte-css, a cool CSS template with great typography settings.

(defun org-sitemap-custom-entry-format (entry style project)
  (let ((filename (org-publish-find-title entry project)))
    (if (= (length filename) 0)
        (format "*%s*" entry)
      (format "%s - [[file:%s][%s]]"
              (format-time-string "%Y-%m-%d" (org-publish-find-date entry project))

(setq org-publish-project-alist
         :base-directory "/Users/huy/notes/2019/"
         :base-extension "org"
         :publishing-directory "/Users/huy/notes/html/"
         :recursive t
         :publishing-function org-html-publish-to-html
         :exclude "todo.org"
         :auto-sitemap t
         :sitemap-filename "index.org"
         :sitemap-title "~/notes/2019/"
         :sitemap-format-entry org-sitemap-custom-entry-format
         :html-head-extra "<link rel=\"stylesheet\" href=\"/_css/style.css\">"
         :html-link-home "/"

Date: 2019-01-14 Mon 00:00

Author: Huy Tran

Created: 2019-04-22 Mon 14:41