Check-in [ce85597cc6]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:initial commit
Timelines: family | descendants | trunk
Files: files | file ages | folders
SHA1:ce85597cc6d1255d530d7f3e6e2a3007a040c2d8
User & Date: brandon@invergo.net 2013-02-19 16:59:41
Context
2013-02-19
17:01
variablize markdown check-in: 0e2d3be820 user: brandon@invergo.net tags: trunk
16:59
initial commit check-in: ce85597cc6 user: brandon@invergo.net tags: trunk
Changes

Added Makefile.







































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
104
105
106
107
108
109
110
111
112
113
114
115
# Deployment Options
# Get SSH user/doc root from auth.mk
include auth.mk
RSYNC = rsync
SSH_PORT = 22
SSH_USER ?= 
DOC_ROOT ?= 
RSYNC_DELETE = #--delete

# Copies files from src/ to dst/. Any .html files are
# interpreted by GNU m4 and wrapped in a the GNU m4
# template. Common m4 macros may be stored in a macros
# file.

MACROS    := macros.m4
SRC	  := src
DST       := dst
TEMPLATES := templates
PAGES     := $(SRC)/pages
POSTS     := $(SRC)/news
MAIN_T    := $(TEMPLATES)/main.html.m4
BLOG_T    := $(TEMPLATES)/blog.html.m4
POST_T	  := $(TEMPLATES)/post.html.m4
PAGE_T    := $(TEMPLATES)/page.html.m4
ATOM_T    := $(TEMPLATES)/atom.xml.m4
ATOM_E_T  := $(TEMPLATES)/atom_entry.xml.m4

# Build a list of all the files that should exist when the
# baking is done. We do this by getting a list of all the
# source files and rewriting pathnames and file suffixes as
# necessary.
raw_posts  := $(shell find $(POSTS) -name index.html* -prune -o -type f)
raw_posts  := $(raw_posts:$(POSTS)/%=$(DST)/news/%)
raw_posts  := $(raw_posts:.m4=)
raw_posts  := $(filter-out %.inc %.swp %~ \#%,$(raw_posts))
raw_posts  := $(raw_posts:.md=.html)

raw_pages  := $(shell find $(SRC) -type d -name news -prune -o -type f)
raw_pages  := $(raw_pages:$(SRC)/%=$(DST)/%)
raw_pages  := $(raw_pages:.m4=)
raw_pages  := $(filter-out %.inc %.swp %~ \#%,$(raw_pages))
raw_pages  := $(raw_pages:.md=.html)

sp :=
sp += # add space
post-sort = $(shell echo -e $(subst $(sp),'\n',$2) | sort $1 --key=1,1 -)
sorted_posts := $(addprefix $(POSTS)/,$(call post-sort,-r,$(notdir $(wildcard $(POSTS)/*.md.m4))))

all: clean-index clean-atom index atom posts pages

posts: $(raw_posts)
	@echo "==> building posts"

pages: $(raw_pages)
	@echo "==> building pages"

$(POSTS)/%.html: $(POSTS)/%.html.m4 $(MACROS) $(MAIN_T) $(POST_T)
	@m4 -P $(MACROS) $< $(POST_T) $(MAIN_T) > $@

$(SRC)/%.html: $(SRC)/%.html.m4 $(MACROS) $(MAIN_T) $(PAGE_T)
	@m4 -P $(MACROS) $< $(PAGE_T) $(MAIN_T) > $@

index: 
	@echo "==> building index"
	@echo "TITLE({\"News\"})" >> $(POSTS)/index.html.m4
	@echo "BODY({\"{\"" >> $(POSTS)/index.html.m4
	@for f in $(sorted_posts); do \
		link="`basename $$f .md.m4`.html";\
		head -n3 $$f | m4 -D "__URL"=$$link  \
			-P $(MACROS) - $(BLOG_T) >> $(POSTS)/index.html.m4; \
	done
	@echo "\"}\"})" >> $(POSTS)/index.html.m4

atom:
	@echo "==> building feed"
	@m4 -P $(MACROS) $(ATOM_T) > $(SRC)/atom.xml
	@for f in $(sorted_posts); do \
		link="`basename $$f .md.m4`.html";\
		markdown $$f | m4 -D "__URL"=$$link -P $(MACROS) - $(ATOM_E_T) \
			| head -n -4 >> $(SRC)/atom.xml; \
	done
	@echo "</feed>" >> $(SRC)/atom.xml


$(SRC)/%.html.m4: $(SRC)/%.md.m4 
	@markdown $< > $@

$(SRC)/%: $(SRC)/%.m4 $(MACROS)
	@m4 -P $(MACROS) $< > $@

$(DST)/%: $(SRC)/%
	@install -m 644 -D $< $@

clean-index:
	@echo "==> cleaning index"
	-rm $(POSTS)/index.html.m4

clean-atom:
	@echo "==> cleaning feed"
	-rm $(SRC)/atom.xml

clean: clean-index clean-atom
	@echo "==> cleaning dst"
	@mv $(DST) .old_dst
	@rm -rf .old_dst

new-post:
	@if [[ "$(TITLE)" == "" ]]; then echo "Error: no TITLE set"; fi
	@m4 -DTITLE="$(TITLE)" -P $(TEMPLATES)/new_post.md.m4 > \
		$(POSTS)/$(shell date +%Y-%m-%d)-$(subst $(sp),-,$(TITLE)).md.m4

deploy:
	@$(RSYNC) -avze 'ssh -p $(SSH_PORT)' $(RSYNC_DELETE) $(DST)/ $(SSH_USER):$(DOC_ROOT)

.PHONY = all pages posts index clean-index clean new-post atom clean-atom deploy

Added README.md.

















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
# GNU Make and M4 Website Bakery

One of the first hacks that I was really proud of was this website-baking system I built in late 1999 with some venerable old Unix tools, [GNU Make](http://www.gnu.org/software/make/) and [GNU m4](http://www.gnu.org/software/m4/). The article [Using M4 to write HTML](http://web.archive.org/web/19980529230944/http://www.linuxgazette.com/issue22/using_m4.html) by Bob Hepple was my original inspiration, but I think I was able to surpass the utility of the examples given therein.

**You're currently viewing the 'master' branch of this repository.** I've tried to include here many interesting features and ideas for how this technique might be used, including the use of [Pandoc](http://johnmacfarlane.net/pandoc/) for markdown-format source files. I've tried to include a generous amount of internal documentation and comments as well, but it may yet be a lot to absorb at once. To more easily understand what's going on here, be sure to take a look at the 'simple' branch of the repository: http://github.com/datagrok/m4-bakery/tree/simple

## Site Baking

"Website baking" is the pattern of building from templates a mostly- or completely-static website that requires no special software to serve. Baking a website provides huge advantages when it can be employed, because they:

- have fewer vectors for break-ins, 
- easily scale to handle massive amounts of traffic, and 
- may be hosted on commodity hardware or the cheapest of web hosting services.

Of course, with no processing occurring on the server end, it's not possible to host user-interactive features like comments sections, authentication, or e-commerce systems. These days however, many people use third-party tools like [Disqus](http://disqus.com) to implement these features anyway.

In short, if you're not using any of the dynamic features of your web hosting service, you might as well make the whole site static.

## GNU Make and GNU M4

That is of course only an argument for building static websites. Doing it in this _particular_ way may be... ill-advised.

Though m4 may be venerable and may come pre-installed on several modern Unix platforms, it brings along a notoriously cumbersome syntax for defining and calling macros, escaping, quoting, and other things. Sendmail's configuration system serves as a cautionary tale, as it was built upon m4 and is legendary for being obtuse. Employing m4 may be an exercise in masochism.

The difficulty in employing m4 may contribute to my pride in having built a useful tool with it a whole decade+ ago. I hope that this repository will yet serve as an instructive example of how to 'bake' a website using ubiquitous Unix tools, even if every single user ends up swapping out m4 for modern template software, e.g. [Jinja](http://jinja.pocoo.org/).

## Features

- The HTML template is wrapped around .html.m4 files automatically; no boilerplate is necessary in the source file.
- The HTML template is a single file, not a separate header and footer.
- Files named .m4 don't get the template, but still get interpreted by m4.
- Any files not named '.m4' don't get interpreted by m4; they are copied verbatim.
- Macros defined in source .html.m4 files will be expanded in the template. This lets you put complex logic in the template and trigger it from the source file. For example, you could set the page title, toggle a template style, define sidebars, etc.
- Macros defined in the macros file will be expanded in the source files and the template. You can define macros here that you want to be available everywhere.

## Execution

Beginning with source files like this:

	src/
	|-- index.html.m4
	`-- style.css

Along with the Makefile, macros file, and HTML template, running 'make' will
output:

	install -m 644 -D src/style.css dst/style.css
	m4 -P macros.m4 src/index.html.m4 template.html.m4 > src/index.html
	install -m 644 -D src/index.html dst/index.html
	rm src/index.html

And produce the following structure:

	dst/
	|-- index.html
	`-- style.css

Added auth.mk.







>
>
>
1
2
3
SSH_USER = user
DOC_ROOT = ~/my_website

Added macros.m4.





















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
m4_divert(2)m4_dnl  Keep this line at the top of the file.
m4_dnl  ----------------------------------------------------------------------
m4_dnl  Define site-wide macros
m4_dnl  ----------------------------------------------------------------------
m4_changequote(`{"', `"}')m4_dnl
m4_define({"TITLE"},
	{"m4_define({"__TITLE"}, $1)m4_dnl"})m4_dnl
m4_define({"DATE"},
	{"m4_define({"__DATE"}, $1)m4_dnl"})m4_dnl
m4_define({"UPDATE"},
	{"m4_define({"__UPDATE"}, $1)m4_dnl"})m4_dnl
m4_define({"EXCERPT"},
	{"m4_define({"__EXCERPT"}, $1)m4_dnl"})m4_dnl
m4_define({"BODY"},
	{"m4_define({"__BODY"}, $1)m4_dnl"})m4_dnl
m4_dnl TODO fix this
m4_define({"TAGS"},
	{"m4_define({"__TAGS"}, $1)m4_dnl"})m4_dnl
m4_dnl  ----------------------------------------------------------------------
m4_dnl  Configuration of the site
m4_dnl  ----------------------------------------------------------------------
m4_define({"__ROOT"}, {"http://brandon.invergo.net"})m4_dnl
m4_define({"__SITE_TITLE"}, {"Brandon Invergo"})m4_dnl
m4_define({"__SITE_SUBTITLE"}, {""})m4_dnl
m4_define({"__AUTHOR"}, {"Brandon Invergo"})
m4_define({"__EMAIL"}, {"brandon@invergo.net"})

Added src/css/main.css.







































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
/* ==========================================================================
   HTML5 Boilerplate styles - h5bp.com (generated via initializr.com)
   ========================================================================== */

html,
button,
input,
select,
textarea {
    color: #DCDCCC;
}

body {
    font-size: 1em;
    line-height: 1.4;
}

::-moz-selection {
    background: #656555;
    text-shadow: none;
}

::selection {
    background: #656555;
    text-shadow: none;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #2B2B2B;
    margin: 1em 0;
    padding: 0;
}

img {
    vertical-align: middle;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

textarea {
    resize: vertical;
}

.chromeframe {
    margin: 0.2em 0;
    background: #2B2B2B;
    color: #DCDCCC;
    padding: 0.2em 0;
}


/* ==========================================================================
   Author's custom styles
   ========================================================================== */

body {
    color: #DCDCCC;
    background-color: #3f3f3f;
    width: 60%;
    margin:0px auto; 
}

p#meta {
    color: #5f7f5f;
}

p {
    background-color: #3F3F3F;
    font-family: sans-serif;
}

header {
    margin: 0;
}

h1 {
    color: #DCDCCC;
    background-color: #7F9F7F;
    padding: 10px 20px 10px 20px;
    margin: 0;
}

h2 {
    background-color: #3f3f3f;
    padding: 0px 0px 0px 0px;
}

a {
    text-decoration: none;
}

a:link {
    color: #8CD0D3;
}

a:visited {
    color: #CC9393;
}

a:hover {
    color: #DC8CC3;
}

ul {
    list-style-type: none;
}

li {
    color: #DCDCCC;
}

nav {
    background-color: #2B2B2B;
    margin: 0; padding: 0;
}

#navmenu ol {
    margin: 0; padding: 0;
    list-style-type: none; list-style-image: none;
}

#navmenu li {
    display: inline;
    padding: 5px 20px 5px 20px;
    margin: 4px;
}

footer {
    background-color: #2B2B2B;
}

#copyright ol {
    margin: 0; padding: 0;
    list-style-type: none; list-style-image: none;
}

#copyright li {
    display: inline;
    padding: 5px 20px 5px 20px;
    margin: 4px;
}

pre {
    font-family: monospace, Courier;
    font-size: smaller;
    background: #4f4f4f;
}

code {
    font-family: monospace, Courier;
    font-size: smaller;
    background: #4f4f4f;
}


/* ==========================================================================
   Media Queries
   ========================================================================== */

@media only screen and (min-width: 35em) {

}

@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (min-resolution: 144dpi) {

}

/* ==========================================================================
   Helper classes
   ========================================================================== */

.ir {
    background-color: transparent;
    border: 0;
    overflow: hidden;
    *text-indent: -9999px;
}

.ir:before {
    content: "";
    display: block;
    width: 0;
    height: 100%;
}

.hidden {
    display: none !important;
    visibility: hidden;
}

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    width: auto;
}

.invisible {
    visibility: hidden;
}

.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}

.clearfix:after {
    clear: both;
}

.clearfix {
    *zoom: 1;
}

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: #000 !important; /* Black prints faster: h5bp.com/s */
        box-shadow:none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /*
     * Don't show links for images, or javascript/internal links
     */

    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group; /* h5bp.com/t */
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 0.5cm;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}

Added src/css/normalize.css.

















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
/*! normalize.css v1.0.1 | MIT License | git.io/normalize */

/* ==========================================================================
   HTML5 display definitions
   ========================================================================== */

/*
 * Corrects `block` display not defined in IE 6/7/8/9 and Firefox 3.
 */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
    display: block;
}

/*
 * Corrects `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
 */

audio,
canvas,
video {
    display: inline-block;
    *display: inline;
    *zoom: 1;
}

/*
 * Prevents modern browsers from displaying `audio` without controls.
 * Remove excess height in iOS 5 devices.
 */

audio:not([controls]) {
    display: none;
    height: 0;
}

/*
 * Addresses styling for `hidden` attribute not present in IE 7/8/9, Firefox 3,
 * and Safari 4.
 * Known issue: no IE 6 support.
 */

[hidden] {
    display: none;
}

/* ==========================================================================
   Base
   ========================================================================== */

/*
 * 1. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using
 *    `em` units.
 * 2. Prevents iOS text size adjust after orientation change, without disabling
 *    user zoom.
 */

html {
    font-size: 100%; /* 1 */
    -webkit-text-size-adjust: 100%; /* 2 */
    -ms-text-size-adjust: 100%; /* 2 */
}

/*
 * Addresses `font-family` inconsistency between `textarea` and other form
 * elements.
 */

html,
button,
input,
select,
textarea {
    font-family: sans-serif;
}

/*
 * Addresses margins handled incorrectly in IE 6/7.
 */

body {
    margin: 0;
}

/* ==========================================================================
   Links
   ========================================================================== */

/*
 * Addresses `outline` inconsistency between Chrome and other browsers.
 */

a:focus {
    outline: thin dotted;
}

/*
 * Improves readability when focused and also mouse hovered in all browsers.
 */

a:active,
a:hover {
    outline: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

/*
 * Addresses font sizes and margins set differently in IE 6/7.
 * Addresses font sizes within `section` and `article` in Firefox 4+, Safari 5,
 * and Chrome.
 */

h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

h2 {
    font-size: 1.5em;
    margin: 0.83em 0;
}

h3 {
    font-size: 1.17em;
    margin: 1em 0;
}

h4 {
    font-size: 1em;
    margin: 1.33em 0;
}

h5 {
    font-size: 0.83em;
    margin: 1.67em 0;
}

h6 {
    font-size: 0.75em;
    margin: 2.33em 0;
}

/*
 * Addresses styling not present in IE 7/8/9, Safari 5, and Chrome.
 */

abbr[title] {
    border-bottom: 1px dotted;
}

/*
 * Addresses style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
 */

b,
strong {
    font-weight: bold;
}

blockquote {
    margin: 1em 40px;
}

/*
 * Addresses styling not present in Safari 5 and Chrome.
 */

dfn {
    font-style: italic;
}

/*
 * Addresses styling not present in IE 6/7/8/9.
 */

mark {
    background: #ff0;
    color: #000;
}

/*
 * Addresses margins set differently in IE 6/7.
 */

p,
pre {
    margin: 1em 0;
}

/*
 * Corrects font family set oddly in IE 6, Safari 4/5, and Chrome.
 */

code,
kbd,
pre,
samp {
    font-family: monospace, serif;
    _font-family: 'courier new', monospace;
    font-size: 1em;
}

/*
 * Improves readability of pre-formatted text in all browsers.
 */

pre {
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/*
 * Addresses CSS quotes not supported in IE 6/7.
 */

q {
    quotes: none;
}

/*
 * Addresses `quotes` property not supported in Safari 4.
 */

q:before,
q:after {
    content: '';
    content: none;
}

/*
 * Addresses inconsistent and variable font size in all browsers.
 */

small {
    font-size: 80%;
}

/*
 * Prevents `sub` and `sup` affecting `line-height` in all browsers.
 */

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

/* ==========================================================================
   Lists
   ========================================================================== */

/*
 * Addresses margins set differently in IE 6/7.
 */

dl,
menu,
ol,
ul {
    margin: 1em 0;
}

dd {
    margin: 0 0 0 40px;
}

/*
 * Addresses paddings set differently in IE 6/7.
 */

menu,
ol,
ul {
    padding: 0 0 0 40px;
}

/*
 * Corrects list images handled incorrectly in IE 7.
 */

nav ul,
nav ol {
    list-style: none;
    list-style-image: none;
}

/* ==========================================================================
   Embedded content
   ========================================================================== */

/*
 * 1. Removes border when inside `a` element in IE 6/7/8/9 and Firefox 3.
 * 2. Improves image quality when scaled in IE 7.
 */

img {
    border: 0; /* 1 */
    -ms-interpolation-mode: bicubic; /* 2 */
}

/*
 * Corrects overflow displayed oddly in IE 9.
 */

svg:not(:root) {
    overflow: hidden;
}

/* ==========================================================================
   Figures
   ========================================================================== */

/*
 * Addresses margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
 */

figure {
    margin: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

/*
 * Corrects margin displayed oddly in IE 6/7.
 */

form {
    margin: 0;
}

/*
 * Define consistent border, margin, and padding.
 */

fieldset {
    border: 1px solid #c0c0c0;
    margin: 0 2px;
    padding: 0.35em 0.625em 0.75em;
}

/*
 * 1. Corrects color not being inherited in IE 6/7/8/9.
 * 2. Corrects text not wrapping in Firefox 3.
 * 3. Corrects alignment displayed oddly in IE 6/7.
 */

legend {
    border: 0; /* 1 */
    padding: 0;
    white-space: normal; /* 2 */
    *margin-left: -7px; /* 3 */
}

/*
 * 1. Corrects font size not being inherited in all browsers.
 * 2. Addresses margins set differently in IE 6/7, Firefox 3+, Safari 5,
 *    and Chrome.
 * 3. Improves appearance and consistency in all browsers.
 */

button,
input,
select,
textarea {
    font-size: 100%; /* 1 */
    margin: 0; /* 2 */
    vertical-align: baseline; /* 3 */
    *vertical-align: middle; /* 3 */
}

/*
 * Addresses Firefox 3+ setting `line-height` on `input` using `!important` in
 * the UA stylesheet.
 */

button,
input {
    line-height: normal;
}

/*
 * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
 *    and `video` controls.
 * 2. Corrects inability to style clickable `input` types in iOS.
 * 3. Improves usability and consistency of cursor style between image-type
 *    `input` and others.
 * 4. Removes inner spacing in IE 7 without affecting normal text inputs.
 *    Known issue: inner spacing remains in IE 6.
 */

button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
    -webkit-appearance: button; /* 2 */
    cursor: pointer; /* 3 */
    *overflow: visible;  /* 4 */
}

/*
 * Re-set default cursor for disabled elements.
 */

button[disabled],
input[disabled] {
    cursor: default;
}

/*
 * 1. Addresses box sizing set to content-box in IE 8/9.
 * 2. Removes excess padding in IE 8/9.
 * 3. Removes excess padding in IE 7.
 *    Known issue: excess padding remains in IE 6.
 */

input[type="checkbox"],
input[type="radio"] {
    box-sizing: border-box; /* 1 */
    padding: 0; /* 2 */
    *height: 13px; /* 3 */
    *width: 13px; /* 3 */
}

/*
 * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
 * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
 *    (include `-moz` to future-proof).
 */

input[type="search"] {
    -webkit-appearance: textfield; /* 1 */
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box; /* 2 */
    box-sizing: content-box;
}

/*
 * Removes inner padding and search cancel button in Safari 5 and Chrome
 * on OS X.
 */

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

/*
 * Removes inner padding and border in Firefox 3+.
 */

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/*
 * 1. Removes default vertical scrollbar in IE 6/7/8/9.
 * 2. Improves readability and alignment in all browsers.
 */

textarea {
    overflow: auto; /* 1 */
    vertical-align: top; /* 2 */
}

/* ==========================================================================
   Tables
   ========================================================================== */

/*
 * Remove most spacing between table cells.
 */

table {
    border-collapse: collapse;
    border-spacing: 0;
}

Added src/css/normalize.min.css.





































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
/*! normalize.css v1.0.1 | MIT License | git.io/normalize */
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block}
audio,canvas,video{display:inline-block;*display:inline;*zoom:1}
audio:not([controls]){display:none;height:0}
[hidden]{display:none}
html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}
html,button,input,select,textarea{font-family:sans-serif}
body{margin:0}
a:focus{outline:thin dotted}
a:active,a:hover{outline:0}
h1{font-size:2em;margin:.67em 0}
h2{font-size:1.5em;margin:.83em 0}
h3{font-size:1.17em;margin:1em 0}
h4{font-size:1em;margin:1.33em 0}
h5{font-size:.83em;margin:1.67em 0}
h6{font-size:.75em;margin:2.33em 0}
abbr[title]{border-bottom:1px dotted}
b,strong{font-weight:bold}
blockquote{margin:1em 40px}
dfn{font-style:italic}
mark{background:#ff0;color:#000}
p,pre{margin:1em 0}
code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}
pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}
q{quotes:none}
q:before,q:after{content:'';content:none}
small{font-size:80%}
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup{top:-0.5em}
sub{bottom:-0.25em}
dl,menu,ol,ul{margin:1em 0}
dd{margin:0 0 0 40px}
menu,ol,ul{padding:0 0 0 40px}
nav ul,nav ol{list-style:none;list-style-image:none}
img{border:0;-ms-interpolation-mode:bicubic}
svg:not(:root){overflow:hidden}
figure{margin:0}
form{margin:0}
fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}
legend{border:0;padding:0;white-space:normal;*margin-left:-7px}
button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}
button,input{line-height:normal}
button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}
button[disabled],input[disabled]{cursor:default}
input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}
input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
textarea{overflow:auto;vertical-align:top}
table{border-collapse:collapse;border-spacing:0}

Added src/css/screen.css.

































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
body {
    color: #DCDCCC;
    background-color: #3F3F3F;
}

h1 {
    color: #DCDCCC;
    background-color: #7F9F7F;
}

a {
    text-decoration: none;
}

a:link {
    color: #8CD0D3;
}

a:visited {
    color: #CC9393;
}

a:hover {
    color: #DC8CC3;
}

ul {
    list-style-type: none;
}

li {
    color: #DCDCCC;
}

nav {
    background-color: #2B2B2B;
}

#navmenu ol {
    margin: 0; padding: 0;
    list-style-type: none; list-style-image: none;
}

#navmenu li {
    display: inline;
    padding: 5px 20px 5px 20px;
    margin: 4px;
}

Added src/index.md.m4.











>
>
>
>
>
1
2
3
4
5
m4_dnl	Define a macro that will be expanded in the HTML template.
TITLE({"m4-bloggery demo"})

BODY({"{"Yes!
"}"})

Added src/news/2013-02-19-example-post.md.m4.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
TITLE({"example post"})
DATE({"2013-02-19 17:57"})
TAGS({"Example"})

BODY({"{"
Here's an example post.
"}"}

Added templates/atom.xml.m4.



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
m4_divert<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[__SITE_TITLE]]></title>
  <link href="__ROOT/atom.xml" rel="self"/>
  <link href="__ROOT/"/>
  <updated>m4_esyscmd(date +"%Y-%m-%d %H:%M")</updated>
  <id>__ROOT/</id>
  <author>
    <name><![CDATA[__AUTHOR]]></name>
    <email><![CDATA[__EMAIL]]></email>
  </author>
  <generator uri="https://github.com/datagrok/m4-bakery/">m4-bakery</generator>

Added templates/atom_entry.xml.m4.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
m4_divert(1)
  <entry>
    <title type="html"><![CDATA[__TITLE]]></title>
    <link href="__ROOT/__URL"/>
    <updated>__DATE</updated>
    <id>__ROOT/__URL</id>
    <content type="html"><![CDATA[<p>__BODY</p>]]></content>
  </entry>

Added templates/blog.html.m4.









>
>
>
>
1
2
3
4
m4_divert(1)m4_dnl
<div class="blog-index">
    [m4_ifdef({"__DATE"}, __DATE, {"m4_dnl"})] <a href="__URL">__TITLE</a> 
</div>

Added templates/main.html.m4.















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
m4_divert m4_dnl
<!DOCTYPE html>
m4_ifdef({"__ROOT"},, {"m4_define({"__ROOT"}, {""})"})m4_dnl
<html class="no-js">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>__TITLE</title>
        <meta name="description" content="Adaptation, Algorithms and
					  Ambience">
	<meta name="author" content="Brandon Invergo">
	<meta name="Copyright" content="Copyright Brandon Invergo
					2012. All Rights Reserved.">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="__ROOT/css/normalize.min.css">
        <link rel="stylesheet" href="__ROOT/css/main.css">
    </head>
    <body>
      <header role="banner">
	<hgroup>
	  <h1>__SITE_TITLE</h1>
<!--	  <h2>__SITE_SUBTITLE</h2> -->
	</hgroup>
      </header>
      <nav>
	<ol id="navmenu">
          <li><a href="__ROOT/index.html">Home</a></li>
          <li><a href="__ROOT/news/index.html">News</a></li>
          <li><a href="__ROOT/CV/index.html">CV</a></li>
          <li><a href="__ROOT/software/index.html">Software</a></li>
          <li><a href="__ROOT/music/index.html">Music</a></li>
          <li><a href="__ROOT/links/index.html">Links</a></li>
	  <li><a href="__ROOT/contact/index.html">Contact</a></li>
	  <li><a href="__ROOT/atom.xml">Feed</a></li>
        </ol>
      </nav>
      <div id="main">
	<div id="content">
m4_dnl
m4_divert(4)m4_dnl  --- Content will be placed here ---
m4_dnl
	</div>
      </div>
      <footer>
	<ol id="copyright">
	  <li>Copyright 2013 Brandon Invergo</li>
	  <li>Built with
	    <a href="https://github.com/datagrok/m4-bakery">m4-bakery</a>
	  </li>
	  <li>Last update m4_esyscmd(date +"%Y-%m-%d %H:%M")</li>
	</ol>
      </footer>
    </body>
</html>

Added templates/new_post.md.m4.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
`TITLE'({"TITLE"})
DATE({"m4_translit(m4_esyscmd(date "+%Y-%m-%d %H:%M"), `
', `')"})
TAGS({""})

BODY({"{"

"}"}

Added templates/page.html.m4.

































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
m4_divert(1) m4_dnl
         <div>
	   <article>
	   <h2 class="entry-title">__TITLE</h2>
	   __BODY
m4_dnl
m4_dnl m4_divert(3) m4_dnl
m4_dnl
             <footer>
	       <p id="meta">
		 m4_ifdef({"__DATE"}, {"Created: __DATE"}, {"m4_dnl"})
		 m4_ifdef({"__UPDATE"}, {"Updated: __UPDATE"}, {"m4_dnl"})
	       </p>
	     </footer>
	   </article>
	 </div>

Added templates/post.html.m4.



































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
m4_divert(1) m4_dnl
         <div>
	   <header>
	     <h2 class="entry-title">__TITLE</h1>
	   </header>
	   <article>
	   __BODY
             <footer>
	       <p id="meta">
		 m4_ifdef({"__DATE"}, {"Created: __DATE"}, {"m4_dnl"})
		 m4_ifdef({"__UPDATE"}, {"Updated: __UPDATE"}, {"m4_dnl"})
		 <br />
		 m4_ifdef({"__TAGS"}, {"Tags: __TAGS"}, {"m4_dnl"})
	       </p>
	     </footer>
	   </article>
	 </div>