nesta 0.9.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 (53) hide show
  1. data/.gitignore +13 -0
  2. data/Gemfile +6 -0
  3. data/Gemfile.lock +58 -0
  4. data/LICENSE +19 -0
  5. data/README.md +45 -0
  6. data/Rakefile +12 -0
  7. data/bin/nesta +67 -0
  8. data/config.ru +9 -0
  9. data/config/config.yml.sample +73 -0
  10. data/config/deploy.rb.sample +62 -0
  11. data/lib/nesta/app.rb +199 -0
  12. data/lib/nesta/cache.rb +139 -0
  13. data/lib/nesta/commands.rb +135 -0
  14. data/lib/nesta/config.rb +87 -0
  15. data/lib/nesta/models.rb +313 -0
  16. data/lib/nesta/nesta.rb +0 -0
  17. data/lib/nesta/overrides.rb +59 -0
  18. data/lib/nesta/path.rb +11 -0
  19. data/lib/nesta/plugins.rb +15 -0
  20. data/lib/nesta/version.rb +3 -0
  21. data/nesta.gemspec +49 -0
  22. data/scripts/import-from-mephisto +207 -0
  23. data/spec/atom_spec.rb +138 -0
  24. data/spec/commands_spec.rb +220 -0
  25. data/spec/config_spec.rb +69 -0
  26. data/spec/model_factory.rb +94 -0
  27. data/spec/models_spec.rb +445 -0
  28. data/spec/overrides_spec.rb +113 -0
  29. data/spec/page_spec.rb +428 -0
  30. data/spec/path_spec.rb +28 -0
  31. data/spec/sitemap_spec.rb +102 -0
  32. data/spec/spec.opts +1 -0
  33. data/spec/spec_helper.rb +72 -0
  34. data/templates/Gemfile +8 -0
  35. data/templates/Rakefile +35 -0
  36. data/templates/config.ru +9 -0
  37. data/templates/config/config.yml +73 -0
  38. data/templates/config/deploy.rb +47 -0
  39. data/views/analytics.haml +12 -0
  40. data/views/atom.builder +28 -0
  41. data/views/categories.haml +3 -0
  42. data/views/comments.haml +8 -0
  43. data/views/error.haml +13 -0
  44. data/views/feed.haml +3 -0
  45. data/views/index.haml +5 -0
  46. data/views/layout.haml +27 -0
  47. data/views/master.sass +246 -0
  48. data/views/not_found.haml +13 -0
  49. data/views/page.haml +29 -0
  50. data/views/sidebar.haml +3 -0
  51. data/views/sitemap.builder +15 -0
  52. data/views/summaries.haml +14 -0
  53. metadata +302 -0
data/views/error.haml ADDED
@@ -0,0 +1,13 @@
1
+ .breadcrumb
2
+ %a{ :href => "/" } Home
3
+
4
+ #content
5
+ %h1 Sorry, something went wrong
6
+
7
+ %p
8
+ An error occurred whilst we were trying to serve your page. Please bear
9
+ with us, or in the mean time, try another page.
10
+
11
+ #sidebar
12
+ = haml :categories, :layout => false
13
+ = haml :feed, :layout => false
data/views/feed.haml ADDED
@@ -0,0 +1,3 @@
1
+ - title ||= "Atom feed"
2
+ .feed
3
+ %a{ :href => "/articles.xml", :title => title }= title
data/views/index.haml ADDED
@@ -0,0 +1,5 @@
1
+ #content
2
+ %h1 Recent articles
3
+ = haml :summaries, :layout => false, :locals => { :pages => @articles, :heading => :h2 }
4
+
5
+ = haml :sidebar, :layout => false
data/views/layout.haml ADDED
@@ -0,0 +1,27 @@
1
+ !!!
2
+ %html{ :lang => "en", "xml:lang" => "en", :xmlns => 'http://www.w3.org/1999/xhtml' }
3
+ %head
4
+ %meta{ "http-equiv" => "content-type", "content" => "text/html; charset=utf-8" }
5
+ - if @description
6
+ %meta{ "name" => "description", "content" => @description }
7
+ - if @keywords
8
+ %meta{ "name" => "keywords", "content" => @keywords }
9
+ %title= @title
10
+ %link{ :href => "/css/master.css", :media => "screen", :rel => "stylesheet", :type => "text/css" }
11
+ - if local_stylesheet?
12
+ %link{ :href => "/css/local.css", :media => "screen", :rel => "stylesheet", :type => "text/css" }
13
+ %link{ :href => "/articles.xml", :rel => "alternate", :type => "application/atom+xml" }
14
+ = haml :analytics, :layout => false
15
+ %body{ :class => @body_class }
16
+ #container
17
+ #header
18
+ %p.title= @heading
19
+ %p.subtitle= @subtitle
20
+ = yield
21
+ #footer
22
+ %p
23
+ Powered by
24
+ = succeed "," do
25
+ %a{ :href => "http://effectif.com/nesta" } nesta
26
+ designed by
27
+ %a{ :href => "http://effectif.com" } Graham Ashton
data/views/master.sass ADDED
@@ -0,0 +1,246 @@
1
+ // Variables
2
+
3
+ $content-width: 37em
4
+
5
+ $tint: #D3D4D8
6
+ $base-color: $tint - #888
7
+ $dark-tint: $tint - #333
8
+ $background-tint: $tint + #222
9
+ $border-color: $tint + #111
10
+
11
+ $h1-scale: 2.18
12
+ $h2-scale: 1.64
13
+ $h3-scale: 1.45
14
+ $h4-scale: 1.18
15
+
16
+ // Reset
17
+
18
+ *
19
+ margin: 0
20
+ padding: 0
21
+
22
+ // Typography
23
+
24
+ $base-scale: 0.88
25
+ $base-font: $base-scale * 1em
26
+ $vertical-rhythm: 1.5em
27
+ $base-vertical-margin: 1.5em
28
+
29
+ @mixin adjust-font-size($scale, $top-weight: 1, $bottom-weight: 1)
30
+ $average-margin: $base-vertical-margin / $scale
31
+ margin-top: $average-margin * $top-weight
32
+ margin-bottom: $average-margin * $bottom-weight
33
+
34
+ $line-height: $vertical-rhythm / $scale
35
+ @if $line-height < 1
36
+ line-height: $line-height * 2
37
+ @else
38
+ line-height: $line-height
39
+
40
+ font-size: 100% * $scale
41
+
42
+ @mixin border-radius($radius)
43
+ -webkit-border-radius: $radius
44
+ -moz-border-radius: $radius
45
+ border-radius: $radius
46
+
47
+ body
48
+ font: $base-font "Helvetica Neue", Helvetica, sans-serif
49
+ line-height: $vertical-rhythm
50
+ color: $base-color
51
+
52
+ h1, h2, h3, h4, h5, h6
53
+ font-family: "Helvetica Neue", Helvetica, sans-serif
54
+ h1
55
+ @include adjust-font-size($h1-scale, 0.6, 0.4)
56
+ font-weight: normal
57
+ h2
58
+ @include adjust-font-size($h2-scale, 1.5, 0.5)
59
+ font-weight: normal
60
+ h3
61
+ @include adjust-font-size($h3-scale, 1.5, 0.5)
62
+ font-weight: normal
63
+ h4
64
+ @include adjust-font-size($h4-scale, 2, 0)
65
+
66
+ ol,
67
+ p,
68
+ pre,
69
+ ul
70
+ margin: 0
71
+ margin-bottom: $base-vertical-margin
72
+
73
+ li
74
+ @include adjust-font-size(1, 0, 0)
75
+
76
+ blockquote
77
+ margin: $base-vertical-margin 0
78
+ border-left: 0.5em solid $tint
79
+ padding-left: 1em
80
+
81
+ font-style: italic
82
+
83
+ pre
84
+ padding: ($vertical-rhythm / 2) 1em
85
+ overflow: auto
86
+
87
+ img
88
+ border: none
89
+
90
+ // Layout
91
+
92
+ div#container
93
+ width: 54em
94
+ margin: 0 auto
95
+
96
+ div#header
97
+ padding: 1em
98
+
99
+ div.breadcrumb
100
+ padding: 0.5em 1.1em
101
+
102
+ font-size: 0.909em
103
+
104
+ div#content
105
+ width: $content-width
106
+ float: left
107
+ padding: 1px 1em
108
+
109
+ div#sidebar
110
+ width: 12em
111
+ margin-left: 40em
112
+ padding: 1px 1em
113
+
114
+ div#footer
115
+ clear: both
116
+ padding: 0 1em
117
+ p
118
+ width: $content-width
119
+ margin: 0
120
+ padding: 1em 0
121
+
122
+ // The visuals
123
+
124
+ @mixin dark-tint-text
125
+ color: $dark-tint
126
+ text-shadow: 0 -1px 1px white
127
+
128
+ body
129
+ background: $background-tint
130
+
131
+ &.home h1
132
+ @include adjust-font-size($h1-scale, 1, -1)
133
+
134
+ div#header
135
+ p.title,
136
+ p.subtitle
137
+ margin: 0
138
+ line-height: 1.2em
139
+ font-weight: normal
140
+ p.title
141
+ font-size: 327%
142
+ text-shadow: -1px 2px 1px $tint
143
+ p.subtitle
144
+ font-size: 1em
145
+ @include dark-tint-text
146
+
147
+ div#content
148
+ position: relative
149
+ @include border-radius(0.5em)
150
+ background-color: white
151
+
152
+ div.date
153
+ position: absolute
154
+ right: 40em
155
+ top: $vertical-rhythm * 3
156
+ text-align: right
157
+ @include dark-tint-text
158
+
159
+ h2
160
+ background: $background-tint - #111
161
+ margin-left: (-2em / $h2-scale) * $base-scale
162
+ margin-right: 0
163
+ padding-left: 1em
164
+ padding-right: 1em
165
+
166
+ text-shadow: 0 1px 0 $tint + #333
167
+
168
+ ol,
169
+ ul
170
+ margin-left: 1.5em
171
+
172
+ img
173
+ max-width: 100%
174
+ margin-bottom: $base-vertical-margin
175
+
176
+ code,
177
+ pre
178
+ background-color: $background-tint
179
+ code
180
+ padding: 1px 3px
181
+ pre
182
+ border-left: 0.4em solid $border-color
183
+ code
184
+ padding: 0
185
+
186
+ // Pages/articles assigned to this page
187
+ ol.pages
188
+ margin-left: 0
189
+ li
190
+ position: relative
191
+
192
+ margin-left: -1.5em
193
+ padding-left: 1.5em
194
+ background-color: rgba(255, 255, 255, 0.8)
195
+
196
+ list-style: none
197
+
198
+ h2
199
+ margin-left: 0
200
+ margin-right: 0
201
+ padding: 0
202
+ background: none
203
+
204
+ div.date
205
+ top: $vertical-rhythm * 2.5
206
+ right: 39em
207
+ h3 + div.date
208
+ top: $vertical-rhythm * 1.5
209
+
210
+ p.read_more
211
+ @include adjust-font-size(0.909, 0, 0)
212
+
213
+ div.categories
214
+ margin-left: -1em
215
+ margin-right: -1em
216
+ border-top: 1px solid $background-tint - #0a0a0a
217
+ padding: 0.5em 1em
218
+ background: $background-tint
219
+ a
220
+ margin-right: 0.25em
221
+
222
+ div#disqus_thread
223
+ img
224
+ max-width: none
225
+ ul#dsq-comments
226
+ margin-left: 0
227
+
228
+ div#sidebar
229
+ @include border-radius(0.5em)
230
+ background-color: white
231
+ background-color: rgba(255, 255, 255, 0.9)
232
+
233
+ h2
234
+ @include adjust-font-size(1, 1.4, 0.6)
235
+ font-weight: bold
236
+ ul.menu
237
+ list-style: none
238
+ ul
239
+ list-style: disc
240
+ margin: 0 0 0 1.25em
241
+ & > ul
242
+ @include adjust-font-size(0.909, 0, 0)
243
+
244
+ div.feed,
245
+ div.social
246
+ margin: $base-vertical-margin 0
@@ -0,0 +1,13 @@
1
+ .breadcrumb
2
+ %a{ :href => "/" } Home
3
+
4
+ #content
5
+ %h1 Page not found
6
+
7
+ %p
8
+ Please try another page or, if you think something is wrong with our site,
9
+ do get in touch and let us know.
10
+
11
+ #sidebar
12
+ = haml :categories, :layout => false
13
+ = haml :feed, :layout => false
data/views/page.haml ADDED
@@ -0,0 +1,29 @@
1
+ .breadcrumb
2
+ %a{ :href => "/" } Home
3
+ &gt;
4
+ - if @page.parent
5
+ %a{ :href => @page.parent.abspath }= @page.parent.heading
6
+ &gt;
7
+ = @page.heading
8
+
9
+ #content
10
+ - if @page.date
11
+ .date= format_date(@page.date)
12
+
13
+ ~ @page.to_html(self)
14
+
15
+ = haml :summaries, :layout => false, :locals => { :pages => @page.pages, :heading => :h3 }
16
+
17
+ - unless @page.articles.empty?
18
+ %h2= "Articles on #{@page.heading}"
19
+ = haml :summaries, :layout => false, :locals => { :pages => @page.articles, :heading => :h3 }
20
+
21
+ - unless @page.categories.empty?
22
+ .categories
23
+ %strong Categories:
24
+ - @page.categories.each do |category|
25
+ %a{ :href => category.abspath }= category.heading
26
+
27
+ = haml :comments, :layout => false
28
+
29
+ = haml :sidebar, :layout => false
@@ -0,0 +1,3 @@
1
+ #sidebar
2
+ = haml :categories, :layout => false
3
+ = haml :feed, :layout => false
@@ -0,0 +1,15 @@
1
+ xml.instruct!
2
+ xml.urlset :xmlns => "http://www.sitemaps.org/schemas/sitemap/0.9" do
3
+ xml.url do
4
+ xml.loc base_url
5
+ xml.changefreq "daily"
6
+ xml.priority "1.0"
7
+ xml.lastmod @last.xmlschema
8
+ end
9
+ @pages.each do |page|
10
+ xml.url do
11
+ xml.loc url_for(page)
12
+ xml.lastmod page.last_modified.xmlschema
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ - unless pages.empty?
2
+ %ol.pages
3
+ - pages.each do |page|
4
+ %li
5
+ - haml_tag heading do
6
+ %a{ :href => page.abspath }= page.heading
7
+ - if page.date
8
+ .date= format_date(page.date)
9
+ - if page.summary.nil? || page.summary.empty?
10
+ ~ page.body
11
+ - else
12
+ ~ page.summary
13
+ %p.read_more
14
+ %a{ :href => page.abspath }= page.read_more
metadata ADDED
@@ -0,0 +1,302 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nesta
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 9
8
+ - 0
9
+ version: 0.9.0
10
+ platform: ruby
11
+ authors:
12
+ - Graham Ashton
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-12-20 00:00:00 +00:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: builder
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - "="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 1
30
+ - 2
31
+ version: 2.1.2
32
+ type: :runtime
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: haml
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - "="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 3
44
+ - 0
45
+ - 12
46
+ version: 3.0.12
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: maruku
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - "="
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 0
59
+ - 6
60
+ - 0
61
+ version: 0.6.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: RedCloth
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - "="
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 4
74
+ - 2
75
+ - 2
76
+ version: 4.2.2
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
81
+ name: sinatra
82
+ requirement: &id005 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - "="
86
+ - !ruby/object:Gem::Version
87
+ segments:
88
+ - 1
89
+ - 1
90
+ - 0
91
+ version: 1.1.0
92
+ type: :runtime
93
+ prerelease: false
94
+ version_requirements: *id005
95
+ - !ruby/object:Gem::Dependency
96
+ name: shotgun
97
+ requirement: &id006 !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ segments:
103
+ - 0
104
+ - 8
105
+ version: "0.8"
106
+ type: :runtime
107
+ prerelease: false
108
+ version_requirements: *id006
109
+ - !ruby/object:Gem::Dependency
110
+ name: hpricot
111
+ requirement: &id007 !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - "="
115
+ - !ruby/object:Gem::Version
116
+ segments:
117
+ - 0
118
+ - 8
119
+ - 2
120
+ version: 0.8.2
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: *id007
124
+ - !ruby/object:Gem::Dependency
125
+ name: rack-test
126
+ requirement: &id008 !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - "="
130
+ - !ruby/object:Gem::Version
131
+ segments:
132
+ - 0
133
+ - 5
134
+ - 3
135
+ version: 0.5.3
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: *id008
139
+ - !ruby/object:Gem::Dependency
140
+ name: rspec
141
+ requirement: &id009 !ruby/object:Gem::Requirement
142
+ none: false
143
+ requirements:
144
+ - - "="
145
+ - !ruby/object:Gem::Version
146
+ segments:
147
+ - 1
148
+ - 3
149
+ - 0
150
+ version: 1.3.0
151
+ type: :development
152
+ prerelease: false
153
+ version_requirements: *id009
154
+ - !ruby/object:Gem::Dependency
155
+ name: rspec_hpricot_matchers
156
+ requirement: &id010 !ruby/object:Gem::Requirement
157
+ none: false
158
+ requirements:
159
+ - - "="
160
+ - !ruby/object:Gem::Version
161
+ segments:
162
+ - 1
163
+ - 0
164
+ version: "1.0"
165
+ type: :development
166
+ prerelease: false
167
+ version_requirements: *id010
168
+ - !ruby/object:Gem::Dependency
169
+ name: test-unit
170
+ requirement: &id011 !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - "="
174
+ - !ruby/object:Gem::Version
175
+ segments:
176
+ - 1
177
+ - 2
178
+ - 3
179
+ version: 1.2.3
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: *id011
183
+ description: |
184
+ Nesta is a lightweight Content Management System, written in Ruby using
185
+ the Sinatra web framework. Nesta has the simplicity of a static site
186
+ generator, but (being a fully fledged Rack application) allows you to
187
+ serve dynamic content on demand.
188
+
189
+ Content is stored on disk in plain text files (there is no database).
190
+ Edit your content in a text editor and keep it under version control
191
+ (most people use git, but any version control system will do fine).
192
+
193
+ Implementing your site's design is easy, but Nesta also has a small
194
+ selection of themes to choose from.
195
+
196
+ email:
197
+ - graham@effectif.com
198
+ executables:
199
+ - nesta
200
+ extensions: []
201
+
202
+ extra_rdoc_files: []
203
+
204
+ files:
205
+ - .gitignore
206
+ - Gemfile
207
+ - Gemfile.lock
208
+ - LICENSE
209
+ - README.md
210
+ - Rakefile
211
+ - bin/nesta
212
+ - config.ru
213
+ - config/config.yml.sample
214
+ - config/deploy.rb.sample
215
+ - lib/nesta/app.rb
216
+ - lib/nesta/cache.rb
217
+ - lib/nesta/commands.rb
218
+ - lib/nesta/config.rb
219
+ - lib/nesta/models.rb
220
+ - lib/nesta/nesta.rb
221
+ - lib/nesta/overrides.rb
222
+ - lib/nesta/path.rb
223
+ - lib/nesta/plugins.rb
224
+ - lib/nesta/version.rb
225
+ - nesta.gemspec
226
+ - scripts/import-from-mephisto
227
+ - spec/atom_spec.rb
228
+ - spec/commands_spec.rb
229
+ - spec/config_spec.rb
230
+ - spec/model_factory.rb
231
+ - spec/models_spec.rb
232
+ - spec/overrides_spec.rb
233
+ - spec/page_spec.rb
234
+ - spec/path_spec.rb
235
+ - spec/sitemap_spec.rb
236
+ - spec/spec.opts
237
+ - spec/spec_helper.rb
238
+ - templates/Gemfile
239
+ - templates/Rakefile
240
+ - templates/config.ru
241
+ - templates/config/config.yml
242
+ - templates/config/deploy.rb
243
+ - views/analytics.haml
244
+ - views/atom.builder
245
+ - views/categories.haml
246
+ - views/comments.haml
247
+ - views/error.haml
248
+ - views/feed.haml
249
+ - views/index.haml
250
+ - views/layout.haml
251
+ - views/master.sass
252
+ - views/not_found.haml
253
+ - views/page.haml
254
+ - views/sidebar.haml
255
+ - views/sitemap.builder
256
+ - views/summaries.haml
257
+ has_rdoc: true
258
+ homepage: http://effectif.com/nesta
259
+ licenses: []
260
+
261
+ post_install_message:
262
+ rdoc_options: []
263
+
264
+ require_paths:
265
+ - lib
266
+ required_ruby_version: !ruby/object:Gem::Requirement
267
+ none: false
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ hash: 4334237335545750937
272
+ segments:
273
+ - 0
274
+ version: "0"
275
+ required_rubygems_version: !ruby/object:Gem::Requirement
276
+ none: false
277
+ requirements:
278
+ - - ">="
279
+ - !ruby/object:Gem::Version
280
+ hash: 4334237335545750937
281
+ segments:
282
+ - 0
283
+ version: "0"
284
+ requirements: []
285
+
286
+ rubyforge_project: nesta
287
+ rubygems_version: 1.3.7
288
+ signing_key:
289
+ specification_version: 3
290
+ summary: Ruby CMS, written in Sinatra
291
+ test_files:
292
+ - spec/atom_spec.rb
293
+ - spec/commands_spec.rb
294
+ - spec/config_spec.rb
295
+ - spec/model_factory.rb
296
+ - spec/models_spec.rb
297
+ - spec/overrides_spec.rb
298
+ - spec/page_spec.rb
299
+ - spec/path_spec.rb
300
+ - spec/sitemap_spec.rb
301
+ - spec/spec.opts
302
+ - spec/spec_helper.rb