middleman 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/middleman/builder.rb +2 -1
- data/lib/middleman/features.rb +0 -4
- data/lib/middleman/templates/default/config.tt +8 -3
- data/lib/middleman/templates/html5/config.tt +8 -6
- data/lib/middleman/version.rb +1 -1
- data/middleman.gemspec +0 -1
- metadata +14 -32
- data/lib/middleman/features/slickmap.rb +0 -90
- data/lib/middleman/features/slickmap/template.html.haml +0 -27
data/lib/middleman/builder.rb
CHANGED
data/lib/middleman/features.rb
CHANGED
@@ -60,10 +60,6 @@ module Middleman::Features
|
|
60
60
|
# MinifyJavascript uses the YUI compressor to shrink JS files
|
61
61
|
autoload :MinifyJavascript, "middleman/features/minify_javascript"
|
62
62
|
|
63
|
-
# Slickmap (http://astuteo.com/slickmap/) is a beautiful sitemap tool which
|
64
|
-
# will attempt to generate a `sitemap.html` file from your project.
|
65
|
-
autoload :Slickmap, "middleman/features/slickmap"
|
66
|
-
|
67
63
|
# CodeRay is a syntax highlighter.
|
68
64
|
autoload :CodeRay, "middleman/features/code_ray"
|
69
65
|
|
@@ -1,9 +1,10 @@
|
|
1
|
-
# Automatic sitemaps
|
2
|
-
# activate :slickmap
|
3
|
-
|
4
1
|
# CodeRay syntax highlighting in Haml
|
5
2
|
# activate :code_ray
|
6
3
|
|
4
|
+
# Automatic sitemaps (gem install middleman-slickmap)
|
5
|
+
# require "middleman-slickmap"
|
6
|
+
# activate :slickmap
|
7
|
+
|
7
8
|
# Automatic image dimension calculations
|
8
9
|
# activate :automatic_image_sizes
|
9
10
|
|
@@ -54,6 +55,10 @@ configure :build do
|
|
54
55
|
|
55
56
|
# Use relative URLs
|
56
57
|
# activate :relative_assets
|
58
|
+
|
59
|
+
# Compress PNGs after build (gem install middleman-smusher)
|
60
|
+
# require "middleman-smusher"
|
61
|
+
# activate :smusher
|
57
62
|
|
58
63
|
# Generate ugly/obfuscated HTML from Haml
|
59
64
|
# activate :ugly_haml
|
@@ -20,12 +20,13 @@ helpers do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
# Automatic sitemaps
|
24
|
-
# activate :slickmap
|
25
|
-
|
26
23
|
# CodeRay syntax highlighting in Haml
|
27
24
|
# activate :code_ray
|
28
25
|
|
26
|
+
# Automatic sitemaps (gem install middleman-slickmap)
|
27
|
+
# require "middleman-slickmap"
|
28
|
+
# activate :slickmap
|
29
|
+
|
29
30
|
# Automatic image dimension calculations in Haml
|
30
31
|
# activate :automatic_image_sizes
|
31
32
|
|
@@ -42,9 +43,10 @@ configure :build do
|
|
42
43
|
|
43
44
|
# Use relative URLs
|
44
45
|
# activate :relative_assets
|
45
|
-
|
46
|
-
#
|
47
|
-
#
|
46
|
+
|
47
|
+
# Compress PNGs after build (gem install middleman-smusher)
|
48
|
+
# require "middleman-smusher"
|
49
|
+
# activate :smusher
|
48
50
|
|
49
51
|
# Or use a different image path
|
50
52
|
# set :http_path, "/Content/images/"
|
data/lib/middleman/version.rb
CHANGED
data/middleman.gemspec
CHANGED
@@ -34,7 +34,6 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.add_runtime_dependency("compass", ["0.11.beta.6"])
|
35
35
|
s.add_runtime_dependency("chunky_png", ["~> 1.1.0"])
|
36
36
|
s.add_runtime_dependency("oily_png", ["~> 1.0"]) unless defined?(JRUBY_VERSION)
|
37
|
-
s.add_runtime_dependency("compass-slickmap", ["~> 0.4.0"])
|
38
37
|
s.add_runtime_dependency("coffee-script", ["~> 2.1.0"])
|
39
38
|
s.add_runtime_dependency("less", ["~> 1.2.0"])
|
40
39
|
# s.add_runtime_dependency("fssm", ["~> 0.2.0"])
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 4
|
10
|
+
version: 1.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Thomas Reynolds
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-20 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -261,26 +261,10 @@ dependencies:
|
|
261
261
|
version: "1.0"
|
262
262
|
type: :runtime
|
263
263
|
version_requirements: *id015
|
264
|
-
- !ruby/object:Gem::Dependency
|
265
|
-
name: compass-slickmap
|
266
|
-
prerelease: false
|
267
|
-
requirement: &id016 !ruby/object:Gem::Requirement
|
268
|
-
none: false
|
269
|
-
requirements:
|
270
|
-
- - ~>
|
271
|
-
- !ruby/object:Gem::Version
|
272
|
-
hash: 15
|
273
|
-
segments:
|
274
|
-
- 0
|
275
|
-
- 4
|
276
|
-
- 0
|
277
|
-
version: 0.4.0
|
278
|
-
type: :runtime
|
279
|
-
version_requirements: *id016
|
280
264
|
- !ruby/object:Gem::Dependency
|
281
265
|
name: coffee-script
|
282
266
|
prerelease: false
|
283
|
-
requirement: &
|
267
|
+
requirement: &id016 !ruby/object:Gem::Requirement
|
284
268
|
none: false
|
285
269
|
requirements:
|
286
270
|
- - ~>
|
@@ -292,11 +276,11 @@ dependencies:
|
|
292
276
|
- 0
|
293
277
|
version: 2.1.0
|
294
278
|
type: :runtime
|
295
|
-
version_requirements: *
|
279
|
+
version_requirements: *id016
|
296
280
|
- !ruby/object:Gem::Dependency
|
297
281
|
name: less
|
298
282
|
prerelease: false
|
299
|
-
requirement: &
|
283
|
+
requirement: &id017 !ruby/object:Gem::Requirement
|
300
284
|
none: false
|
301
285
|
requirements:
|
302
286
|
- - ~>
|
@@ -308,11 +292,11 @@ dependencies:
|
|
308
292
|
- 0
|
309
293
|
version: 1.2.0
|
310
294
|
type: :runtime
|
311
|
-
version_requirements: *
|
295
|
+
version_requirements: *id017
|
312
296
|
- !ruby/object:Gem::Dependency
|
313
297
|
name: cucumber
|
314
298
|
prerelease: false
|
315
|
-
requirement: &
|
299
|
+
requirement: &id018 !ruby/object:Gem::Requirement
|
316
300
|
none: false
|
317
301
|
requirements:
|
318
302
|
- - ~>
|
@@ -324,11 +308,11 @@ dependencies:
|
|
324
308
|
- 0
|
325
309
|
version: 0.10.0
|
326
310
|
type: :development
|
327
|
-
version_requirements: *
|
311
|
+
version_requirements: *id018
|
328
312
|
- !ruby/object:Gem::Dependency
|
329
313
|
name: rspec
|
330
314
|
prerelease: false
|
331
|
-
requirement: &
|
315
|
+
requirement: &id019 !ruby/object:Gem::Requirement
|
332
316
|
none: false
|
333
317
|
requirements:
|
334
318
|
- - ">="
|
@@ -338,11 +322,11 @@ dependencies:
|
|
338
322
|
- 0
|
339
323
|
version: "0"
|
340
324
|
type: :development
|
341
|
-
version_requirements: *
|
325
|
+
version_requirements: *id019
|
342
326
|
- !ruby/object:Gem::Dependency
|
343
327
|
name: rocco
|
344
328
|
prerelease: false
|
345
|
-
requirement: &
|
329
|
+
requirement: &id020 !ruby/object:Gem::Requirement
|
346
330
|
none: false
|
347
331
|
requirements:
|
348
332
|
- - ">="
|
@@ -352,7 +336,7 @@ dependencies:
|
|
352
336
|
- 0
|
353
337
|
version: "0"
|
354
338
|
type: :development
|
355
|
-
version_requirements: *
|
339
|
+
version_requirements: *id020
|
356
340
|
description:
|
357
341
|
email:
|
358
342
|
- tdreyno@gmail.com
|
@@ -442,8 +426,6 @@ files:
|
|
442
426
|
- lib/middleman/features/minify_javascript.rb
|
443
427
|
- lib/middleman/features/minify_javascript/rack.rb
|
444
428
|
- lib/middleman/features/relative_assets.rb
|
445
|
-
- lib/middleman/features/slickmap.rb
|
446
|
-
- lib/middleman/features/slickmap/template.html.haml
|
447
429
|
- lib/middleman/features/ugly_haml.rb
|
448
430
|
- lib/middleman/renderers/haml.rb
|
449
431
|
- lib/middleman/renderers/sass.rb
|
@@ -1,90 +0,0 @@
|
|
1
|
-
Entry = Struct.new(:dir, :children)
|
2
|
-
|
3
|
-
module Middleman::Features::Slickmap
|
4
|
-
class << self
|
5
|
-
def registered(app)
|
6
|
-
require 'slickmap'
|
7
|
-
|
8
|
-
@sitemap_url = "sitemap.html"
|
9
|
-
@sitemap_url = app.sitemap_url if app.respond_to?(:slickmap_url)
|
10
|
-
|
11
|
-
if app.environment == :build
|
12
|
-
Middleman::Builder.template :slickmap, @sitemap_url, @sitemap_url
|
13
|
-
end
|
14
|
-
|
15
|
-
app.helpers do
|
16
|
-
def sitemap_node(n, first=false)
|
17
|
-
if n.children.length < 1
|
18
|
-
if !first && File.extname(n.dir).length > 0
|
19
|
-
haml_tag :li do
|
20
|
-
path = n.dir.gsub(self.class.views, '')
|
21
|
-
haml_concat link_to(File.basename(path), path)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
else
|
25
|
-
haml_tag(:li, :id => first ? "home" : nil) do
|
26
|
-
if first
|
27
|
-
haml_concat link_to("Homepage", "/" + self.class.index_file)
|
28
|
-
else
|
29
|
-
# we are a dir
|
30
|
-
index = n.children.find { |c| c.dir.include?(self.class.index_file) }
|
31
|
-
haml_concat link_to(index.dir.gsub(self.class.views + "/", '').gsub("/" + File.basename(index.dir), '').capitalize, index.dir.gsub(self.class.views, ''))
|
32
|
-
end
|
33
|
-
|
34
|
-
other_children = n.children.select { |c| !c.dir.include?(self.class.index_file) }
|
35
|
-
if other_children.length > 0
|
36
|
-
if first
|
37
|
-
other_children.each { |i| sitemap_node(i) }
|
38
|
-
else
|
39
|
-
haml_tag :ul do
|
40
|
-
other_children.each { |i| sitemap_node(i) }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
app.get "/#{@sitemap_url}" do
|
50
|
-
# Return :utility to put it util top menu. False to ignore
|
51
|
-
@tree, @utility = Middleman::Features::Slickmap.build_sitemap do |file_name|
|
52
|
-
:valid
|
53
|
-
end
|
54
|
-
|
55
|
-
haml "template.html".to_sym, :layout => false, :views => File.expand_path(File.join(File.dirname(__FILE__), "slickmap"))
|
56
|
-
end
|
57
|
-
end
|
58
|
-
alias :included :registered
|
59
|
-
end
|
60
|
-
|
61
|
-
def self.build_sitemap(&block)
|
62
|
-
@@utility = []
|
63
|
-
[recurse_sitemap(Middleman::Server.views, &block), @@utility]
|
64
|
-
end
|
65
|
-
|
66
|
-
def self.recurse_sitemap(path, &block)
|
67
|
-
bad_ext = path.split('.html')[1]
|
68
|
-
path = path.gsub(bad_ext, '') if bad_ext
|
69
|
-
entry = Entry.new(path, [])
|
70
|
-
|
71
|
-
#no "." or ".." dirs
|
72
|
-
Dir[File.join(path, "*")].each do |e|
|
73
|
-
next if !File.directory?(e) && !e.include?(".html")
|
74
|
-
if File.directory?(e)
|
75
|
-
entry.children << recurse_sitemap(e, &block)
|
76
|
-
elsif block_given?
|
77
|
-
how_to_handle = block.call(e)
|
78
|
-
if how_to_handle == :valid
|
79
|
-
entry.children << recurse_sitemap(e, &block)
|
80
|
-
elsif how_to_handle == :utility
|
81
|
-
bad_ext = e.split('.html')[1]
|
82
|
-
e = e.gsub(bad_ext, '') if bad_ext
|
83
|
-
@@utility << e.gsub(Middleman::Server.views + "/", '')
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
entry
|
89
|
-
end
|
90
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
!!!
|
2
|
-
%html{ :xmlns => "http://www.w3.org/1999/xhtml" }
|
3
|
-
%head
|
4
|
-
%meta{ :content => "text/html; charset=utf-8", "http-equiv" => "Content-type" }
|
5
|
-
%title Sitemap
|
6
|
-
%style{ :type => "text/css" }
|
7
|
-
:sass
|
8
|
-
@import "slickmap"
|
9
|
-
+slickmap
|
10
|
-
:javascript
|
11
|
-
window.onload = function() {
|
12
|
-
document.getElementById('primaryNav').className = "col" + document.querySelectorAll("#primaryNav > li:not(#home)").length;
|
13
|
-
};
|
14
|
-
|
15
|
-
%body
|
16
|
-
.logo
|
17
|
-
%h1= @project_name || "Sitemap"
|
18
|
-
- if @project_subtitle
|
19
|
-
%h2= @project_subtitle
|
20
|
-
|
21
|
-
- if @utility.length > 0
|
22
|
-
%ul#utilityNav
|
23
|
-
- @utility.each do |u|
|
24
|
-
%li= link_to u, u
|
25
|
-
|
26
|
-
%ul#primaryNav
|
27
|
-
- sitemap_node(@tree, true)
|