middleman 1.2.3 → 1.2.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.
- data/lib/middleman/builder.rb +5 -4
- data/lib/middleman/templates.rb +3 -0
- data/lib/middleman/templates/default/views/layout.haml +12 -4
- data/lib/middleman/templates/default/views/stylesheets/site.css.sass +1 -1
- data/lib/middleman/templates/xhtml.rb +16 -0
- data/lib/middleman/templates/xhtml/config.ru +4 -0
- data/lib/middleman/templates/xhtml/config.tt +68 -0
- data/lib/middleman/templates/xhtml/views/index.html.haml +4 -0
- data/lib/middleman/templates/xhtml/views/layout.haml +13 -0
- data/lib/middleman/templates/xhtml/views/stylesheets/site.css.sass +27 -0
- data/lib/middleman/version.rb +1 -1
- metadata +9 -3
data/lib/middleman/builder.rb
CHANGED
@@ -47,11 +47,11 @@ module Middleman
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def build_static_files
|
50
|
-
action Directory.new(self, Middleman::Server.public, Middleman::Server.build_dir, { :force => true })
|
50
|
+
action Directory.new(self, Middleman::Server.public, :public, Middleman::Server.build_dir, { :force => true })
|
51
51
|
end
|
52
52
|
|
53
53
|
def build_dynamic_files
|
54
|
-
action Directory.new(self, Middleman::Server.views, Middleman::Server.build_dir, { :force => true })
|
54
|
+
action Directory.new(self, Middleman::Server.views, :dynamic, Middleman::Server.build_dir, { :force => true })
|
55
55
|
end
|
56
56
|
|
57
57
|
@@hooks = {}
|
@@ -69,7 +69,8 @@ module Middleman
|
|
69
69
|
class Directory < ::Thor::Actions::EmptyDirectory
|
70
70
|
attr_reader :source
|
71
71
|
|
72
|
-
def initialize(base, source, destination=nil, config={}, &block)
|
72
|
+
def initialize(base, source, mode, destination=nil, config={}, &block)
|
73
|
+
@mode = mode
|
73
74
|
@source = File.expand_path(base.find_in_source_paths(source.to_s))
|
74
75
|
@block = block
|
75
76
|
super(base, destination, { :recursive => true }.merge(config))
|
@@ -104,7 +105,7 @@ module Middleman
|
|
104
105
|
handled_by_tilt = ::Tilt.mappings.keys.include?(file_extension.gsub(/^\./, ""))
|
105
106
|
if handled_by_tilt || (file_extension == ".js")
|
106
107
|
new_file_extension = (file_extension == ".js") ? ".js" : ""
|
107
|
-
next if file_source.split('/').last.split('.').length < 3
|
108
|
+
next if @mode == :dynamic && file_source.split('/').last.split('.').length < 3
|
108
109
|
|
109
110
|
file_destination.gsub!(file_extension, new_file_extension)
|
110
111
|
destination = base.tilt_template(file_source, file_destination, config, &@block)
|
data/lib/middleman/templates.rb
CHANGED
@@ -1,13 +1,21 @@
|
|
1
|
-
!!!
|
2
|
-
%html{ :
|
1
|
+
!!! 5
|
2
|
+
%html{ :lang => "en" }
|
3
3
|
%head
|
4
|
-
%meta{ :
|
4
|
+
%meta{ :charset => "utf-8" }
|
5
|
+
|
6
|
+
/ Always force latest IE rendering engine (even in intranet) & Chrome Frame
|
7
|
+
%meta{ :content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible" }
|
8
|
+
|
5
9
|
/ Comment in layout
|
10
|
+
|
6
11
|
= stylesheet_link_tag "site.css"
|
12
|
+
|
7
13
|
:javascript
|
8
14
|
// Comment in javascript
|
15
|
+
|
9
16
|
= yield_content :head
|
10
17
|
|
11
18
|
%body{ :class => page_classes }
|
12
|
-
|
19
|
+
|
20
|
+
#main{ :role => "main" }
|
13
21
|
= yield
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Middleman::Templates::Xhtml < Middleman::Templates::Base
|
2
|
+
def self.source_root
|
3
|
+
File.join(File.dirname(__FILE__), 'default')
|
4
|
+
end
|
5
|
+
|
6
|
+
def build_scaffold
|
7
|
+
template "config.tt", File.join(location, "config.rb")
|
8
|
+
template "config.ru", File.join(location, "config.ru")
|
9
|
+
directory "views", File.join(location, "views")
|
10
|
+
empty_directory File.join(location, "public", options[:css_dir])
|
11
|
+
empty_directory File.join(location, "public", options[:js_dir])
|
12
|
+
empty_directory File.join(location, "public", options[:images_dir])
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
Middleman::Templates.register(:xhtml, Middleman::Templates::Xhtml)
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# CodeRay syntax highlighting in Haml
|
2
|
+
# activate :code_ray
|
3
|
+
|
4
|
+
# Automatic sitemaps (gem install middleman-slickmap)
|
5
|
+
# require "middleman-slickmap"
|
6
|
+
# activate :slickmap
|
7
|
+
|
8
|
+
# Automatic image dimension calculations
|
9
|
+
# activate :automatic_image_sizes
|
10
|
+
|
11
|
+
# Per-page layout changes
|
12
|
+
# With no layout
|
13
|
+
# page "/path/to/file.html", :layout => false
|
14
|
+
# With alternative layout
|
15
|
+
# page "/path/to/file.html", :layout => :otherlayout
|
16
|
+
|
17
|
+
# Helpers
|
18
|
+
helpers do
|
19
|
+
def some_helper(*args)
|
20
|
+
"Helping"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
<% if options[:css_dir] != "stylesheets" -%>
|
25
|
+
set :css_dir, "<%= options[:css_dir] -%>"
|
26
|
+
<% else -%>
|
27
|
+
# Change the CSS directory
|
28
|
+
# set :css_dir, "alternative_css_directory"
|
29
|
+
<% end -%>
|
30
|
+
|
31
|
+
<% if options[:js_dir] != "javascripts" -%>
|
32
|
+
set :js_dir, "<%= options[:js_dir] -%>"
|
33
|
+
<% else -%>
|
34
|
+
# Change the JS directory
|
35
|
+
# set :js_dir, "alternative_js_directory"
|
36
|
+
<% end -%>
|
37
|
+
|
38
|
+
<% if options[:images_dir] != "images" -%>
|
39
|
+
set :images_dir, "<%= options[:images_dir] -%>"
|
40
|
+
<% else -%>
|
41
|
+
# Change the images directory
|
42
|
+
# set :images_dir, "alternative_image_directory"
|
43
|
+
<% end -%>
|
44
|
+
|
45
|
+
# Build-specific configuration
|
46
|
+
configure :build do
|
47
|
+
# For example, change the Compass output style for deployment
|
48
|
+
# activate :minify_css
|
49
|
+
|
50
|
+
# Minify Javascript on build
|
51
|
+
# activate :minify_javascript
|
52
|
+
|
53
|
+
# Enable cache buster
|
54
|
+
# activate :cache_buster
|
55
|
+
|
56
|
+
# Use relative URLs
|
57
|
+
# activate :relative_assets
|
58
|
+
|
59
|
+
# Compress PNGs after build (gem install middleman-smusher)
|
60
|
+
# require "middleman-smusher"
|
61
|
+
# activate :smusher
|
62
|
+
|
63
|
+
# Generate ugly/obfuscated HTML from Haml
|
64
|
+
# activate :ugly_haml
|
65
|
+
|
66
|
+
# Or use a different image path
|
67
|
+
# set :http_path, "/Content/images/"
|
68
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
!!! Strict
|
2
|
+
%html{ :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en" }
|
3
|
+
%head
|
4
|
+
%meta{ :content => "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
|
5
|
+
/ Comment in layout
|
6
|
+
= stylesheet_link_tag "site.css"
|
7
|
+
:javascript
|
8
|
+
// Comment in javascript
|
9
|
+
= yield_content :head
|
10
|
+
|
11
|
+
%body{ :class => page_classes }
|
12
|
+
#frame
|
13
|
+
= yield
|
@@ -0,0 +1,27 @@
|
|
1
|
+
@import "compass"
|
2
|
+
@import "blueprint"
|
3
|
+
|
4
|
+
$font-color: #2a2a2a
|
5
|
+
$link-color: #0388a6
|
6
|
+
$link-hover-color: #009ce0
|
7
|
+
$link-focus-color: $link-color
|
8
|
+
$link-active-color: $link-color
|
9
|
+
$link-visited-color: $link-color
|
10
|
+
|
11
|
+
$blueprint-font-family: 'Century Gothic', 'Apple Gothic', 'Helvetica Neue', arial, sans-serif
|
12
|
+
$blueprint-font-size: 13px
|
13
|
+
$blueprint-grid-columns: 12
|
14
|
+
$blueprint-grid-width: 60px
|
15
|
+
$blueprint-grid-margin: 20px
|
16
|
+
|
17
|
+
+global-reset
|
18
|
+
|
19
|
+
+blueprint-typography
|
20
|
+
|
21
|
+
a
|
22
|
+
+link-colors($link-color, $link-hover-color, $link-focus-color, $link-active-color, $link-visited-color)
|
23
|
+
|
24
|
+
#frame
|
25
|
+
padding: 50px
|
26
|
+
text-align: center
|
27
|
+
+container
|
data/lib/middleman/version.rb
CHANGED
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: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 4
|
10
|
+
version: 1.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Thomas Reynolds
|
@@ -441,6 +441,12 @@ files:
|
|
441
441
|
- lib/middleman/templates/html5/public/js/script.js
|
442
442
|
- lib/middleman/templates/html5/public/robots.txt
|
443
443
|
- lib/middleman/templates/local.rb
|
444
|
+
- lib/middleman/templates/xhtml.rb
|
445
|
+
- lib/middleman/templates/xhtml/config.ru
|
446
|
+
- lib/middleman/templates/xhtml/config.tt
|
447
|
+
- lib/middleman/templates/xhtml/views/index.html.haml
|
448
|
+
- lib/middleman/templates/xhtml/views/layout.haml
|
449
|
+
- lib/middleman/templates/xhtml/views/stylesheets/site.css.sass
|
444
450
|
- lib/middleman/version.rb
|
445
451
|
- middleman.gemspec
|
446
452
|
has_rdoc: true
|