public
Description: a ruby blog/cms system that can't be any simpler.
Homepage: http://whatcodecraves.com/projects/flacoblog.html
Clone URL: git://github.com/jch/flacoblog.git
flacoblog / README.text
100644 103 lines (75 sloc) 3.922 kb
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# FlacoBlog #
 
I love to eat. What I eat depends a lot on the situation. Somedays
it's worthwhile to go out to a nice restaurant with friends. Other
times, it's more comfortable to cook a simple meal. Then there are
those times of uncontrollable hunger, times when that 2-minute hot
pocket suddenly become your best friend.
 
FlacoBlog is like the hot pocket of content management systems. It is
a ruby script that takes a bunch of text files, translates them with
[Markdown](http://daringfireball.net/projects/markdown/), lays out the
resulting html with
[ERB](http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/) templates.
It's quick and easy to setup, use, and maintain. But it's not for
everyone. It's catered to terminal nerds and unix geeks. There's no
web interface. There's no bloated list of dependencies. When you
look at the source, you might laugh at how *simple* it really is.
Just bring your favorite text editor and write your blog entries in
beautiful plain text.
 
## Goals ##
 
I learned a lot about my usage habits from running the other blog
systems. I kept my habits in while I wrote FlacoBlog. Here are some
of the core design goals.
 
* **easy control and access to blog entries.** I can't bring myself to
  use a hosted solution. I like having control of the source of my
  own posts, and having the flexibility of manipulating it in clever
  ways.
 
* **minimal installation and maintenance.** I'm a technical guy, but a
  blog system shouldn't require me to install a bunch of packages and
  dependencies out of the box. Once it's setup, I shouldn't have to
  spend more time patching it and updating the blog system than
  *actually writing* in it.
 
* **use whatever editor you want.** I'm a big emacs guy. I like
  formatting my text in 80 columns, and I like having *real* emacs
  keybindings.
 
* **web standards, clean markup, easy templates.** Enough said.
 
## Installation ##
 
The directory this README is in is the blog root. Before you can use
FlacoBlog, you will need Ruby, and
[rdiscount](http://github.com/rtomayko/rdiscount/tree/master). If you
don't have rdisount, you can install with:
 
    sudo gem install rdiscount
 
To publish the blog, simply type:
 
    ruby flaco.rb
 
The resulting blog will be put in 'index.html'
 
## How it Works ##
 
The core of FlacoBlog is actually a few utility functions that help
you find files you want to publish (ingredients), and map arbitrary
ruby functions (kitchen_appliances) on those files. Think of it as a
small wrapper around GNU Find, and a declarative mini-language for
describing how to work on found files. If you wanted to replace
Markdown with Textile, simply use a different 'kitchen_appliance' when
you're publishing. The same applies if you wanted to use templating
system other than ERB.
 
Here's the declaration for a sample ingredient:
 
    ingredient(:backup_files, :regex => '.*~')
 
Here's the declaration for a kitchen appliance:
 
    kitchen_appliance(:rm) { |ingredients|
      ingredients.each { |i| File.delete(i) }
    }
 
Once you declare all your <code>ingredient</code>s, you can write a
'recipe' by applying <code>kitchen_appliance</code>s to
<code>ingredient</code>s with the <code>cook</code> method:
 
    cook(:backup_files, :with => :rm)
 
These methods allow you to describe files you commonly work with, and
also actions you commonly perform. Check out the bottom of the source
for [flaco.rb](./flaco.rb), and you'll see the actions FlacoBlog takes
to stitch together a blog.
 
## Configuration ##
 
See [flaco.yml](./flaco.yml).
 
## Hacking ##
 
FlacoBlog gives you a working blog work of the box, but it's not hard
to add new features if you want them. Look through [the
source](./flaco.rb) to write your own custom ingredients and recipes.
If you write something cool, [write
me](http://www.whatcodecraves.com/) a comment, or send me a [pull
request](http://github.com/jch/flacoblog/tree/master).