aboutsummaryrefslogtreecommitdiff
path: root/README.org
blob: 89a60ac712d1720d682efa16fc72cc4f83bdbd40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#+TITLE: ennum

ennum is a purely functional Org Mode based static blog generator written in Emacs Lisp. It is intended as a complete blog-specific replacement for the org-publish system.

* Features
- minimal rebuilds
- purely functional
- resize and optimize images for file size
- tag posts
- generate post listings (of all posts, and filtered by tag)
- generate Atom feeds
- translate posts to multiple languages
- tangle source blocks embedded in posts

* Features in detail
** Minimal rebuilds
When an input file did not change, it is not rebuilt. This saves a lot of time and makes the "edit-compile-debug" cycle really fast.

** Purely functional
ennum is purely functional in that the built output always corresponds to the current source. The built output is guaranteed to not contain artifacts from previous builds. For example, when a source file is deleted, the corresponding output file is also deleted in the next rebuild.

Note that ennum's purely functional nature is not achieved by merely deleting the output directory and creating a new one in its place. That would be an enormous waste of time and a violation of the "minimal rebuilds" principle. Instead ennum uses what we call "ennum expressions"---a caching and dependency tracking system inspired by the [[https://guix.gnu.org/][Guix]] store and [[https://arxiv.org/abs/1709.00833][G-expressions]].

** Resize and optimize images for file size
ennum resizes and optimizes images in posts so that pages load quicker and are light on network use.

** Generate post listings and Atom feeds
ennum generates index pages listing all posts, and posts filtered by tag.

** Multiple languages
ennum understands posts translated to multiple languages. It automatically links to translations of a post, and generates separate post listings for different languages.

** Tangle source blocks embedded in posts
ennum lets you tangle source blocks embedded in posts and write them to a separate source file. Thus, you can make the source code in your blog available for download without having to duplicate your code in two places.

** Pure Emacs Lisp
ennum is written purely in Emacs Lisp [fn::except for the image processing code, for which we shell out to external command-line tools]. No need to pull up your terminal emulator or shell mode to rebuild your blog.

* Installation

Clone the repository.
#+BEGIN_SRC sh
  $ git clone https://git.systemreboot.net/ennum/
#+END_SRC
Add the path to the cloned repository to your load path, and load ennum.
#+BEGIN_SRC emacs-lisp
  (add-to-list 'load-path "~/ennum")
  (require 'ennum)
#+END_SRC

* Usage

Set up /ennum-blog/ with settings relevant for your blog, and run /M-x ennum-publish/. A simple sample /ennum-blog/ is given below. For detailed documentation of all available settings, see its docstring.
#+BEGIN_SRC emacs-lisp
  (setq ennum-blog
        '(:working-directory "~/blog"
          :output-directory "output"
          :posts-directory "posts"
          :images-directory "images"
          :static-directory "files"
          :video-directory "videos"

          :blog-title "Muthu Mani Maalai"
          :blog-subtitle "Mani's blog"
          :blog-domain "example.org"
          :blog-license "All content is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."))
#+END_SRC