-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcolophon.pdc
72 lines (63 loc) · 3.46 KB
/
colophon.pdc
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
% Colophon
% W. Caleb McDaniel
%
Tools I Use
-----------
- MacBook Pro running Lion
- [iTerm2](http://www.iterm2.com/#/section/home)
- [Vim][] for text editing
- [Pandoc][] for document conversion
- [Notational Velocity][] for light-duty notetaking and task management
- [Editorial](http://omz-software.com/editorial/) and [Drafts](http://agiletortoise.com/drafts) for iOS notetaking
- [Mutt][] for my email
How This Site is Built
----------------------
The posts and pages on this site begin as plain-text files written in
Pandoc's extended version of [Markdown][]. I then use the bash shell
script below to turn those files into flat HTML documents that are
uploaded to my server.
The shell script is a much more basic version of full-featured static site
generators like [Hakyll][], [Jekyll][], and [Hyde][], and even more like
[rawk][]. I looked at some of these programs but wanted to see if I could
build something lighter for myself that used Unix tools I was already
familiar with. Pandoc is robust enough, for my purposes, to do most of the
heavy lifting with a simple pandoc HTML template, which I've posted for
reference [here][]. For now, at least, this script also manages to conform to
[the Hakyll philosophy][]; not only does configuration take less than 100
lines of code, but the whole shell script is under 100 lines. I took some
inspiration for it from [this page][] and a few others.
The key part of the script is the long `echo` command that comes after
using pandoc to convert each post to html. This line creates a record
for each post containing information fields (separated by %) that are
then manipulated later in the script by `awk` to generate an RSS feed
and lists of posts for the main page and each category page.
To style the site, I use a customized, minimized version of [Bootstrap][] for the
responsive layout, and [Glyphicons][] for the social media icons. The color scheme is Solarized by [Ethan Schoonover][].
I've set up the script to update the code below everytime I upload
changes to this site. I have also included comments in the html source
for individual pages so that interested geeks can see which parts of the
site are added using pandoc's options and which are part of the Markdown
files that form the main content. I'm still a shell scripting newbie, so
if you see problems with the code or have suggestions about improving
it, I'd be grateful if you'd let me know at <[email protected]>.
The script and all of the files that make up the website can also be
found in a [github repository][], though it may not always be as current
as this site.
[an 1844 letter]: http://archive.org/details/lettertomydearfr00webb10
[Vim]: http://www.vim.org
[Pandoc]: http://www.johnmacfarlane.net/pandoc/
[Notational Velocity]: http://notational.net
[Mutt]: http://www.mutt.org
[Markdown]: http://daringfireball.net/projects/markdown
[Hakyll]: http://jaspervdj.be/hakyll/
[Jekyll]: http://jekyllrb.com
[Hyde]: http://ringce.com/hyde
[rawk]: http://rawk.brokenlcd.net
[here]: http://github.com/wcaleb/pandoc-templates/blob/master/website.html
[the Hakyll philosophy]: http://jaspervdj.be/hakyll/philosophy.html
[this page]: http://sohcahtoa.org.uk/pages/publish-a-web-site-with-bash-scripts.html
[github repository]: https://github.com/wcaleb/website
[Bootstrap]: http://twitter.github.com/bootstrap/index.html
[Glyphicons]: http://glyphicons.com
[Simon Pascal Klein]: http://klepas.org
[Ethan Schoonover]: http://ethanschoonover.com/solarized