postview 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. data/HISTORY +67 -0
  2. data/INFO +14 -0
  3. data/LICENSE +0 -0
  4. data/README.rdoc +103 -0
  5. data/Rakefile +174 -0
  6. data/VERSION +8 -0
  7. data/bin/postview +51 -0
  8. data/lib/postview.rb +68 -0
  9. data/lib/postview/about.rb +34 -0
  10. data/lib/postview/application.rb +130 -0
  11. data/lib/postview/cli.rb +71 -0
  12. data/lib/postview/cli/create_command.rb +362 -0
  13. data/lib/postview/cli/server_command.rb +115 -0
  14. data/lib/postview/helpers.rb +21 -0
  15. data/lib/postview/patches.rb +11 -0
  16. data/lib/postview/settings.rb +107 -0
  17. data/lib/postview/site.rb +51 -0
  18. data/lib/postview/version.rb +27 -0
  19. data/tasks/documentation.rake +21 -0
  20. data/tasks/history.rake +7 -0
  21. data/tasks/homepage.rake +10 -0
  22. data/tasks/package.rake +11 -0
  23. data/tasks/version.rake +56 -0
  24. data/test/application_test.rb +122 -0
  25. data/test/extensions.rb +23 -0
  26. data/test/fixtures/application/config.ru +6 -0
  27. data/test/fixtures/application/config/settings.yml +22 -0
  28. data/test/fixtures/application/empty.yml +0 -0
  29. data/test/fixtures/application/posts/20090529-postview_blogware.ruby.sinatra.mkd +4 -0
  30. data/test/fixtures/application/posts/20090602-postview_blogware.ruby.sinatra.mkd +4 -0
  31. data/test/fixtures/application/posts/archive/20080529-postview_blogware.ruby.sinatra.mkd +4 -0
  32. data/test/fixtures/application/posts/archive/20080602-postview_blogware.ruby.sinatra.mkd +4 -0
  33. data/test/fixtures/application/posts/drafts/20090730-draft_postview_blogware.ruby.sinatra.mkd +4 -0
  34. data/test/fixtures/application/themes/gemstone/about.erb +0 -0
  35. data/test/fixtures/application/themes/gemstone/archive/index.erb +0 -0
  36. data/test/fixtures/application/themes/gemstone/archive/show.erb +17 -0
  37. data/test/fixtures/application/themes/gemstone/images/banners/banner.jpg +0 -0
  38. data/test/fixtures/application/themes/gemstone/images/favicon.ico +0 -0
  39. data/test/fixtures/application/themes/gemstone/images/trojan.com +0 -0
  40. data/test/fixtures/application/themes/gemstone/index.erb +0 -0
  41. data/test/fixtures/application/themes/gemstone/javascripts/gemstone.js +1 -0
  42. data/test/fixtures/application/themes/gemstone/layout.erb +0 -0
  43. data/test/fixtures/application/themes/gemstone/posts/index.erb +0 -0
  44. data/test/fixtures/application/themes/gemstone/posts/show.erb +0 -0
  45. data/test/fixtures/application/themes/gemstone/search.erb +0 -0
  46. data/test/fixtures/application/themes/gemstone/stylesheets/gemstone.css +1 -0
  47. data/test/fixtures/application/themes/gemstone/tags/index.erb +0 -0
  48. data/test/fixtures/application/themes/gemstone/tags/show.erb +0 -0
  49. data/test/helper.rb +9 -0
  50. data/test/settings_test.rb +72 -0
  51. data/test/site_test.rb +62 -0
  52. data/themes/default/about.erb +24 -0
  53. data/themes/default/archive/index.erb +21 -0
  54. data/themes/default/archive/show.erb +17 -0
  55. data/themes/default/error.erb +0 -0
  56. data/themes/default/images/favicon.ico +0 -0
  57. data/themes/default/images/logo.png +0 -0
  58. data/themes/default/images/navigation-bar.gif +0 -0
  59. data/themes/default/images/postview.png +0 -0
  60. data/themes/default/images/rack.png +0 -0
  61. data/themes/default/images/ruby.png +0 -0
  62. data/themes/default/images/sinatra.png +0 -0
  63. data/themes/default/index.erb +38 -0
  64. data/themes/default/layout.erb +117 -0
  65. data/themes/default/posts/index.erb +21 -0
  66. data/themes/default/posts/show.erb +17 -0
  67. data/themes/default/search.erb +40 -0
  68. data/themes/default/stylesheets/postview.css +238 -0
  69. data/themes/default/tags/index.erb +12 -0
  70. data/themes/default/tags/show.erb +40 -0
  71. metadata +158 -0
@@ -0,0 +1,17 @@
1
+ <div class="entry">
2
+
3
+ <h1><%= link_to post.title, posts_path, post %></h1>
4
+
5
+ <span class="entry-meta">
6
+ Published at <%= post.publish_date.strftime('%A, %B %d, %Y') %>,
7
+ tagged with <%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>.
8
+ </span>
9
+
10
+ <div class="text">
11
+
12
+ <%= post.content %>
13
+
14
+ </div><!--text-->
15
+
16
+ </div><!--entry-->
17
+
File without changes
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,38 @@
1
+ <% unless posts.empty? %>
2
+ <% for post in posts %>
3
+ <div class="entry">
4
+
5
+ <h1><%= link_to post.title, posts_path, post %></h1>
6
+
7
+ <span class="entry-meta">
8
+ Published at <%= post.publish_date.strftime('%A, %B %d, %Y') %>,
9
+ tagged with <%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>.
10
+ </span>
11
+
12
+ <div class="text">
13
+
14
+ <%= post.summary %>
15
+
16
+ <p>
17
+ <%= link_to "Read more ...", posts_path, post %>
18
+ </p>
19
+
20
+ </div><!--text-->
21
+
22
+ </div><!--entry-->
23
+ <% end %>
24
+ <% else %>
25
+ <div class="entry">
26
+
27
+ <h1>No posts</h1>
28
+
29
+ <div class="text">
30
+
31
+ <p>
32
+ Please, check your posts directory.
33
+ </p>
34
+
35
+ </div><!--text-->
36
+
37
+ </div><!-- entry -->
38
+ <% end %>
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+
4
+ <head>
5
+
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+ <title><%=site.title%> :: <%=page.title%></title>
8
+ <meta name="generator" content="<%=Postview::Version%>" />
9
+ <meta name="description" content="<%=site.subtitle%>" />
10
+ <meta name="keywords" content="<%=page.keywords%>" />
11
+ <link rel="shortcut icon" href="<%=path_to :images, "favicon.ico"%>" />
12
+ <link rel="stylesheet" type="text/css" href="<%=path_to :stylesheets, "postview.css"%>" />
13
+
14
+ </head>
15
+
16
+ <body>
17
+
18
+ <div id="header">
19
+
20
+ <h1><%=link_to site.title, :root, :title => "#{site.title}"%></h1>
21
+
22
+ <h2><%=page.title || site.subtitle%></h2>
23
+
24
+ <span>By <%=link_to site.author, "mailto:#{site.email}", :title => "Send mail to #{site.author}"%></span>
25
+
26
+ <img src="<%=path_to "/images/logo.png"%>" id="logo" alt="Postview" />
27
+
28
+ </div><!-- header -->
29
+
30
+ <br/>
31
+
32
+ <div id="navigation-bar">
33
+
34
+ <address>
35
+
36
+ <%=link_to "Home", :root, :title => site.title%>
37
+ <%=link_to title_path(:posts), :posts, :title => title_path(:posts)%>
38
+ <%=link_to title_path(:archive), :archive, :title => title_path(:archive)%>
39
+ <%=link_to title_path(:about), :about, :title => title_path(:about)%>
40
+
41
+ </address>
42
+
43
+ <form action="<%=path_to :search%>" method="get">
44
+ <input type="text" name="keyword" value="<%=title_path :search%>" onfocus="this.value=''" onblur="this.value='<%=title_path :search%>'" title="<%=title_path :search%>"/>
45
+ </form>
46
+
47
+ </div><!-- navigation-bar -->
48
+
49
+ <br/>
50
+
51
+ <div id="content">
52
+
53
+ <%=yield%>
54
+
55
+ </div>
56
+
57
+ <div id="options">
58
+
59
+ <div class="entry">
60
+
61
+ <h1>Related Posts</h1>
62
+
63
+ <ul>
64
+ <% for post in posts %>
65
+ <li><%= link_to "#{post.publish_date} - #{post.title}", posts_path, post, :title => post.title %></li>
66
+ <% end %>
67
+ </ul>
68
+
69
+ </div>
70
+
71
+ <div class="entry">
72
+
73
+ <h1>Related Tags</h1>
74
+
75
+ <ul>
76
+ <% for tag in tags %>
77
+ <li><%= link_to "#{tag.capitalize} (#{count_posts_by_tag(tag)})", tags_path, tag, :title => tag.capitalize %></li>
78
+ <% end %>
79
+ </ul>
80
+
81
+ </div>
82
+
83
+ <div class="entry">
84
+
85
+ <div class="text">
86
+
87
+ <p>
88
+ <span><a href="http://github.com/hallison/postview" title="Project hosted by Github"><img alt="Project hosted by Github" src="http://github.com/images/modules/header/logov3.png" border="0" /></a></span>
89
+ <span><a href="http://www.pledgie.com/campaigns/5600" title="Donations"><img alt="Click here to lend your support to: postview and make a donation at www.pledgie.com !" src="http://www.pledgie.com/campaigns/5600.png?skin_name=chrome" border="0" /></a></span>
90
+ </p>
91
+
92
+ <p>
93
+ <span><a href="http://www.ruby-lang.org/" title="Ruby programming language"><img alt="Ruby programming language" src="<%=path_to "/images/ruby.png"%>" border="0" /></a></span>
94
+ <span><a href="http://rack.rubyforge.org/" title="Powers Web Applications"><img alt="Rack"src="<%=path_to "/images/rack.png"%>" border="0" /></a></span>
95
+ <span><a href="http://www.sinatrarb.com/" title="Sinatra DSL"><img alt="Sinatra DSL"src="<%=path_to "/images/sinatra.png"%>" border="0" /></a></span>
96
+ </p>
97
+
98
+ </div>
99
+
100
+ </div>
101
+
102
+ </div><!-- options -->
103
+
104
+ <br/>
105
+
106
+ <div id="footer">
107
+
108
+ <p>
109
+ <small><%=site.title%> &copy; 2009 <%=site.author%>. Powered by <%=link_to Postview::Version, "http://github.com/hallison/postview"%>.</small>
110
+ </p>
111
+
112
+ </div><!-- footer -->
113
+
114
+ </body>
115
+
116
+ </html>
117
+
@@ -0,0 +1,21 @@
1
+ <div class="entry">
2
+
3
+ <h1><%=title_path :posts%></h1>
4
+
5
+ <div class="text">
6
+
7
+ <dl>
8
+ <% for post in posts %>
9
+ <dt>
10
+ <b><%=link_to "#{post.publish_date} - #{post.title}", posts_path, post%></b>
11
+ (<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)
12
+ </dt>
13
+
14
+ <dd>
15
+ <%=post.summary%>
16
+ </dd>
17
+ <% end %>
18
+ </dl>
19
+ </div><!--text-->
20
+ </div><!--entry-->
21
+
@@ -0,0 +1,17 @@
1
+ <div class="entry">
2
+
3
+ <h1><%= link_to post.title, posts_path, post %></h1>
4
+
5
+ <span class="entry-meta">
6
+ Published at <%= post.publish_date.strftime('%A, %B %d, %Y') %>,
7
+ tagged with <%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>.
8
+ </span>
9
+
10
+ <div class="text">
11
+
12
+ <%= post.content %>
13
+
14
+ </div><!--text-->
15
+
16
+ </div><!--entry-->
17
+
@@ -0,0 +1,40 @@
1
+ <div class="entry">
2
+
3
+ <h1><%= title_path :search %> - Results for <%= params.values.to_s.split.join(', ') %></h1>
4
+
5
+ <div class="text">
6
+
7
+ <p>
8
+ <%= posts.size %> found in posts and <%= archive.size %> found in archive.
9
+ </p>
10
+
11
+ <% unless posts.empty? %>
12
+ <h2><%= title_path :posts %></h2>
13
+
14
+ <ul>
15
+ <% for post in posts %>
16
+ <li>
17
+ <%= post.publish_date.strftime('%Y-%m-%d') %> - <strong><%= link_to post.title, posts_path, post, :title => post.title %></strong>
18
+ <span>(<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)</span>
19
+ </li>
20
+ <% end %>
21
+ </ul>
22
+ <% end %>
23
+
24
+ <% unless archive.empty? %>
25
+ <h2><%= title_path :archive %></h2>
26
+
27
+ <ul>
28
+ <% for post in archive %>
29
+ <li>
30
+ <b><%= link_to "#{post.publish_date} - #{post.title}", archive_path, post, :title => post.title %></b>
31
+ <span>(<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)</span>
32
+ </li>
33
+ <% end %>
34
+ </ul>
35
+ <% end %>
36
+
37
+ </div><!--text-->
38
+
39
+ </div><!--entry-->
40
+
@@ -0,0 +1,238 @@
1
+ /*
2
+ * Background header: 1F3366
3
+ * Background over: 445172
4
+ * Background light: 6D7FAC
5
+ * Background text: DADFEC
6
+ * Borders and colors: 5C6E9A
7
+ *
8
+ */
9
+
10
+ * {
11
+ font-size: 13.34px;
12
+ font-family: sans,dejavu sans,helvetica,verdana,arial,sans-serif;
13
+ }
14
+
15
+ a {
16
+ color: #777;
17
+ text-decoration: none;
18
+ }
19
+
20
+ a:hover {
21
+ color: #000;
22
+ }
23
+
24
+ h1, h2, h3, h4, h5, h6 {
25
+ margin: 0px;
26
+ padding: 0px;
27
+ font-weight: normal;
28
+ }
29
+
30
+ h1, h1>*, * html h1 * { font-size: 22px; }
31
+ h2, h2>* { font-size: 20px; }
32
+ h3, h3>* { font-size: 18px; }
33
+ h4, h4>* { font-size: 18px; }
34
+ h5, h5>* { font-size: 16px; }
35
+ h6, h6>* { font-size: 16px; }
36
+ small, small>* { font-size: 10px; }
37
+ big, big>* { font-size: 18px; }
38
+
39
+ body {
40
+ margin: 0px;
41
+ padding: 0px;
42
+ background-color: #DADFEC;
43
+ }
44
+
45
+ body>br {
46
+ clear: both;
47
+ }
48
+
49
+ body>div {
50
+ float: left;
51
+ }
52
+
53
+ body>div>address {
54
+ float: left;
55
+ display: block;
56
+ }
57
+
58
+ body>div>address>a {
59
+ float: left;
60
+ display: block;
61
+ width: 10em;
62
+ text-align: center;
63
+ font-style: normal;
64
+ background-color: inherit;
65
+ }
66
+
67
+ body>div>address>a:hover {
68
+ color: #FFF;
69
+ background-color: #777;
70
+ }
71
+
72
+ body>div>div>* {
73
+ width: inherit;
74
+ }
75
+
76
+ body>div>div>h1 {
77
+ border-bottom: 1px dotted #555;
78
+ }
79
+
80
+ pre {
81
+ padding: 4px;
82
+ font: 13.34px monaco,terminus,courrier,monospace;
83
+ color: #000;
84
+ background-color: #DDD;
85
+ }
86
+
87
+ code {
88
+ font: 13.34px monaco,terminus,courrier,monospace;
89
+ }
90
+
91
+ div#header,
92
+ div#footer {
93
+ width: 100%;
94
+ padding: 4px 0px 4px 0px;
95
+ background-color: #1F3366
96
+ }
97
+
98
+ img#logo {
99
+ top: 4px;
100
+ right: 2px;
101
+ position: absolute;
102
+ display: block;
103
+ }
104
+
105
+ div#header *,
106
+ div#footer * {
107
+ color: #FFF;
108
+ margin: 0px;
109
+ }
110
+
111
+ div#header h1, div#header h2, div#header span {
112
+ padding-left: 4px;
113
+ }
114
+
115
+ div#header h1>* {
116
+ display: block;
117
+ font-size: 28px;
118
+ font-weight: bold;
119
+ }
120
+
121
+ div#footer p {
122
+ text-align: center;
123
+ }
124
+
125
+ div#navigation-bar {
126
+ width:100%;
127
+ height: 32px;
128
+ vertical-align: middle;
129
+ background-image: url(../images/navigation-bar.gif);
130
+ }
131
+
132
+ div#navigation-bar address,
133
+ div#navigation-bar a {
134
+ height: inherit;
135
+ }
136
+
137
+ div#navigation-bar a {
138
+ height: 24px;
139
+ padding-top: 8px;
140
+ font-size: 14px;
141
+ font-weight: bold;
142
+ color: #FFF;
143
+ border-right: 2px groove #5C6E9A;
144
+ }
145
+
146
+ div#navigation-bar a:hover {
147
+ background-color: #445172;
148
+ }
149
+
150
+ div#navigation-bar form {
151
+ float: right;
152
+ width: auto;
153
+ }
154
+
155
+ div#navigation-bar form input[type="text"] {
156
+ width: 12em;
157
+ height: 24px;
158
+ padding-top: 6px;
159
+ font-weight: bold;
160
+ color: #FFF;
161
+ text-align: center;
162
+ border: none;
163
+ border-left: 2px groove #5C6E9A;
164
+ background-image: url(../images/navigation-bar.gif);
165
+ }
166
+
167
+ div#navigation-bar form input[type="text"]:focus,
168
+ div#navigation-bar form input[type="text"]:hover {
169
+ background-image: none;
170
+ background-color: #FFF;
171
+ color: #445172;
172
+ }
173
+
174
+ div#content {
175
+ width:60%;
176
+ }
177
+
178
+ div#options {
179
+ width:40%;
180
+ }
181
+
182
+ .entry {
183
+ margin: 16px;
184
+ background-color: #FFF;
185
+ -moz-border-radius: 8px;
186
+ -webkit-border-radius: 8px;
187
+ border: 1px solid #5C6E9A;
188
+ }
189
+
190
+ div#content .entry {
191
+ margin-right: 8px;
192
+ }
193
+
194
+ div#options .entry {
195
+ margin-left: 8px;
196
+ }
197
+
198
+ .entry h1 {
199
+ padding: 2px 12px 2px 12px;
200
+ border-bottom: 1px solid #5C6E9A;
201
+ }
202
+
203
+ .entry h1 * {
204
+ color: #5C6E9A;
205
+ }
206
+
207
+ .entry h1 a {
208
+ display: block;
209
+ }
210
+
211
+ .entry-meta,
212
+ .text {
213
+ padding: 2px 12px 2px 12px;
214
+ }
215
+
216
+ .entry-meta,
217
+ .entry-meta * {
218
+ font-style: italic;
219
+ }
220
+
221
+ .entry ul {
222
+ padding: 2px 12px 2px 12px;
223
+ padding-left: 32px;
224
+ }
225
+
226
+ .text {
227
+ margin: 8px auto 8px auto;
228
+ text-align: justify;
229
+ }
230
+
231
+ .text h2 {
232
+ border-bottom: 1px dotted #5C6E9A;
233
+ }
234
+
235
+ .text p {
236
+ padding: 16px auto 16px auto;
237
+ }
238
+