Org-Page Setup

Round 2, electric boogaloo

So it seems that my publishing package oblog has suffered from bit rot. This is the problem with open source software. Because it's free, people have to have free time to work on it. When there is an upgrade to the OS, sometimes people can't upgrade their software.

Also, it doesn't help that I didn't keep my copy of o-blog up to date.

So now it is a new platform.

Setup (for development)

(add-to-list 'load-path "~/projects/emacs/org-page")
(require 'org-page)
(setq op/repository-directory
      (expand-file-name (concat (file-name-directory (buffer-file-name))
                                "..")))
(setq op/site-domain "http://www.jonnay.net")

Categories

(setq op/category-ignore-list 
      (append op/category-ignore-list 
             '("private" "publish" "bunny" "blog" "media")))
(setq op/category-config-alist
      '(("blog" :show-meta t 
                :show-comment t
                   :uri-generator op/generate-uri
                   :uri-template "/ableton/%y/%m/%d/%t/"
                   :sort-by :date
                   :category-index t)
        ("index" :show-meta nil 
                 :show-comment nil 
                 :uri-generator op/generate-uri 
                 :uri-template "/" 
                 :sort-by :date 
                 :category-index nil)
        ("epk" :show-meta nil 
               :show-comment nil 
               :uri-generator op/generate-uri 
               :uri-template "/epk/" 
               :sort-by :date 
               :category-index nil)
        ("ableton" :show-meta t
                   :show-comment t
                   :uri-generator op/generate-uri
                   :uri-template "/ableton/%y/%m/%d/%t/"
                   :sort-by :date
                   :category-index t)
        ("code" :show-meta t
                :show-comment t
                :uri-generator op/generate-uri
                :uri-template "/code/%y/%m/%d/%t/"
                :sort-by :date
                :category-index t)
        ("meta" :show-meta t
                :show-comment t
                :uri-generator op/generate-uri
                :uri-template "/meta/%y/%m/%d/%t/"
                :sort-by :date
                :category-index t)
        ("music" :show-meta t
                 :show-comment t
                 :uri-generator op/generate-uri
                 :uri-template "/music/%y/%m/%d/%t/"
                 :sort-by :date
                 :category-index t)
        ("video" :show-meta t
                 :show-comment t
                 :uri-generator op/generate-uri
                 :uri-template "/video/%y/%m/%d/%t/"
                 :sort-by :date
                 :category-index t)))

Templates

Set our theme directory to something reasonable:

(setq op/theme-root-directory (expand-file-name "themes"))
(setq op/theme 'jonnay)

Less / Bootstrap / Etc.

(defun jonnay/compile-all-less ()
  (interactive)
  (with-helm-default-directory (expand-file-name "meta/themes/jonnay" op/repository-directory)
    (shell-command "lessc site.less resources/css/site.css")
    (shell-command "lessc site.less ../../../publish/media/css/site.css")))

Publishing

When building your theme, you want to start with:

(defun jonnay-site/full-pub ()
  (interactive)
  (delete-directory (expand-file-name "publish" op/repository-directory) t t)
  (op/do-publication-and-preview-site (expand-file-name "publish/" op/repository-directory)))

But then quickly jump to:

(defun jonnay-site/pub ()
  (interactive)
  (op/do-publication t nil (expand-file-name "publish/" op/repository-directory)))

Deploying

(defun jonnay/deploy-site () 
  "Publish the whole shebang"
  (interactive)
  (with-helm-default-directory (expand-file-name op/repository-directory)
      (shell-command "chmod -R a+r publish")
      (async-shell-command "rsync -avz -e ssh ./publish/ jonnay@www.jonnay.net:~/jonnay.net/www")
      (message "Publishing jonnay.net complete")))