diff --git a/docs/hacking.md b/docs/hacking.md index 82ef0a1..0fe0a68 100644 --- a/docs/hacking.md +++ b/docs/hacking.md @@ -39,6 +39,18 @@ generator. Content Types were added in 0.8 as a step towards making limitations. Chiefly, the association between Content Types, their template, and their inclusion in an INDEX is presently ad-hoc. +### Current Content Types & Indices + +There are 3 INDEX subclasses at present: TAG-INDEX, DATE-INDEX, and +NUMERIC-INDEX, for grouping content by tags, publishing date, and +reverse chronological order, respectively. Currently, there is only 1 +content type: POST, for blog entries. + +I'm planning to add a content type PAGE, for static pages. It should +be a pretty straightforward subclass of CONTENT with the necessary +methods: `render`, `page-url` and `publish`, but will require a small +tweak to prevent showing up in any INDEX. + ### Templates and Theming User configs are allowed to specify a theme, otherwise the default is @@ -108,6 +120,16 @@ Unfortunately, this does not solve: hash table. This may be undesirable and doesn't permit indices dedicated to particular content types. +### New Content Type: Shouts! + +I've also toyed with the idea of a content type called a SHOUT, which +would be used primarily to reference or embed other content, sort of a +mix between a retweet and a del.icio.us bookmark. We encounter plenty +of great things on the web. Most of mine winds up forgotten in browser +tabs or stored on twitter's servers. It would be cool to see SHOUTs as +a plugin, probably with a dedicated SHOUT-INDEX, and some sort of +oEmbed/embed.ly/noembed support. + ### Layouts and Paths Defining a page-url for every content-object and index seems a bit diff --git a/src/indices.lisp b/src/indices.lisp index cd0e847..a22c0e7 100644 --- a/src/indices.lisp +++ b/src/indices.lisp @@ -7,7 +7,7 @@ (defclass tag-index (index) ()) (defclass date-index (index) ()) -(defclass int-index (index) ()) +(defclass numeric-index (index) ()) (defmethod page-url ((object index)) (index-id object)) @@ -15,7 +15,7 @@ (format nil "tag/~a" (index-id object))) (defmethod page-url ((object date-index)) (format nil "date/~a" (index-id object))) -(defmethod page-url ((object int-index)) +(defmethod page-url ((object numeric-index)) (format nil "~d" (index-id object))) (defmethod render ((object index) &key prev next) @@ -54,7 +54,7 @@ "Return the index for the Ith page of CONTENT in reverse chronological order." (let* ((start (* step i)) (end (min (length content) (+ start step)))) - (make-instance 'int-index :id (1+ i) + (make-instance 'numeric-index :id (1+ i) :posts (subseq content start end) :title "Recent Posts")))