|
@@ -38,21 +38,6 @@ reduced runtime to 1.36 seconds, almost cutting it in half.
|
38
|
38
|
|
39
|
39
|
## Core Concepts
|
40
|
40
|
|
41
|
|
-### Data and Deployment
|
42
|
|
-
|
43
|
|
-**Coleslaw** is pretty fundamentally tied to the idea of git as both a
|
44
|
|
-backing data store and a deployment method (via `git push`). The
|
45
|
|
-consequence is that you need a bare repo somewhere with a post-recieve
|
46
|
|
-hook. That post-recieve hook ([example][post_receive_hook])
|
47
|
|
-will checkout the repo to a **$TMPDIR** and call `(coleslaw:main $TMPDIR)`.
|
48
|
|
-
|
49
|
|
-It is then coleslaw's job to load all of your content, your config and
|
50
|
|
-templates, and render the content to disk. Deployment is done by
|
51
|
|
-moving the files to a location specified in the config and updating a
|
52
|
|
-symlink. It is assumed a web server is set up to serve from that
|
53
|
|
-symlink. However, there are plugins for deploying to Heroku, S3, and
|
54
|
|
-Github Pages.
|
55
|
|
-
|
56
|
41
|
### Plugins
|
57
|
42
|
|
58
|
43
|
**Coleslaw** strongly encourages extending functionality via plugins.
|
|
@@ -79,8 +64,22 @@ and return rendered HTML. **Coleslaw** defines a helper called
|
79
|
64
|
there are RSS, ATOM, and sitemap templates *coleslaw* uses automatically.
|
80
|
65
|
No need for individual themes to reimplement a standard, after all!
|
81
|
66
|
|
|
67
|
+Unfortunately, it is not very pleasant to debug broken templates.
|
|
68
|
+Efforts to remedy this are being pursued for the next release.
|
|
69
|
+Two particular issues to note are transposed Closure commands,
|
|
70
|
+e.g. "${foo}" instead of "{$foo}", and trying to use nonexistent
|
|
71
|
+keys or slots which fails silently instead of producing an error.
|
|
72
|
+
|
82
|
73
|
### The Lifecycle of a Page
|
83
|
74
|
|
|
75
|
+- `(progn
|
|
76
|
+ (load-config "/my/blog/repo/path")
|
|
77
|
+ (compile-theme (theme *config*)))`
|
|
78
|
+
|
|
79
|
+Coleslaw first needs the config loaded and theme compiled,
|
|
80
|
+as neither the blog location, the theme to use, and other
|
|
81
|
+crucial information are not yet known.
|
|
82
|
+
|
84
|
83
|
- `(load-content)`
|
85
|
84
|
|
86
|
85
|
A page starts, obviously, with a file. When *coleslaw* loads your
|
|
@@ -102,10 +101,10 @@ reverse-chronological index.
|
102
|
101
|
|
103
|
102
|
- `(deploy dir)`
|
104
|
103
|
|
105
|
|
-Finally, we move the staging directory to a timestamped path under the
|
106
|
|
-the config's `:deploy-dir`, delete the directory pointed to by the old
|
107
|
|
-'.prev' symlink, point '.curr' at '.prev', and point '.curr' at our
|
108
|
|
-freshly built site.
|
|
104
|
+Finally, we move the staging directory to a path under the config's
|
|
105
|
+`:deploy-dir`. If the versioned plugin is enabled, it is a timestamped
|
|
106
|
+path and we delete the directory pointed to by the old '.prev' symlink,
|
|
107
|
+point '.curr' at '.prev', and point '.curr' at our freshly built site.
|
109
|
108
|
|
110
|
109
|
### Blogs vs Sites
|
111
|
110
|
|
|
@@ -116,13 +115,12 @@ INDEXes. Roughly speaking, a POST is a blog entry and an INDEX is a
|
116
|
115
|
collection of POSTs or other content. An INDEX really only serves to
|
117
|
116
|
group a set of content objects on a page, it isn't content itself.
|
118
|
117
|
|
119
|
|
-This isn't ideal if you're looking for a full-on static site
|
120
|
|
-generator. Thankfully, Content Types were added in 0.8 as a step
|
121
|
|
-towards making *coleslaw* suitable for more use cases. Any subclass of
|
122
|
|
-CONTENT that implements the *document protocol* counts as a content
|
123
|
|
-type. However, only POSTs are currently included in the basic INDEXes
|
124
|
|
-since there isn't yet a formal relationship to determine which content
|
125
|
|
-types should be included on which indexes. Users may easily implement
|
|
118
|
+Content Types were added in 0.8 as a step towards making *coleslaw*
|
|
119
|
+suitable for more use cases. Any subclass of CONTENT that implements
|
|
120
|
+the *document protocol* counts as a content type. However, only POSTs
|
|
121
|
+are currently included in the bundled INDEXes since there isn't yet a
|
|
122
|
+formal relationship to determine which content types should be
|
|
123
|
+included on which indexes. It is straightforward for users to implement
|
126
|
124
|
their own dedicated INDEX for new Content Types.
|
127
|
125
|
|
128
|
126
|
### The Document Protocol
|
|
@@ -169,16 +167,14 @@ eql-specializing on the class, e.g.
|
169
|
167
|
|
170
|
168
|
**Instance Methods**:
|
171
|
169
|
|
172
|
|
-- `page-url`: Generate a relative path for the object on the site,
|
173
|
|
- usually sans file extension. If there is no extension, an :around
|
174
|
|
- method adds "html" later. The `slug` slot on the instance is
|
175
|
|
- conventionally used to hold a portion of the path that corresponds
|
176
|
|
- to a unique Primary Key or Object ID.
|
|
170
|
+- `page-url`: Retrieve the relative path for the object on the site.
|
|
171
|
+ The implementation of `page-url` is not fully specified. For most
|
|
172
|
+ content types, we compute and store the path on the instance at
|
|
173
|
+ initialization time making `page-url` just a reader method.
|
177
|
174
|
|
178
|
175
|
- `render`: A method that calls the appropriate template with `theme-fn`,
|
179
|
176
|
passing it any needed arguments and returning rendered HTML.
|
180
|
177
|
|
181
|
|
-
|
182
|
178
|
**Invariants**:
|
183
|
179
|
|
184
|
180
|
- Any Content Types (subclasses of CONTENT) are expected to be stored in
|
|
@@ -224,8 +220,6 @@ PAGE, a content type for static page support, is available as a plugin.
|
224
|
220
|
* Finish docs updates to:
|
225
|
221
|
* themes.md -> Note debugging issues. Valid slots. Changed URL handling.
|
226
|
222
|
* plugin-use.md -> Incremental plugin, Versioned plugin. Twitter summary cards.
|
227
|
|
- * hacking.md -> Any changes to Document Protocol?
|
228
|
|
- * config.md -> Test various empty config slots.
|
229
|
223
|
* A real test suite with Stefil that at *least* tests:
|
230
|
224
|
* `read-content`
|
231
|
225
|
* `load-config`
|
|
@@ -262,29 +256,24 @@ that are useful to the user. Example errors users have encountered:
|
262
|
256
|
should tell the user what file failed and why. We also should
|
263
|
257
|
probably enforce more constraints about metadata. E.g. Empty
|
264
|
258
|
metadata is not allowed/meaningful. Trailing space after separator, etc.
|
265
|
|
-2. Custom themes that try to access non-existent properties of content
|
266
|
|
- do not currently error. They just wind up returning whitespace.
|
267
|
|
- When the theme compiles, we should alert the user to any obvious
|
268
|
|
- issues with it.
|
269
|
|
-3. Trying to load content from the bare repo instead of the clone.
|
|
259
|
+2. Trying to load content from the bare repo instead of the clone.
|
270
|
260
|
i.e. Specifying the `:repo` in .coleslawrc as the bare repo.
|
271
|
261
|
The README should clarify this point and the need for posts to be
|
272
|
262
|
".post" files.
|
|
263
|
+3. Custom themes that try to access non-existent properties of content
|
|
264
|
+ do not currently error. They just wind up returning whitespace.
|
|
265
|
+ When the theme compiles, we should alert the user to any obvious
|
|
266
|
+ issues with it.
|
273
|
267
|
4. Dear Lord it was miserable even debugging a transposed character error
|
274
|
268
|
in one of the templates. "${foo}" instead of "{$foo}". But fuck supporting
|
275
|
269
|
multiple templating backends I have enough problems. What can we do?
|
276
|
270
|
|
277
|
271
|
### Scripting Conveniences
|
278
|
272
|
|
279
|
|
-1. The getting started process has been simplified for new users.
|
280
|
|
- They are able to just place a config in $HOME or their repo and do
|
281
|
|
- `(progn
|
282
|
|
- (ql:quickload :coleslaw)
|
283
|
|
- (coleslaw:main "/path/to/my/blog-repo"))`.
|
284
|
|
-2. We may also add command-line tools/scripts to run coleslaw, set up
|
285
|
|
- the db for incremental builds, scaffold a new post, etc. for new users.
|
286
|
|
- Xach's buildapp or cl-launch would be useful here. frog and hakyll are
|
287
|
|
- good points of inspiration as well.
|
|
273
|
+It would be convenient to add command-line tools/scripts to run coleslaw,
|
|
274
|
+set up the db for incremental builds, scaffold a new post, etc. for new users.
|
|
275
|
+Xach's buildapp or Fare's cl-launch would be useful here. frog and hakyll are
|
|
276
|
+reasonable points of inspiration for commands to offer.
|
288
|
277
|
|
289
|
278
|
### Plugin Constraints
|
290
|
279
|
|
|
@@ -335,7 +324,6 @@ Unfortunately, this does not solve:
|
335
|
324
|
Content Types it includes or the CONTENT which indexes it appears
|
336
|
325
|
on is not yet clear.
|
337
|
326
|
|
338
|
|
-[post_receive_hook]: https://github.com/redline6561/coleslaw/blob/master/examples/example.post-receive
|
339
|
327
|
[closure_template]: https://github.com/archimag/cl-closure-template
|
340
|
328
|
[api_docs]: https://github.com/redline6561/coleslaw/blob/master/docs/plugin-api.md
|
341
|
329
|
[clmd]: https://github.com/gwkkwg/cl-markdown
|