Browse Source

Add some content type details to hacking.md. Minor renaming.

Brit Butler 11 years ago
parent
commit
3ccc0fb5d0
2 changed files with 25 additions and 3 deletions
  1. 22 0
      docs/hacking.md
  2. 3 3
      src/indices.lisp

+ 22 - 0
docs/hacking.md

@@ -39,6 +39,18 @@ generator.  Content Types were added in 0.8 as a step towards making
39 39
 limitations. Chiefly, the association between Content Types, their
40 40
 template, and their inclusion in an INDEX is presently ad-hoc.
41 41
 
42
+### Current Content Types & Indices
43
+
44
+There are 3 INDEX subclasses at present: TAG-INDEX, DATE-INDEX, and
45
+NUMERIC-INDEX, for grouping content by tags, publishing date, and
46
+reverse chronological order, respectively. Currently, there is only 1
47
+content type: POST, for blog entries.
48
+
49
+I'm planning to add a content type PAGE, for static pages. It should
50
+be a pretty straightforward subclass of CONTENT with the necessary
51
+methods: `render`, `page-url` and `publish`, but will require a small
52
+tweak to prevent showing up in any INDEX.
53
+
42 54
 ### Templates and Theming
43 55
 
44 56
 User configs are allowed to specify a theme, otherwise the default is
@@ -108,6 +120,16 @@ Unfortunately, this does not solve:
108 120
    hash table. This may be undesirable and doesn't permit indices
109 121
    dedicated to particular content types.
110 122
 
123
+### New Content Type: Shouts!
124
+
125
+I've also toyed with the idea of a content type called a SHOUT, which
126
+would be used primarily to reference or embed other content, sort of a
127
+mix between a retweet and a del.icio.us bookmark. We encounter plenty
128
+of great things on the web. Most of mine winds up forgotten in browser
129
+tabs or stored on twitter's servers. It would be cool to see SHOUTs as
130
+a plugin, probably with a dedicated SHOUT-INDEX, and some sort of
131
+oEmbed/embed.ly/noembed support.
132
+
111 133
 ### Layouts and Paths
112 134
 
113 135
 Defining a page-url for every content-object and index seems a bit

+ 3 - 3
src/indices.lisp

@@ -7,7 +7,7 @@
7 7
 
8 8
 (defclass tag-index (index) ())
9 9
 (defclass date-index (index) ())
10
-(defclass int-index (index) ())
10
+(defclass numeric-index (index) ())
11 11
 
12 12
 (defmethod page-url ((object index))
13 13
   (index-id object))
@@ -15,7 +15,7 @@
15 15
   (format nil "tag/~a" (index-id object)))
16 16
 (defmethod page-url ((object date-index))
17 17
   (format nil "date/~a" (index-id object)))
18
-(defmethod page-url ((object int-index))
18
+(defmethod page-url ((object numeric-index))
19 19
   (format nil "~d" (index-id object)))
20 20
 
21 21
 (defmethod render ((object index) &key prev next)
@@ -54,7 +54,7 @@
54 54
   "Return the index for the Ith page of CONTENT in reverse chronological order."
55 55
   (let* ((start (* step i))
56 56
          (end (min (length content) (+ start step))))
57
-    (make-instance 'int-index :id (1+ i)
57
+    (make-instance 'numeric-index :id (1+ i)
58 58
                               :posts (subseq content start end)
59 59
                               :title "Recent Posts")))
60 60