Browse Source

Push closer to 0.9.6. Just tests and a merge left now...

Brit Butler 10 years ago
parent
commit
439f3f35f7
4 changed files with 45 additions and 52 deletions
  1. 4 1
      NEWS.md
  2. 0 2
      docs/config.md
  3. 37 49
      docs/hacking.md
  4. 4 0
      src/config.lisp

+ 4 - 1
NEWS.md

5
   To retain the previous behavior, add `(versioned)` to your config's
5
   To retain the previous behavior, add `(versioned)` to your config's
6
   `:plugins` list.
6
   `:plugins` list.
7
 * **SITE-BREAKING CHANGE**: Custom themes will be broken by a change
7
 * **SITE-BREAKING CHANGE**: Custom themes will be broken by a change
8
-  to URL handling. Previously, we were hand-constructed URLs in the
8
+  to URL handling. Previously, we were hand-constructing URLs in the
9
   templates. All site objects now store their URL in an instance slot.
9
   templates. All site objects now store their URL in an instance slot.
10
   In general, hrefs should be of the form `href="{$config.domain}/{$obj.url}"> ...</a>`.
10
   In general, hrefs should be of the form `href="{$config.domain}/{$obj.url}"> ...</a>`.
11
   Additionally, `{$month}` should become `{$month.name}`.
11
   Additionally, `{$month}` should become `{$month.name}`.
12
   Correspondingly, changes to `:routing` would previously break links in
12
   Correspondingly, changes to `:routing` would previously break links in
13
   the templates but now work seamlessly.
13
   the templates but now work seamlessly.
14
+* **Docs**: Improved README. New Config File docs.
15
+* Loading content is more robust when empty lines or metadata are passed.
16
+  Thanks to @PuercoPop for the bug report and preliminary fix.
14
 * The config `:repo` option is now deprecated as its value has become
17
 * The config `:repo` option is now deprecated as its value has become
15
   a required argument to `coleslaw:main`. The value passed to `main`
18
   a required argument to `coleslaw:main`. The value passed to `main`
16
   will override the config value going forward.
19
   will override the config value going forward.

+ 0 - 2
docs/config.md

15
 * `:title`        => to provide a site title
15
 * `:title`        => to provide a site title
16
 * `:theme`        => to select one of the themes in "coleslaw/themes/"
16
 * `:theme`        => to select one of the themes in "coleslaw/themes/"
17
 
17
 
18
-**TODO** Make sure this is actually true. Maybe without `:feeds` the publish method blows up? Test!
19
-
20
 It is usually recommend to start from the [example config][ex_config] and pare down from there.
18
 It is usually recommend to start from the [example config][ex_config] and pare down from there.
21
 
19
 
22
 [ex_config]: https://github.com/redline6561/coleslaw/blob/master/examples/example.coleslawrc
20
 [ex_config]: https://github.com/redline6561/coleslaw/blob/master/examples/example.coleslawrc

+ 37 - 49
docs/hacking.md

38
 
38
 
39
 ## Core Concepts
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
 ### Plugins
41
 ### Plugins
57
 
42
 
58
 **Coleslaw** strongly encourages extending functionality via plugins.
43
 **Coleslaw** strongly encourages extending functionality via plugins.
79
 there are RSS, ATOM, and sitemap templates *coleslaw* uses automatically.
64
 there are RSS, ATOM, and sitemap templates *coleslaw* uses automatically.
80
 No need for individual themes to reimplement a standard, after all!
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
 ### The Lifecycle of a Page
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
 - `(load-content)`
83
 - `(load-content)`
85
 
84
 
86
 A page starts, obviously, with a file. When *coleslaw* loads your
85
 A page starts, obviously, with a file. When *coleslaw* loads your
102
 
101
 
103
 - `(deploy dir)`
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
 ### Blogs vs Sites
109
 ### Blogs vs Sites
111
 
110
 
116
 collection of POSTs or other content. An INDEX really only serves to
115
 collection of POSTs or other content. An INDEX really only serves to
117
 group a set of content objects on a page, it isn't content itself.
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
 their own dedicated INDEX for new Content Types.
124
 their own dedicated INDEX for new Content Types.
127
 
125
 
128
 ### The Document Protocol
126
 ### The Document Protocol
169
 
167
 
170
 **Instance Methods**:
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
 - `render`: A method that calls the appropriate template with `theme-fn`,
175
 - `render`: A method that calls the appropriate template with `theme-fn`,
179
   passing it any needed arguments and returning rendered HTML.
176
   passing it any needed arguments and returning rendered HTML.
180
 
177
 
181
-
182
 **Invariants**:
178
 **Invariants**:
183
 
179
 
184
 - Any Content Types (subclasses of CONTENT) are expected to be stored in
180
 - Any Content Types (subclasses of CONTENT) are expected to be stored in
224
 * Finish docs updates to:
220
 * Finish docs updates to:
225
   * themes.md     -> Note debugging issues. Valid slots. Changed URL handling.
221
   * themes.md     -> Note debugging issues. Valid slots. Changed URL handling.
226
   * plugin-use.md -> Incremental plugin, Versioned plugin. Twitter summary cards.
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
 * A real test suite with Stefil that at *least* tests:
223
 * A real test suite with Stefil that at *least* tests:
230
   * `read-content`
224
   * `read-content`
231
   * `load-config`
225
   * `load-config`
262
    should tell the user what file failed and why. We also should
256
    should tell the user what file failed and why. We also should
263
    probably enforce more constraints about metadata. E.g. Empty
257
    probably enforce more constraints about metadata. E.g. Empty
264
    metadata is not allowed/meaningful. Trailing space after separator, etc.
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
    i.e. Specifying the `:repo` in .coleslawrc as the bare repo.
260
    i.e. Specifying the `:repo` in .coleslawrc as the bare repo.
271
    The README should clarify this point and the need for posts to be
261
    The README should clarify this point and the need for posts to be
272
    ".post" files.
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
 4. Dear Lord it was miserable even debugging a transposed character error
267
 4. Dear Lord it was miserable even debugging a transposed character error
274
    in one of the templates. "${foo}" instead of "{$foo}". But fuck supporting
268
    in one of the templates. "${foo}" instead of "{$foo}". But fuck supporting
275
    multiple templating backends I have enough problems. What can we do?
269
    multiple templating backends I have enough problems. What can we do?
276
 
270
 
277
 ### Scripting Conveniences
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
 ### Plugin Constraints
278
 ### Plugin Constraints
290
 
279
 
335
    Content Types it includes or the CONTENT which indexes it appears
324
    Content Types it includes or the CONTENT which indexes it appears
336
    on is not yet clear.
325
    on is not yet clear.
337
 
326
 
338
-[post_receive_hook]: https://github.com/redline6561/coleslaw/blob/master/examples/example.post-receive
339
 [closure_template]: https://github.com/archimag/cl-closure-template
327
 [closure_template]: https://github.com/archimag/cl-closure-template
340
 [api_docs]: https://github.com/redline6561/coleslaw/blob/master/docs/plugin-api.md
328
 [api_docs]: https://github.com/redline6561/coleslaw/blob/master/docs/plugin-api.md
341
 [clmd]: https://github.com/gwkkwg/cl-markdown
329
 [clmd]: https://github.com/gwkkwg/cl-markdown

+ 4 - 0
src/config.lisp

18
    (theme           :initarg :theme          :reader theme)
18
    (theme           :initarg :theme          :reader theme)
19
    (title           :initarg :title          :reader title))
19
    (title           :initarg :title          :reader title))
20
   (:default-initargs
20
   (:default-initargs
21
+   :feeds        nil
22
+   :license      nil
23
+   :plugins      nil
24
+   :sitenav      nil
21
    :charset      "UTF-8"
25
    :charset      "UTF-8"
22
    :lang         "en"
26
    :lang         "en"
23
    :page-ext     "html"
27
    :page-ext     "html"