bonsai 1.3.2 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/.rvmrc +1 -1
  2. data/Gemfile +1 -14
  3. data/Gemfile.lock +33 -21
  4. data/README.md +4 -4
  5. data/Rakefile +12 -10
  6. data/VERSION +1 -1
  7. data/bonsai.gemspec +69 -113
  8. data/lib/bonsai/exporter.rb +5 -5
  9. data/lib/bonsai/page.rb +17 -7
  10. data/lib/bonsai/templates/public/css/{base.less → base.scss} +2 -0
  11. data/lib/bonsai/templates/templates/default.liquid +19 -0
  12. data/lib/bonsai/templates/templates/magic.liquid +28 -0
  13. data/lib/bonsai/templates/templates/products.liquid +27 -0
  14. data/lib/bonsai/templates/templates/shared/{analytics.mustache → _analytics.liquid} +0 -0
  15. data/lib/bonsai/templates/templates/shared/_breadcrumbs.liquid +9 -0
  16. data/lib/bonsai/templates/templates/shared/{footer.mustache → _footer.liquid} +0 -0
  17. data/lib/bonsai/templates/templates/shared/{head.mustache → _head.liquid} +0 -0
  18. data/lib/bonsai/templates/templates/shared/_header.liquid +5 -0
  19. data/lib/bonsai/templates/templates/shared/_nav.liquid +8 -0
  20. data/lib/bonsai.rb +4 -2
  21. data/spec/bonsai/exporter_spec.rb +4 -20
  22. data/spec/bonsai/generate_spec.rb +3 -3
  23. data/spec/bonsai/page_spec.rb +171 -187
  24. data/spec/bonsai/template_spec.rb +1 -1
  25. data/spec/support/content/{1.about-us/1.contact → render/image-spec}/images/image001.jpg +0 -0
  26. data/spec/support/content/render/image-spec/images.yml +1 -0
  27. data/spec/support/public/stylesheets/brokensass.sass +1 -3
  28. data/spec/support/public/stylesheets/sassy.scss +5 -0
  29. data/spec/support/templates/children.liquid +4 -0
  30. data/spec/support/templates/demo-template.liquid +6 -0
  31. data/spec/support/templates/images.liquid +3 -0
  32. data/spec/support/templates/partials/{inserted.mustache → _inserted.liquid} +0 -0
  33. data/spec/support/templates/partials/_magic.liquid +3 -0
  34. metadata +145 -218
  35. data/.kick +0 -26
  36. data/lib/bonsai/templates/templates/default.mustache +0 -17
  37. data/lib/bonsai/templates/templates/magic.mustache +0 -25
  38. data/lib/bonsai/templates/templates/products.mustache +0 -25
  39. data/lib/bonsai/templates/templates/shared/breadcrumbs.mustache +0 -9
  40. data/lib/bonsai/templates/templates/shared/header.mustache +0 -5
  41. data/lib/bonsai/templates/templates/shared/nav.mustache +0 -8
  42. data/spec/support/public/stylesheets/brokenless.less +0 -2
  43. data/spec/support/public/stylesheets/lesscss.css +0 -1
  44. data/spec/support/public/stylesheets/lesscss.less +0 -2
  45. data/spec/support/public/stylesheets/sassy.sass +0 -5
  46. data/spec/support/templates/demo-template.mustache +0 -19
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm 1.9.2@bonsai
1
+ rvm 1.9.2@bonsai --create
data/Gemfile CHANGED
@@ -1,16 +1,3 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'jeweler'
4
- gem 'rspec', '~> 2.3'
5
- gem 'yard'
6
-
7
- gem 'tilt', '~> 0.9.0'
8
- gem 'mustache', '~> 0.7.0'
9
- gem 'builder'
10
- gem 'watch'
11
- gem 'sinatra'
12
- gem 'maruku'
13
- gem 'less'
14
- gem 'launchy'
15
- gem 'activesupport'
16
- gem 'i18n'
3
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,3 +1,31 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bonsai (1.4.0)
5
+ activesupport (= 3.0.3)
6
+ activesupport (>= 3.0.3)
7
+ builder (= 3.0.0)
8
+ builder (>= 3.0.0)
9
+ i18n (= 0.5.0)
10
+ jeweler
11
+ launchy (= 0.3.7)
12
+ launchy (>= 0.3.7)
13
+ liquid (= 2.2.2)
14
+ liquid (>= 2.2.2)
15
+ maruku (= 0.6.0)
16
+ maruku (>= 0.6.0)
17
+ rack
18
+ rspec (~> 2.3)
19
+ sass (= 3.1.4)
20
+ sass
21
+ sinatra (= 1.0)
22
+ sinatra (>= 1.0)
23
+ tilt (= 1.3)
24
+ tilt (>= 1.3)
25
+ watch (= 0.1.0)
26
+ watch (>= 0.1.0)
27
+ yard
28
+
1
29
  GEM
2
30
  remote: http://rubygems.org/
3
31
  specs:
@@ -14,14 +42,9 @@ GEM
14
42
  launchy (0.3.7)
15
43
  configuration (>= 0.0.5)
16
44
  rake (>= 0.8.1)
17
- less (1.2.21)
18
- mutter (>= 0.4.2)
19
- treetop (>= 1.4.2)
45
+ liquid (2.2.2)
20
46
  maruku (0.6.0)
21
47
  syntax (>= 1.0.0)
22
- mustache (0.7.0)
23
- mutter (0.5.3)
24
- polyglot (0.3.1)
25
48
  rack (1.2.1)
26
49
  rake (0.8.7)
27
50
  rspec (2.3.0)
@@ -32,12 +55,11 @@ GEM
32
55
  rspec-expectations (2.3.0)
33
56
  diff-lcs (~> 1.1.2)
34
57
  rspec-mocks (2.3.0)
58
+ sass (3.1.4)
35
59
  sinatra (1.0)
36
60
  rack (>= 1.0)
37
61
  syntax (1.0.0)
38
- tilt (0.9)
39
- treetop (1.4.9)
40
- polyglot (>= 0.3.1)
62
+ tilt (1.3)
41
63
  watch (0.1.0)
42
64
  yard (0.6.4)
43
65
 
@@ -45,16 +67,6 @@ PLATFORMS
45
67
  ruby
46
68
 
47
69
  DEPENDENCIES
48
- activesupport
49
- builder
50
- i18n
51
- jeweler
52
- launchy
53
- less
54
- maruku
55
- mustache (~> 0.7.0)
56
- rspec (~> 2.3)
57
- sinatra
58
- tilt (~> 0.9.0)
59
- watch
70
+ bonsai!
71
+ rspec (>= 1.3.0)
60
72
  yard
data/README.md CHANGED
@@ -4,7 +4,7 @@ Bonsai is a static web site generator, it uses the best tools available for site
4
4
 
5
5
  ## What it does
6
6
 
7
- * Provides a tiny HTML5, mustache driven template set.
7
+ * Provides a tiny HTML5, [liquid](http://liquidmarkup.org/) driven template set.
8
8
  * Implies a simple structure to get started faster.
9
9
  * An inbuilt server for development. No setup required.
10
10
  * Tasks to export the site to `output`. Upload the contents of `output`. Job done.
@@ -36,7 +36,7 @@ Type `bonsai --help` for any help with commands
36
36
 
37
37
  Unlike other static generators, bonsai provides you with a built in web server. Once you've generated the necessary files (generator included) you can simply start developing. Type `bonsai --cultivate` in the root of the generated site, a web server (rack, with thin) will start up.
38
38
 
39
- It will also watch for when you save files - taking care of processing your [lesscss](http://lesscss.org/) files - kind of like [autotest](http://www.zenspider.com/ZSS/Products/ZenTest/).
39
+ It will also watch for when you save files - taking care of processing your [sass](http://sass-lang.com/) files - kind of like [autotest](http://www.zenspider.com/ZSS/Products/ZenTest/).
40
40
 
41
41
  ## Production server
42
42
 
@@ -67,8 +67,8 @@ When I found something that didn't quite work, was too slow or perhaps not even
67
67
 
68
68
  ## Links
69
69
 
70
- * [Tilt](http://github.com/rtomayko/tilt) - defaulting to [Mustache](http://github.com/defunkt/mustache)
71
- * [Less CSS](http://lesscss.org/)
70
+ * [Tilt](http://github.com/rtomayko/tilt)
71
+ * [SASS](http://sass-lang.com/)
72
72
  * [YUI CSS/Javascript compressor](http://developer.yahoo.com/yui/compressor/)
73
73
 
74
74
 
data/Rakefile CHANGED
@@ -15,19 +15,21 @@ begin
15
15
  gem.has_rdoc = false
16
16
  gem.files.exclude 'vendor/gems'
17
17
 
18
- gem.add_development_dependency "rspec", ">= 1.3.0"
18
+ gem.add_development_dependency "rspec", "~> 2.3"
19
19
  gem.add_development_dependency "yard", ">= 0"
20
- gem.add_dependency "tilt", ">= 0.5"
21
- gem.add_dependency "mustache", ">= 0.5.0"
22
- gem.add_dependency "builder", ">= 2.1.2"
20
+
21
+ gem.add_dependency "rack"
22
+ gem.add_dependency "sinatra", ">= 1.0"
23
+ gem.add_dependency "tilt", ">= 1.3"
24
+ gem.add_dependency "liquid", ">= 2.2.2"
25
+ gem.add_dependency "builder", ">= 3.0.0"
23
26
  gem.add_dependency "watch", ">= 0.1.0"
24
- gem.add_dependency "sinatra", ">= 0.9.4"
25
27
  gem.add_dependency "maruku", ">= 0.6.0"
26
- gem.add_dependency "less", ">= 1.2.17"
27
- gem.add_dependency "rack", ">= 1.2.1"
28
- gem.add_dependency "launchy", ">= 0.3.3"
29
- gem.add_dependency "activesupport", ">= 2.3.5"
30
-
28
+ gem.add_dependency "launchy", ">= 0.3.7"
29
+ gem.add_dependency "activesupport", ">= 3.0.3"
30
+ gem.add_dependency "i18n", ">= 0.5.0"
31
+ gem.add_dependency "sass"
32
+
31
33
  gem.post_install_message = %q{
32
34
 
33
35
  盆栽
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.2
1
+ 1.4.1
data/bonsai.gemspec CHANGED
@@ -4,15 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{bonsai}
8
- s.version = "1.3.0"
7
+ s.name = "bonsai"
8
+ s.version = "1.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Schwarz"]
12
- s.date = %q{2010-12-28}
13
- s.default_executable = %q{bonsai}
14
- s.description = %q{A static site generator that uses the best toolset available}
15
- s.email = %q{ben.schwarz@gmail.com}
12
+ s.date = "2011-09-20"
13
+ s.description = "A static site generator that uses the best toolset available"
14
+ s.email = "ben.schwarz@gmail.com"
16
15
  s.executables = ["bonsai"]
17
16
  s.extra_rdoc_files = [
18
17
  "LICENSE",
@@ -21,7 +20,8 @@ Gem::Specification.new do |s|
21
20
  s.files = [
22
21
  ".bundle/config",
23
22
  ".document",
24
- ".kick",
23
+ ".rspec",
24
+ ".rvmrc",
25
25
  "CHANGES",
26
26
  "Gemfile",
27
27
  "Gemfile.lock",
@@ -50,18 +50,18 @@ Gem::Specification.new do |s|
50
50
  "lib/bonsai/templates/content/3.history/default.yml",
51
51
  "lib/bonsai/templates/content/index/default.yml",
52
52
  "lib/bonsai/templates/public/.htaccess",
53
- "lib/bonsai/templates/public/css/base.less",
53
+ "lib/bonsai/templates/public/css/base.scss",
54
54
  "lib/bonsai/templates/public/robots.txt",
55
55
  "lib/bonsai/templates/site.yml",
56
- "lib/bonsai/templates/templates/default.mustache",
57
- "lib/bonsai/templates/templates/magic.mustache",
58
- "lib/bonsai/templates/templates/products.mustache",
59
- "lib/bonsai/templates/templates/shared/analytics.mustache",
60
- "lib/bonsai/templates/templates/shared/breadcrumbs.mustache",
61
- "lib/bonsai/templates/templates/shared/footer.mustache",
62
- "lib/bonsai/templates/templates/shared/head.mustache",
63
- "lib/bonsai/templates/templates/shared/header.mustache",
64
- "lib/bonsai/templates/templates/shared/nav.mustache",
56
+ "lib/bonsai/templates/templates/default.liquid",
57
+ "lib/bonsai/templates/templates/magic.liquid",
58
+ "lib/bonsai/templates/templates/products.liquid",
59
+ "lib/bonsai/templates/templates/shared/_analytics.liquid",
60
+ "lib/bonsai/templates/templates/shared/_breadcrumbs.liquid",
61
+ "lib/bonsai/templates/templates/shared/_footer.liquid",
62
+ "lib/bonsai/templates/templates/shared/_head.liquid",
63
+ "lib/bonsai/templates/templates/shared/_header.liquid",
64
+ "lib/bonsai/templates/templates/shared/_nav.liquid",
65
65
  "lib/bonsai/webserver.rb",
66
66
  "lib/bonsai/webserver/error.erb",
67
67
  "lib/core_ext/string.rb",
@@ -86,7 +86,6 @@ Gem::Specification.new do |s|
86
86
  "spec/support/content/1.about-us/1.contact/1.child/a_file_asset.txt",
87
87
  "spec/support/content/1.about-us/1.contact/1.child/demo-template.yml",
88
88
  "spec/support/content/1.about-us/1.contact/demo-template.yml",
89
- "spec/support/content/1.about-us/1.contact/images/image001.jpg",
90
89
  "spec/support/content/1.about-us/1.contact/magic/image001.jpg",
91
90
  "spec/support/content/1.about-us/1.contact/magic/image002.jpg",
92
91
  "spec/support/content/1.about-us/demo-template.yml",
@@ -104,128 +103,85 @@ Gem::Specification.new do |s|
104
103
  "spec/support/content/2.products/demo-template.yml",
105
104
  "spec/support/content/index/demo-template.yml",
106
105
  "spec/support/content/legals/terms-and-conditions/demo-template.yml",
106
+ "spec/support/content/render/image-spec/images.yml",
107
+ "spec/support/content/render/image-spec/images/image001.jpg",
107
108
  "spec/support/public/.htaccess",
108
109
  "spec/support/public/js/script.js",
109
- "spec/support/public/stylesheets/brokenless.less",
110
110
  "spec/support/public/stylesheets/brokensass.sass",
111
- "spec/support/public/stylesheets/lesscss.css",
112
- "spec/support/public/stylesheets/lesscss.less",
113
111
  "spec/support/public/stylesheets/sassy.css",
114
- "spec/support/public/stylesheets/sassy.sass",
112
+ "spec/support/public/stylesheets/sassy.scss",
115
113
  "spec/support/site.yml",
116
- "spec/support/templates/demo-template.mustache",
117
- "spec/support/templates/partials/inserted.mustache",
114
+ "spec/support/templates/children.liquid",
115
+ "spec/support/templates/demo-template.liquid",
116
+ "spec/support/templates/images.liquid",
117
+ "spec/support/templates/partials/_inserted.liquid",
118
+ "spec/support/templates/partials/_magic.liquid",
118
119
  "vendor/yui-compressor/yuicompressor-2.4.2.jar"
119
120
  ]
120
- s.has_rdoc = false
121
- s.homepage = %q{http://github.com/benschwarz/bonsai}
122
- s.post_install_message = %q{
123
-
124
- 盆栽
125
- bonsai, tiny and beautiful
126
-
127
-
128
-
129
- type `bonsai --help` to get started
130
- }
121
+ s.homepage = "http://github.com/benschwarz/bonsai"
122
+ s.post_install_message = "\n\n \347\233\206\346\240\275\n bonsai, tiny and beautiful\n\n\n\n type `bonsai --help` to get started\n "
131
123
  s.require_paths = ["lib"]
132
- s.rubygems_version = %q{1.3.7}
133
- s.summary = %q{A static site generator that uses the best toolset available}
134
- s.test_files = [
135
- "spec/bonsai/console_spec.rb",
136
- "spec/bonsai/exporter_spec.rb",
137
- "spec/bonsai/generate_spec.rb",
138
- "spec/bonsai/navigation_spec.rb",
139
- "spec/bonsai/page_spec.rb",
140
- "spec/bonsai/sitemap_spec.rb",
141
- "spec/bonsai/template_spec.rb",
142
- "spec/bonsai_spec.rb",
143
- "spec/spec_helper.rb"
144
- ]
124
+ s.rubygems_version = "1.8.10"
125
+ s.summary = "A static site generator that uses the best toolset available"
145
126
 
146
127
  if s.respond_to? :specification_version then
147
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
148
128
  s.specification_version = 3
149
129
 
150
130
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
151
- s.add_runtime_dependency(%q<jeweler>, [">= 0"])
152
- s.add_runtime_dependency(%q<rspec>, [">= 0"])
153
- s.add_runtime_dependency(%q<yard>, [">= 0"])
154
- s.add_runtime_dependency(%q<tilt>, ["~> 0.5.0"])
155
- s.add_runtime_dependency(%q<mustache>, ["~> 0.5.0"])
156
- s.add_runtime_dependency(%q<builder>, [">= 0"])
157
- s.add_runtime_dependency(%q<watch>, [">= 0"])
158
- s.add_runtime_dependency(%q<sinatra>, [">= 0"])
159
- s.add_runtime_dependency(%q<maruku>, [">= 0"])
160
- s.add_runtime_dependency(%q<less>, [">= 0"])
161
- s.add_runtime_dependency(%q<launchy>, [">= 0"])
162
- s.add_runtime_dependency(%q<activesupport>, [">= 0"])
163
- s.add_runtime_dependency(%q<i18n>, [">= 0"])
164
- s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
131
+ s.add_runtime_dependency(%q<bonsai>, [">= 0"])
165
132
  s.add_development_dependency(%q<yard>, [">= 0"])
166
- s.add_runtime_dependency(%q<tilt>, [">= 0.5"])
167
- s.add_runtime_dependency(%q<mustache>, [">= 0.5.0"])
168
- s.add_runtime_dependency(%q<builder>, [">= 2.1.2"])
133
+ s.add_development_dependency(%q<rspec>, ["~> 2.3"])
134
+ s.add_development_dependency(%q<yard>, [">= 0"])
135
+ s.add_development_dependency(%q<rspec>, ["~> 2.3"])
136
+ s.add_development_dependency(%q<yard>, [">= 0"])
137
+ s.add_runtime_dependency(%q<rack>, [">= 0"])
138
+ s.add_runtime_dependency(%q<sinatra>, [">= 1.0"])
139
+ s.add_runtime_dependency(%q<tilt>, [">= 1.3"])
140
+ s.add_runtime_dependency(%q<liquid>, [">= 2.2.2"])
141
+ s.add_runtime_dependency(%q<builder>, [">= 3.0.0"])
169
142
  s.add_runtime_dependency(%q<watch>, [">= 0.1.0"])
170
- s.add_runtime_dependency(%q<sinatra>, [">= 0.9.4"])
171
143
  s.add_runtime_dependency(%q<maruku>, [">= 0.6.0"])
172
- s.add_runtime_dependency(%q<less>, [">= 1.2.17"])
173
- s.add_runtime_dependency(%q<rack>, [">= 1.2.1"])
174
- s.add_runtime_dependency(%q<launchy>, [">= 0.3.3"])
175
- s.add_runtime_dependency(%q<activesupport>, [">= 2.3.5"])
144
+ s.add_runtime_dependency(%q<launchy>, [">= 0.3.7"])
145
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.0.3"])
146
+ s.add_runtime_dependency(%q<i18n>, [">= 0.5.0"])
147
+ s.add_runtime_dependency(%q<sass>, [">= 0"])
176
148
  else
177
- s.add_dependency(%q<jeweler>, [">= 0"])
178
- s.add_dependency(%q<rspec>, [">= 0"])
149
+ s.add_dependency(%q<bonsai>, [">= 0"])
179
150
  s.add_dependency(%q<yard>, [">= 0"])
180
- s.add_dependency(%q<tilt>, ["~> 0.5.0"])
181
- s.add_dependency(%q<mustache>, ["~> 0.5.0"])
182
- s.add_dependency(%q<builder>, [">= 0"])
183
- s.add_dependency(%q<watch>, [">= 0"])
184
- s.add_dependency(%q<sinatra>, [">= 0"])
185
- s.add_dependency(%q<maruku>, [">= 0"])
186
- s.add_dependency(%q<less>, [">= 0"])
187
- s.add_dependency(%q<launchy>, [">= 0"])
188
- s.add_dependency(%q<activesupport>, [">= 0"])
189
- s.add_dependency(%q<i18n>, [">= 0"])
190
- s.add_dependency(%q<rspec>, [">= 1.3.0"])
151
+ s.add_dependency(%q<rspec>, ["~> 2.3"])
191
152
  s.add_dependency(%q<yard>, [">= 0"])
192
- s.add_dependency(%q<tilt>, [">= 0.5"])
193
- s.add_dependency(%q<mustache>, [">= 0.5.0"])
194
- s.add_dependency(%q<builder>, [">= 2.1.2"])
153
+ s.add_dependency(%q<rspec>, ["~> 2.3"])
154
+ s.add_dependency(%q<yard>, [">= 0"])
155
+ s.add_dependency(%q<rack>, [">= 0"])
156
+ s.add_dependency(%q<sinatra>, [">= 1.0"])
157
+ s.add_dependency(%q<tilt>, [">= 1.3"])
158
+ s.add_dependency(%q<liquid>, [">= 2.2.2"])
159
+ s.add_dependency(%q<builder>, [">= 3.0.0"])
195
160
  s.add_dependency(%q<watch>, [">= 0.1.0"])
196
- s.add_dependency(%q<sinatra>, [">= 0.9.4"])
197
161
  s.add_dependency(%q<maruku>, [">= 0.6.0"])
198
- s.add_dependency(%q<less>, [">= 1.2.17"])
199
- s.add_dependency(%q<rack>, [">= 1.2.1"])
200
- s.add_dependency(%q<launchy>, [">= 0.3.3"])
201
- s.add_dependency(%q<activesupport>, [">= 2.3.5"])
162
+ s.add_dependency(%q<launchy>, [">= 0.3.7"])
163
+ s.add_dependency(%q<activesupport>, [">= 3.0.3"])
164
+ s.add_dependency(%q<i18n>, [">= 0.5.0"])
165
+ s.add_dependency(%q<sass>, [">= 0"])
202
166
  end
203
167
  else
204
- s.add_dependency(%q<jeweler>, [">= 0"])
205
- s.add_dependency(%q<rspec>, [">= 0"])
168
+ s.add_dependency(%q<bonsai>, [">= 0"])
169
+ s.add_dependency(%q<yard>, [">= 0"])
170
+ s.add_dependency(%q<rspec>, ["~> 2.3"])
206
171
  s.add_dependency(%q<yard>, [">= 0"])
207
- s.add_dependency(%q<tilt>, ["~> 0.5.0"])
208
- s.add_dependency(%q<mustache>, ["~> 0.5.0"])
209
- s.add_dependency(%q<builder>, [">= 0"])
210
- s.add_dependency(%q<watch>, [">= 0"])
211
- s.add_dependency(%q<sinatra>, [">= 0"])
212
- s.add_dependency(%q<maruku>, [">= 0"])
213
- s.add_dependency(%q<less>, [">= 0"])
214
- s.add_dependency(%q<launchy>, [">= 0"])
215
- s.add_dependency(%q<activesupport>, [">= 0"])
216
- s.add_dependency(%q<i18n>, [">= 0"])
217
- s.add_dependency(%q<rspec>, [">= 1.3.0"])
172
+ s.add_dependency(%q<rspec>, ["~> 2.3"])
218
173
  s.add_dependency(%q<yard>, [">= 0"])
219
- s.add_dependency(%q<tilt>, [">= 0.5"])
220
- s.add_dependency(%q<mustache>, [">= 0.5.0"])
221
- s.add_dependency(%q<builder>, [">= 2.1.2"])
174
+ s.add_dependency(%q<rack>, [">= 0"])
175
+ s.add_dependency(%q<sinatra>, [">= 1.0"])
176
+ s.add_dependency(%q<tilt>, [">= 1.3"])
177
+ s.add_dependency(%q<liquid>, [">= 2.2.2"])
178
+ s.add_dependency(%q<builder>, [">= 3.0.0"])
222
179
  s.add_dependency(%q<watch>, [">= 0.1.0"])
223
- s.add_dependency(%q<sinatra>, [">= 0.9.4"])
224
180
  s.add_dependency(%q<maruku>, [">= 0.6.0"])
225
- s.add_dependency(%q<less>, [">= 1.2.17"])
226
- s.add_dependency(%q<rack>, [">= 1.2.1"])
227
- s.add_dependency(%q<launchy>, [">= 0.3.3"])
228
- s.add_dependency(%q<activesupport>, [">= 2.3.5"])
181
+ s.add_dependency(%q<launchy>, [">= 0.3.7"])
182
+ s.add_dependency(%q<activesupport>, [">= 3.0.3"])
183
+ s.add_dependency(%q<i18n>, [">= 0.5.0"])
184
+ s.add_dependency(%q<sass>, [">= 0"])
229
185
  end
230
186
  end
231
187
 
@@ -1,5 +1,5 @@
1
1
  require 'fileutils'
2
- require 'less'
2
+ require 'sass'
3
3
 
4
4
  module Bonsai
5
5
  class Exporter
@@ -80,10 +80,10 @@ module Bonsai
80
80
  Page.all.each do |page|
81
81
  page.assets.each do |asset|
82
82
  # Create the path to the asset by the export path of the page + File.dirname(asset permalink)
83
- FileUtils.mkdir_p "#{path}#{File.dirname(asset[:path])}"
83
+ FileUtils.mkdir_p "#{path}#{File.dirname(asset['path'])}"
84
84
 
85
85
  # Copy the the asset from its disk path to File.dirname(asset permalink)
86
- FileUtils.cp asset[:disk_path], "#{path}#{asset[:path]}"
86
+ FileUtils.cp asset['disk_path'], "#{path}#{asset['path']}"
87
87
  end
88
88
  end
89
89
  end
@@ -106,13 +106,13 @@ module Bonsai
106
106
  end
107
107
 
108
108
  def generate_css
109
- Dir["#{Bonsai.root_dir}/public/**/*.{less,sass}"].each do |cssfile|
109
+ Dir["#{Bonsai.root_dir}/public/**/*.{less,sass,scss}"].each do |cssfile|
110
110
  css = Tilt.new(cssfile).render
111
111
  path = "#{File.dirname(cssfile)}/#{File.basename(cssfile, ".*")}.css"
112
112
 
113
113
  File.open(path, "w") {|file| file.write(css) }
114
114
  end
115
- rescue Less::SyntaxError => exception
115
+ rescue Sass::SyntaxError => exception
116
116
  Bonsai.log "CSS Syntax error\n\n#{exception.message}"
117
117
  end
118
118
 
data/lib/bonsai/page.rb CHANGED
@@ -1,8 +1,13 @@
1
1
  require 'yaml'
2
+
3
+ if RUBY_VERSION =~ /^1.9./
4
+ YAML::ENGINE.yamler = 'syck'
5
+ end
6
+
2
7
  require 'tilt'
8
+ require 'liquid'
3
9
  require 'active_support/inflector'
4
10
 
5
- # Use RDiscount for those who care
6
11
  begin
7
12
  require 'rdiscount'
8
13
  BlueCloth = RDiscount
@@ -12,7 +17,7 @@ end
12
17
 
13
18
  module Bonsai
14
19
  class Page
15
- class NotFound < StandardError; end;
20
+ class NotFound < StandardError; end;
16
21
  class << self
17
22
  attr_accessor :path, :pages
18
23
 
@@ -132,7 +137,7 @@ module Bonsai
132
137
  # content file results, as well as any "magic" hashes for file
133
138
  # system contents
134
139
  def to_hash
135
- {
140
+ hash = {
136
141
  :slug => slug,
137
142
  :permalink => permalink,
138
143
  :name => name,
@@ -144,11 +149,16 @@ module Bonsai
144
149
  :updated_at => mtime,
145
150
  :created_at => ctime
146
151
  }.merge(formatted_content).merge(disk_assets).merge(Bonsai.site)
152
+
153
+ hash.stringify_keys
147
154
  end
148
155
 
156
+ alias to_liquid to_hash
157
+
149
158
  private
159
+ # This method ensures that multiline strings are run through markdown and smartypants
150
160
  def formatted_content
151
- formatted_content = content
161
+ formatted_content = content
152
162
  formatted_content.each do |k,v|
153
163
  if v.is_a?(String) and v =~ /\n/
154
164
  formatted_content[k] = to_markdown(v)
@@ -181,8 +191,8 @@ module Bonsai
181
191
  name = File.basename(path)
182
192
 
183
193
  {
184
- name.to_sym => Dir["#{path}/*"].map do |file|
185
- file_to_hash(file)
194
+ name => Dir["#{path}/*"].map do |file|
195
+ file_to_hash(file)
186
196
  end
187
197
  }
188
198
  end
@@ -204,7 +214,7 @@ module Bonsai
204
214
  :name => File.basename(file, ".*").titleize,
205
215
  :path => "#{web_path(File.dirname(file))}/#{File.basename(file)}",
206
216
  :disk_path => File.expand_path(file)
207
- }
217
+ }.stringify_keys
208
218
  end
209
219
  end
210
220
  end
@@ -1,3 +1,5 @@
1
+ @charset "utf-8";
2
+
1
3
  /* HTML resets */
2
4
  body, html, div, p, img, h1, h2, h3, h4, h5, h6, ol, ul, li { margin: 0; padding: 0; font-weight: normal; font-size: 100%; outline: none; border: none;}
3
5
 
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ {% include "shared/head" %}
4
+ <body id="{{slug}}">
5
+ <section id="wrapper">
6
+ {% include "shared/header" %}
7
+
8
+ <article>
9
+ <h2>{{headline}}</h2>
10
+ <section role="main">
11
+ {{body}}
12
+ </section>
13
+ </article>
14
+
15
+ {% include "shared/footer" %}
16
+ </section>
17
+ {% include "shared/analytics" %}
18
+ </body>
19
+ </html>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ {% include "shared/head" %}
4
+ <body id="{{slug}}">
5
+ <section id="wrapper" class="magic">
6
+ {% include "shared/header" %}
7
+
8
+ <article>
9
+ <h2>{{headline}}</h2>
10
+ <section role="main">
11
+ {{body}}
12
+ </section>
13
+ <figure>
14
+ {% for image in images %}
15
+ <!-- renders files located in a "images" folder within you page content -->
16
+ <img src="{{image.path}}" alt="{{image.name}}" />
17
+ {% endfor %}
18
+ </figure>
19
+ </article>
20
+ <aside>
21
+ {{aside}}
22
+ </aside>
23
+ <div class="clear"></div>
24
+ {% include "shared/footer" %}
25
+ </section>
26
+ {% include "shared/analytics" %}
27
+ </body>
28
+ </html>
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ {% include "shared/head" %}
4
+ <body id="{{slug}}">
5
+ <section id="wrapper">
6
+ {% include "shared/header" %}
7
+
8
+ <article>
9
+ <h2>{{headline}}</h2>
10
+ <section role="main">
11
+ {{body}}
12
+ </section>
13
+ </article>
14
+
15
+ <nav id="sub-navigation">
16
+ <ol>
17
+ {% for child in children %}
18
+ <li><a href="{{child.permalink}}">{{child.name}}</a></li>
19
+ {% endfor %}
20
+ </ol>
21
+ </nav>
22
+
23
+ {% include "shared/footer" %}
24
+ </section>
25
+ </body>
26
+ {% include "shared/analytics" %}
27
+ </html>
@@ -0,0 +1,9 @@
1
+ <nav id="breadcrumbs">
2
+ <ol>
3
+ <li><a href="/">Home</a></li>
4
+ {% for ancestor in ancestors %}
5
+ <li><a href="{{ancestor.permalink}}">{{ancestor.name}}</a></li>
6
+ {% endfor %}
7
+ <li>{{headline}}</li>
8
+ </ol>
9
+ </nav>
@@ -0,0 +1,5 @@
1
+ <header>
2
+ <h1 id="logo"><a href="/" rel="home">Tiny<br />Tree</a></h1>
3
+ {% include "shared/nav" %}
4
+ {% include "shared/breadcrumbs" %}
5
+ </header>
@@ -0,0 +1,8 @@
1
+ <nav id="navigation">
2
+ <ol>
3
+ <li><a href="/">Home</a></li>
4
+ {% for item in navigation %}
5
+ <li><a href="{{item.permalink}}">{{item.name}}</a></li>
6
+ {% endfor %}
7
+ </ol>
8
+ </nav>