mars-nesta 0.9.4

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 (61) hide show
  1. data/.gitignore +13 -0
  2. data/CHANGES +97 -0
  3. data/Gemfile +6 -0
  4. data/Gemfile.lock +44 -0
  5. data/LICENSE +19 -0
  6. data/README.md +42 -0
  7. data/Rakefile +12 -0
  8. data/bin/nesta +79 -0
  9. data/config.ru +9 -0
  10. data/config/deploy.rb.sample +62 -0
  11. data/lib/nesta/app.rb +167 -0
  12. data/lib/nesta/cache.rb +139 -0
  13. data/lib/nesta/commands.rb +188 -0
  14. data/lib/nesta/config.rb +86 -0
  15. data/lib/nesta/models.rb +364 -0
  16. data/lib/nesta/navigation.rb +60 -0
  17. data/lib/nesta/nesta.rb +7 -0
  18. data/lib/nesta/overrides.rb +59 -0
  19. data/lib/nesta/path.rb +11 -0
  20. data/lib/nesta/plugins.rb +15 -0
  21. data/lib/nesta/version.rb +3 -0
  22. data/nesta.gemspec +48 -0
  23. data/scripts/import-from-mephisto +207 -0
  24. data/spec/atom_spec.rb +138 -0
  25. data/spec/commands_spec.rb +292 -0
  26. data/spec/config_spec.rb +69 -0
  27. data/spec/model_factory.rb +94 -0
  28. data/spec/models_spec.rb +554 -0
  29. data/spec/overrides_spec.rb +114 -0
  30. data/spec/page_spec.rb +458 -0
  31. data/spec/path_spec.rb +28 -0
  32. data/spec/sitemap_spec.rb +102 -0
  33. data/spec/spec.opts +1 -0
  34. data/spec/spec_helper.rb +70 -0
  35. data/templates/Gemfile +8 -0
  36. data/templates/Rakefile +11 -0
  37. data/templates/config.ru +9 -0
  38. data/templates/config/config.yml +67 -0
  39. data/templates/config/deploy.rb +47 -0
  40. data/templates/index.haml +1 -0
  41. data/templates/themes/README.md +7 -0
  42. data/templates/themes/app.rb +19 -0
  43. data/views/analytics.haml +12 -0
  44. data/views/atom.haml +28 -0
  45. data/views/categories.haml +4 -0
  46. data/views/colors.sass +10 -0
  47. data/views/comments.haml +8 -0
  48. data/views/error.haml +12 -0
  49. data/views/feed.haml +3 -0
  50. data/views/footer.haml +5 -0
  51. data/views/header.haml +4 -0
  52. data/views/layout.haml +24 -0
  53. data/views/master.sass +246 -0
  54. data/views/mixins.sass +39 -0
  55. data/views/not_found.haml +12 -0
  56. data/views/page.haml +21 -0
  57. data/views/page_meta.haml +16 -0
  58. data/views/sidebar.haml +3 -0
  59. data/views/sitemap.haml +11 -0
  60. data/views/summaries.haml +15 -0
  61. metadata +235 -0
@@ -0,0 +1,8 @@
1
+ - if short_name = Nesta::Config.disqus_short_name
2
+ #disqus_thread
3
+ - if Sinatra::Application.environment == :development
4
+ %script(type="text/javascript")
5
+ var disqus_developer = true;
6
+ %script(type="text/javascript" src="http://disqus.com/forums/#{short_name}/embed.js")
7
+ %noscript
8
+ %a(href="http://disqus.com/forums/#{short_name}/?url=ref") View comments.
data/views/error.haml ADDED
@@ -0,0 +1,12 @@
1
+ %nav.breadcrumb
2
+ %a(href="/") Home
3
+
4
+ #content
5
+ %section(role="main")
6
+ %h1 Sorry, something went wrong
7
+
8
+ %p
9
+ An error occurred whilst we were trying to serve your page. Please
10
+ bear with us, or try another page.
11
+
12
+ = haml :sidebar, :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/footer.haml ADDED
@@ -0,0 +1,5 @@
1
+ %footer.branding
2
+ %p
3
+ Powered by Nesta, a
4
+ = succeed "." do
5
+ %a(href="http://nestacms.com") Ruby CMS
data/views/header.haml ADDED
@@ -0,0 +1,4 @@
1
+ %header(role="banner")
2
+ %hgroup
3
+ %h1= @heading
4
+ %h2= @subtitle
data/views/layout.haml ADDED
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ %html(lang="en")
3
+ %head
4
+ %meta(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
+ <!--[if ! lte IE 6]><!-->
11
+ %link(href="/css/master.css" media="screen" rel="stylesheet")
12
+ <!--<![endif]-->
13
+ /[if lte IE 6]
14
+ %link(rel="stylesheet" href="http://universal-ie6-css.googlecode.com/files/ie6.1.1.css" media="screen, projection")
15
+ /[if lt IE 9]
16
+ %script(src="//html5shim.googlecode.com/svn/trunk/html5.js")
17
+ = local_stylesheet_link_tag('local')
18
+ %link(href="/articles.xml" rel="alternate" type="application/atom+xml")
19
+ = haml :analytics, :layout => false
20
+ %body
21
+ #container
22
+ = haml :header, :layout => false
23
+ = yield
24
+ = haml :footer, :layout => false
data/views/master.sass ADDED
@@ -0,0 +1,246 @@
1
+ @import "mixins.sass"
2
+ @import "colors.sass"
3
+
4
+ // Variables
5
+
6
+ $content-width: 37em
7
+
8
+ $border-style: 1px dashed $border-color
9
+
10
+ // Reset
11
+
12
+ *
13
+ margin: 0
14
+ padding: 0
15
+
16
+ // Typography
17
+
18
+ @mixin text-shadow
19
+ text-shadow: 0 2px 3px #ddd
20
+
21
+ body
22
+ font: ($base-font * 1.05) Georgia, serif
23
+ line-height: $vertical-rhythm
24
+ color: $base-color
25
+
26
+ header[role=banner]
27
+ h1,
28
+ h2
29
+ margin: 0
30
+ line-height: 1.2em
31
+ font-weight: normal
32
+ h1
33
+ font-size: 327%
34
+ @include text-shadow
35
+ h2
36
+ color: $meta-color
37
+ font-size: 1em
38
+
39
+ h1, h2, h3, h4, h5, h6
40
+ font-family: Georgia, serif
41
+ h1
42
+ @include adjust-font-size($h1-scale, 0.6, 0.4)
43
+ font-weight: normal
44
+ h2
45
+ @include adjust-font-size($h2-scale, 1.5, 0.5)
46
+ font-weight: normal
47
+ h3
48
+ @include adjust-font-size($h3-scale, 1.5, 0.5)
49
+ font-weight: normal
50
+ h4
51
+ @include adjust-font-size($h4-scale, 2, 0)
52
+
53
+ ol,
54
+ p,
55
+ pre,
56
+ ul
57
+ margin: 0
58
+ margin-bottom: $base-vertical-margin
59
+
60
+ li
61
+ @include adjust-font-size(1, 0, 0)
62
+
63
+ blockquote
64
+ margin: $base-vertical-margin 0
65
+ padding: 0 $base-vertical-margin
66
+
67
+ font-style: italic
68
+ color: $base-color + #555
69
+
70
+ pre
71
+ padding: ($vertical-rhythm / 2) 1em
72
+ overflow: auto
73
+
74
+ img
75
+ border: none
76
+
77
+ nav.breadcrumb
78
+ margin-top: $vertical-rhythm
79
+ color: $meta-color
80
+ padding: 0.5em 0
81
+
82
+ font-size: 0.909em
83
+
84
+ // Layout
85
+
86
+ article, aside, footer, header, nav, section
87
+ display: block
88
+
89
+ div#container
90
+ width: 54em
91
+ margin: 0 auto
92
+ padding: 1em 1em 0 1em
93
+
94
+ div#content
95
+ position: relative
96
+ width: $content-width
97
+ float: left
98
+ padding: 1px 0
99
+
100
+ div#sidebar
101
+ width: 12em
102
+ margin-left: 40em
103
+ padding: 0 1em
104
+
105
+ footer.branding
106
+ clear: both
107
+ color: $meta-color
108
+ @include adjust-font-size($base-scale)
109
+ p
110
+ width: $content-width
111
+ margin: 0
112
+ padding: 1em 0
113
+
114
+ // The visuals
115
+
116
+ a
117
+ border-bottom: 1px dotted $link-color
118
+ text-decoration: none
119
+ color: $link-color
120
+ @include transition(color 0.25s 0 ease)
121
+ &:visited
122
+ color: $visited-link-color
123
+ border-bottom-color: $visited-link-color
124
+ &:hover
125
+ color: $hover-link-color
126
+ border-bottom-color: $hover-link-color
127
+ &:active
128
+ color: $active-link-color
129
+ border-bottom-color: $active-link-color
130
+
131
+ nav.breadcrumb
132
+ ul
133
+ margin: 0
134
+ li
135
+ display: inline
136
+ list-style: none
137
+ &::after
138
+ content: " > "
139
+ &:last-child::after
140
+ content: ""
141
+
142
+ nav.breadcrumb,
143
+ nav.categories,
144
+ div.feed,
145
+ article p.meta
146
+ a
147
+ color: $nav-link-color
148
+ &:hover a
149
+ color: $link-color
150
+ a:hover
151
+ color: $hover-link-color
152
+
153
+ nav.categories,
154
+ div.feed,
155
+ article p.meta
156
+ a
157
+ border-bottom-color: $background-color
158
+
159
+ article p.meta
160
+ a
161
+ @include transition(border-bottom-color 0.5s 0 ease)
162
+ a:hover
163
+ border-bottom-color: $hover-link-color
164
+
165
+ article h1 a
166
+ border-bottom: none
167
+
168
+ body
169
+ background: $background-color
170
+
171
+ article
172
+ img
173
+ max-width: 100%
174
+ margin-bottom: $base-vertical-margin
175
+
176
+ code,
177
+ pre
178
+ background-color: $tint
179
+ code
180
+ padding: 1px 3px
181
+ pre
182
+ border-left: $border-style
183
+ background-color: $tint
184
+ code
185
+ padding: 0
186
+
187
+ footer
188
+ border-top: $border-style
189
+ p.meta
190
+ @include adjust-font-size(0.909, 0.1, 1.9)
191
+ font-style: italic
192
+ color: $meta-color
193
+
194
+ // Pages of content
195
+ article[role="main"]
196
+ h1, h2
197
+ @include text-shadow
198
+
199
+ div#disqus_thread
200
+ img
201
+ max-width: none
202
+ ul#dsq-comments
203
+ margin-left: 0
204
+
205
+ // Pages/articles assigned to this page
206
+ section.pages,
207
+ section.articles
208
+ & > ol
209
+ margin-left: 0
210
+ li
211
+ position: relative
212
+ list-style: none
213
+ article
214
+ ol li
215
+ list-style: decimal
216
+ ul li
217
+ list-style: disc
218
+
219
+ header[role=main] h1
220
+ @include adjust-font-size($h1-scale, 1.5, 0.5)
221
+ header h1
222
+ @include adjust-font-size($h2-scale, 1.5, 0.5)
223
+
224
+ article
225
+ h1
226
+ text-shadow: none
227
+ p.read_more
228
+ @include adjust-font-size(1, 0, 0)
229
+ margin-top: -$base-vertical-margin
230
+ footer
231
+ border-top: none
232
+
233
+ nav.categories
234
+ h1
235
+ @include adjust-font-size(1, 2, 0)
236
+
237
+ ul.menu
238
+ list-style: none
239
+ ul
240
+ list-style: disc
241
+ margin: 0 0 0 1.25em
242
+ & > ul
243
+ @include adjust-font-size(0.909, 0, 0)
244
+
245
+ div.feed
246
+ margin: $base-vertical-margin 0
data/views/mixins.sass ADDED
@@ -0,0 +1,39 @@
1
+ // Default ratios between font sizes; used to maintain the type hierarchy.
2
+ // http://www.markboulton.co.uk/journal/comments/five-simple-steps-to-better-typography-part-4
3
+
4
+ $h1-scale: 2.18
5
+ $h2-scale: 1.64
6
+ $h3-scale: 1.45
7
+ $h4-scale: 1.18
8
+
9
+ // Variables used in calculations used to maintain vertical rhythm.
10
+ // http://webtypography.net/Rhythm_and_Proportion/Vertical_Motion/2.2.2/
11
+
12
+ $base-scale: 0.88
13
+ $base-font: $base-scale * 1em
14
+ $vertical-rhythm: 1.75em
15
+ $base-vertical-margin: 1.75em
16
+
17
+ @mixin adjust-font-size($scale, $top-weight: 1, $bottom-weight: 1)
18
+ $average-margin: $base-vertical-margin / $scale
19
+ margin-top: $average-margin * $top-weight
20
+ margin-bottom: $average-margin * $bottom-weight
21
+
22
+ $line-height: $vertical-rhythm / $scale
23
+ @if $line-height < 1
24
+ line-height: $line-height * 2
25
+ @else
26
+ line-height: $line-height
27
+
28
+ font-size: 100% * $scale
29
+
30
+ @mixin border-radius($radius)
31
+ -webkit-border-radius: $radius
32
+ -moz-border-radius: $radius
33
+ border-radius: $radius
34
+
35
+ @mixin transition($definition)
36
+ -moz-transition: $definition
37
+ -o-transition: $definition
38
+ -webkit-transition: $definition
39
+ transition: $definition
@@ -0,0 +1,12 @@
1
+ %nav.breadcrumb
2
+ %a(href="/") Home
3
+
4
+ #content
5
+ %section(role="main")
6
+ %h1 Page not found
7
+
8
+ %p
9
+ Please try another page or, if you think something is wrong with
10
+ our site, do get in touch and let us know.
11
+
12
+ = haml :sidebar, :layout => false
data/views/page.haml ADDED
@@ -0,0 +1,21 @@
1
+ %nav.breadcrumb
2
+ - display_breadcrumbs
3
+
4
+ #content
5
+ %article(role="main")
6
+ ~ @page.to_html(self)
7
+
8
+ %section.pages
9
+ = haml :summaries, :layout => false, :locals => { :pages => @page.pages }
10
+
11
+ - unless @page.articles.empty?
12
+ %section.articles
13
+ %header
14
+ %h1= "Articles on #{@page.heading}"
15
+ = haml :summaries, :layout => false, :locals => { :pages => @page.articles, :heading => :h3 }
16
+
17
+ = haml :page_meta, :layout => false, :locals => { :page => @page }
18
+
19
+ = haml :comments, :layout => false
20
+
21
+ = haml :sidebar, :layout => false
@@ -0,0 +1,16 @@
1
+ - if page.date
2
+ %footer
3
+ %p.meta
4
+ Published
5
+ - if page.date
6
+ on
7
+ %time(datetime="#{page.date.to_s}" pubdate=true)= format_date(page.date)
8
+ - if (! page.categories.empty?)
9
+ in
10
+ - page.categories.each do |category|
11
+ - if category != page.categories[-1]
12
+ = succeed ',' do
13
+ %a(href="#{category.abspath}")= category.heading
14
+ - else
15
+ %a(href="#{category.abspath}")= category.heading
16
+
@@ -0,0 +1,3 @@
1
+ #sidebar
2
+ = haml :categories, :layout => false
3
+ = haml :feed, :layout => false
@@ -0,0 +1,11 @@
1
+ !!! XML
2
+ %urlset(xmlns="http://www.sitemaps.org/schemas/sitemap/0.9")
3
+ %url
4
+ %loc= base_url
5
+ %changefreq daily
6
+ %priority 1.0
7
+ %lastmod= @last.xmlschema
8
+ - @pages.each do |page|
9
+ %url
10
+ %loc= url_for(page)
11
+ %lastmod= page.last_modified.xmlschema
@@ -0,0 +1,15 @@
1
+ - unless pages.empty?
2
+ %ol
3
+ - pages.each do |page|
4
+ %li
5
+ %article
6
+ %header
7
+ %h1
8
+ %a(href="#{page.abspath}")= page.heading
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
15
+ = haml :page_meta, :layout => false, :locals => { :page => page }
metadata ADDED
@@ -0,0 +1,235 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mars-nesta
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.9.4
6
+ platform: ruby
7
+ authors:
8
+ - Graham Ashton
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-04-26 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: haml
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: "3.0"
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: redcarpet
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 1.11.0
35
+ type: :runtime
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: RedCloth
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: "4.2"
46
+ type: :runtime
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: sinatra
50
+ prerelease: false
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - "="
55
+ - !ruby/object:Gem::Version
56
+ version: 1.1.2
57
+ type: :runtime
58
+ version_requirements: *id004
59
+ - !ruby/object:Gem::Dependency
60
+ name: shotgun
61
+ prerelease: false
62
+ requirement: &id005 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0.8"
68
+ type: :runtime
69
+ version_requirements: *id005
70
+ - !ruby/object:Gem::Dependency
71
+ name: hpricot
72
+ prerelease: false
73
+ requirement: &id006 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - "="
77
+ - !ruby/object:Gem::Version
78
+ version: 0.8.3
79
+ type: :development
80
+ version_requirements: *id006
81
+ - !ruby/object:Gem::Dependency
82
+ name: rack-test
83
+ prerelease: false
84
+ requirement: &id007 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - "="
88
+ - !ruby/object:Gem::Version
89
+ version: 0.5.7
90
+ type: :development
91
+ version_requirements: *id007
92
+ - !ruby/object:Gem::Dependency
93
+ name: rspec
94
+ prerelease: false
95
+ requirement: &id008 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - "="
99
+ - !ruby/object:Gem::Version
100
+ version: 1.3.0
101
+ type: :development
102
+ version_requirements: *id008
103
+ - !ruby/object:Gem::Dependency
104
+ name: rspec_hpricot_matchers
105
+ prerelease: false
106
+ requirement: &id009 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - "="
110
+ - !ruby/object:Gem::Version
111
+ version: "1.0"
112
+ type: :development
113
+ version_requirements: *id009
114
+ - !ruby/object:Gem::Dependency
115
+ name: test-unit
116
+ prerelease: false
117
+ requirement: &id010 !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - "="
121
+ - !ruby/object:Gem::Version
122
+ version: 1.2.3
123
+ type: :development
124
+ version_requirements: *id010
125
+ description: |
126
+ Nesta is a lightweight Content Management System, written in Ruby using
127
+ the Sinatra web framework. Nesta has the simplicity of a static site
128
+ generator, but (being a fully fledged Rack application) allows you to
129
+ serve dynamic content on demand.
130
+
131
+ Content is stored on disk in plain text files (there is no database).
132
+ Edit your content in a text editor and keep it under version control
133
+ (most people use git, but any version control system will do fine).
134
+
135
+ Implementing your site's design is easy, but Nesta also has a small
136
+ selection of themes to choose from.
137
+
138
+ email:
139
+ - graham@effectif.com
140
+ executables:
141
+ - nesta
142
+ extensions: []
143
+
144
+ extra_rdoc_files: []
145
+
146
+ files:
147
+ - .gitignore
148
+ - CHANGES
149
+ - Gemfile
150
+ - Gemfile.lock
151
+ - LICENSE
152
+ - README.md
153
+ - Rakefile
154
+ - bin/nesta
155
+ - config.ru
156
+ - config/deploy.rb.sample
157
+ - lib/nesta/app.rb
158
+ - lib/nesta/cache.rb
159
+ - lib/nesta/commands.rb
160
+ - lib/nesta/config.rb
161
+ - lib/nesta/models.rb
162
+ - lib/nesta/navigation.rb
163
+ - lib/nesta/nesta.rb
164
+ - lib/nesta/overrides.rb
165
+ - lib/nesta/path.rb
166
+ - lib/nesta/plugins.rb
167
+ - lib/nesta/version.rb
168
+ - nesta.gemspec
169
+ - scripts/import-from-mephisto
170
+ - spec/atom_spec.rb
171
+ - spec/commands_spec.rb
172
+ - spec/config_spec.rb
173
+ - spec/model_factory.rb
174
+ - spec/models_spec.rb
175
+ - spec/overrides_spec.rb
176
+ - spec/page_spec.rb
177
+ - spec/path_spec.rb
178
+ - spec/sitemap_spec.rb
179
+ - spec/spec.opts
180
+ - spec/spec_helper.rb
181
+ - templates/Gemfile
182
+ - templates/Rakefile
183
+ - templates/config.ru
184
+ - templates/config/config.yml
185
+ - templates/config/deploy.rb
186
+ - templates/index.haml
187
+ - templates/themes/README.md
188
+ - templates/themes/app.rb
189
+ - views/analytics.haml
190
+ - views/atom.haml
191
+ - views/categories.haml
192
+ - views/colors.sass
193
+ - views/comments.haml
194
+ - views/error.haml
195
+ - views/feed.haml
196
+ - views/footer.haml
197
+ - views/header.haml
198
+ - views/layout.haml
199
+ - views/master.sass
200
+ - views/mixins.sass
201
+ - views/not_found.haml
202
+ - views/page.haml
203
+ - views/page_meta.haml
204
+ - views/sidebar.haml
205
+ - views/sitemap.haml
206
+ - views/summaries.haml
207
+ homepage: http://nestacms.com
208
+ licenses: []
209
+
210
+ post_install_message:
211
+ rdoc_options: []
212
+
213
+ require_paths:
214
+ - lib
215
+ required_ruby_version: !ruby/object:Gem::Requirement
216
+ none: false
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: "0"
221
+ required_rubygems_version: !ruby/object:Gem::Requirement
222
+ none: false
223
+ requirements:
224
+ - - ">="
225
+ - !ruby/object:Gem::Version
226
+ version: "0"
227
+ requirements: []
228
+
229
+ rubyforge_project:
230
+ rubygems_version: 1.7.2
231
+ signing_key:
232
+ specification_version: 3
233
+ summary: Ruby CMS, written in Sinatra
234
+ test_files: []
235
+