close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
- Timestamp:
-
Jul 8, 2008, 10:24:45 AM (16 years ago)
- Author:
-
cmlenz
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v3
|
v4
|
|
41 | 41 | }}} |
42 | 42 | |
| 43 | ==== `by_tag` ==== |
| 44 | |
| 45 | {{{ |
| 46 | #!javascript |
| 47 | function(doc) { |
| 48 | if (doc.type == 'Post' && doc.tags) { |
| 49 | for (var idx in doc.tags) { |
| 50 | emit([doc.tags[idx], doc.published], { |
| 51 | slug: doc.slug, title: doc.title, author: doc.author, published: doc.published, updated: doc.updated, |
| 52 | summary: doc.summary, body: doc.body, tags: doc.tags, extended: doc.extended != '' ? '…' : null |
| 53 | }); |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | }}} |
| 58 | |
43 | 59 | ==== `by_time` ==== |
44 | 60 | {{{ |
… |
… |
|
57 | 73 | |
58 | 74 | |
59 | | === `_design/comments` === |
| 75 | === `_design/pings` === |
60 | 76 | |
61 | | === `_design/pings` === |
| 77 | ==== `by_uri` ==== |
| 78 | |
| 79 | {{{ |
| 80 | #!javascript |
| 81 | function(doc) { |
| 82 | if (doc.type == 'Ping') { |
| 83 | emit([doc.post_id, doc.uri], null); |
| 84 | } |
| 85 | } |
| 86 | }}} |
62 | 87 | |
63 | 88 | === `_design/reactions` === |
64 | 89 | |
| 90 | ==== `by_post` ==== |
65 | 91 | |
| 92 | {{{ |
| 93 | #!javascript |
| 94 | function(doc) { |
| 95 | if (doc.type == 'Ping' && doc.published) { |
| 96 | emit([doc.post_id, doc.time], { |
| 97 | type: doc.type, uri: doc.uri, title: doc.title, |
| 98 | author: doc.author, excerpt: doc.excerpt, |
| 99 | time: doc.time |
| 100 | }); |
| 101 | } else if (doc.type == 'Comment' && doc.published) { |
| 102 | emit([doc.post_id, doc.time], { |
| 103 | type: doc.type, openid: doc.openid, author: doc.author, |
| 104 | markup: doc.markup, time: doc.time |
| 105 | }); |
| 106 | } |
| 107 | } |
| 108 | }}} |
| 109 | |
| 110 | ==== `by_time` ==== |
| 111 | |
| 112 | {{{ |
| 113 | #!javascript |
| 114 | function(doc) { |
| 115 | if (doc.type == 'Ping' && !doc.published) { |
| 116 | emit([doc.time, doc.type], doc); |
| 117 | } else if (doc.type == 'Comment' && doc.authenticated && !doc.published) { |
| 118 | emit([doc.time, doc.type], doc); |
| 119 | } |
| 120 | } |
| 121 | }}} |
| 122 | |