ppsreejith / org-publish-html-template

A simple guide to setting up org mode to publish to a clean website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

A simple, customizable org publish demo

Instructions

Publishing

Spacemacs

  1. Access a file, for example ./src/index.org.
  2. Use ~, e e P p~ to publish the project. The output will be in the public folder.

Troubleshooting

If you’re facing problems with publishing, do the following to do a clean publish.

  1. Run rm ./public/ to clear the published directory.
  2. Run rm -rf ~/.emacs.d/.cache/.org-timestamps/ to clear the org cache.

New Post

To create a new post in the folder src/posts/year/month/date/post-name.org, use the following function after replacing /path/to/project with the actual path to your project.

(defun new-post ()
  ;; prompt for post name
  ;; replace spaces with dashes
  ;; prepend today's date
  ;; add .org
  ;; open file buffer
  (interactive
   (let*  ((name (read-string "Post name: " nil 'my-history))
           (posts-dir "~/path/to/project/")
           (date (format-time-string "%Y/%m/%d")))
     (find-file (concat posts-dir (downcase (format "%s/%s.org" date (replace-regexp-in-string " +" "-" name)))))
     (insert "#+INCLUDE: \"../../../../options/default-config.org\"\n")
     (insert (format "#+SUBTITLE: %s\n\n" name))
     (org-mode)
     )))

About

A simple guide to setting up org mode to publish to a clean website


Languages

Language:Emacs Lisp 100.0%