emacsorphanage / org-page

[INACTIVE] A static site generator based on Emacs and org mode.
673 stars 99 forks source link

+TITLE: Org-page: Static Site Generator

+AUTHOR: Kelvin Hu

+EMAIL: ini.kelvin@gmail.com

+DATE: 2012-08-23

** Workflow

  1. Specify a git repo where the org source files will be on the "source" branch and the generated html files will be on the "master" branch (the branch names can be customized). Repos may be created manually or by org-page's =op/new-repository= command.
  2. Specify a "base commit" (the most recent prior commit will be used if omitted). org-page will read changes between the latest commit and the specified base commit on branch "source". The changes will then be marked for publication.
  3. Org-page does preparation jobs.
  4. Publish the changes read in step 2. A change can be an addition, a modification, or a deletion. org-page is designed to handle all of these kinds of changes but since deletion does not happen often, org-page has not implemented it yet
  5. Update the index page for each category and tag.
  6. Publication finished.

** Installation

Org-page is now available from the famous emacs package repo [[http://melpa.milkbox.net/][melpa]] so the recommended way is to install it through emacs' package management system. For more info about installation, please see quick-guide.org in the "doc" folder.

** Configuration

Add the following lines to your =.emacs= file:

: ;;; the following is only needed if you install org-page manually : (add-to-list 'load-path "path/to/org-page") : (require 'org-page) : (setq op/repository-directory "path/to/your/org/repository") : (setq op/site-domain "http://your.personal.site.com/") : ;;; for commenting, you can choose either disqus, duoshuo or hashover : (setq op/personal-disqus-shortname "your_disqus_shortname") : (setq op/personal-duoshuo-shortname "your_duoshuo_shortname") : (setq op/hashover-comments t) : ;;; the configuration below are optional : (setq op/personal-google-analytics-id "your_google_analytics_id")

** Publication

Evaluate the following code to publish your changes:

: (op/do-publication nil "HEAD^1" "~/org-pub/" nil)

or just

: (op/do-publication)

You can also run it interactively: =M-x op/do-publication =

NOTE: Org-page does NOT commit your org files to git, so you have to commit them manually before you run this command.

** Site preview in browser

Just run =M-x op/do-publication-and-preview-site =, the site will be published in =~/.op-tmp=, then it will be previewed in browser automatically.