middleman 3.0.0.alpha.2 → 3.0.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/.gitignore +2 -0
  2. data/.yardopts +5 -0
  3. data/CHANGELOG +5 -0
  4. data/README.md +3 -0
  5. data/Rakefile +0 -2
  6. data/bin/middleman +36 -33
  7. data/features/auto_layout.feature +37 -0
  8. data/features/builder.feature +1 -0
  9. data/features/chained_templates.feature +15 -0
  10. data/features/content_for.feature +16 -0
  11. data/features/directory_index.feature +1 -0
  12. data/features/front-matter.feature +2 -1
  13. data/features/partials.feature +35 -0
  14. data/features/support/env.rb +3 -3
  15. data/fixtures/chained-app/config.rb +0 -0
  16. data/fixtures/chained-app/data/article.yml +2 -0
  17. data/fixtures/chained-app/source/index.html.markdown.erb +8 -0
  18. data/fixtures/different-engine-layout/config.rb +0 -0
  19. data/fixtures/different-engine-layout/source/index.html.haml +1 -0
  20. data/fixtures/different-engine-layout/source/layout.erb +9 -0
  21. data/fixtures/engine-matching-layout/config.rb +0 -0
  22. data/fixtures/engine-matching-layout/source/index.html.erb +1 -0
  23. data/fixtures/engine-matching-layout/source/layout.erb +9 -0
  24. data/fixtures/indexable-app/source/.htaccess +1 -0
  25. data/fixtures/manual-layout-missing/config.rb +1 -0
  26. data/fixtures/manual-layout-missing/source/index.html.erb +1 -0
  27. data/fixtures/manual-layout-override/config.rb +3 -0
  28. data/fixtures/manual-layout-override/source/index.html.erb +1 -0
  29. data/fixtures/manual-layout-override/source/layouts/another.erb +9 -0
  30. data/fixtures/manual-layout-override/source/layouts/custom.erb +9 -0
  31. data/fixtures/manual-layout/config.rb +1 -0
  32. data/fixtures/manual-layout/source/index.html.erb +1 -0
  33. data/fixtures/manual-layout/source/layouts/custom.erb +9 -0
  34. data/fixtures/multiple-layouts/config.rb +0 -0
  35. data/fixtures/multiple-layouts/source/index.html.erb +1 -0
  36. data/fixtures/multiple-layouts/source/layout.erb +9 -0
  37. data/fixtures/multiple-layouts/source/layout.haml +6 -0
  38. data/fixtures/no-layout/config.rb +0 -0
  39. data/fixtures/no-layout/source/index.html.erb +1 -0
  40. data/fixtures/partials-app/config.rb +0 -0
  41. data/fixtures/partials-app/source/_locals.erb +1 -0
  42. data/fixtures/partials-app/source/_main.erb +1 -0
  43. data/fixtures/partials-app/source/_main.haml +1 -0
  44. data/fixtures/partials-app/source/index.html.erb +3 -0
  45. data/fixtures/partials-app/source/locals.html.erb +1 -0
  46. data/fixtures/partials-app/source/second.html.haml +3 -0
  47. data/fixtures/partials-app/source/shared/_footer.erb +1 -0
  48. data/fixtures/partials-app/source/shared/_header.erb +1 -0
  49. data/fixtures/partials-app/source/sub/_local.erb +1 -0
  50. data/fixtures/partials-app/source/sub/index.html.erb +3 -0
  51. data/fixtures/test-app/config.rb +6 -0
  52. data/fixtures/test-app/source/.htaccess +1 -0
  53. data/fixtures/test-app/source/content_for_erb.html.erb +5 -0
  54. data/fixtures/test-app/source/content_for_haml.html.haml +4 -0
  55. data/fixtures/test-app/source/content_for_slim.html.slim +4 -0
  56. data/fixtures/test-app/source/images/Chrome_Logo.svg +231 -0
  57. data/fixtures/test-app/source/images/cfb_tomb-perennial-energy.svgz +0 -0
  58. data/fixtures/test-app/source/index.html.haml +3 -0
  59. data/fixtures/test-app/source/layouts/content_for.erb +4 -0
  60. data/lib/middleman.rb +90 -105
  61. data/lib/middleman/base.rb +254 -239
  62. data/lib/middleman/builder.rb +51 -46
  63. data/lib/middleman/cache.rb +57 -0
  64. data/lib/middleman/cli.rb +7 -10
  65. data/lib/middleman/core_extensions/assets.rb +3 -3
  66. data/lib/middleman/core_extensions/compass.rb +25 -45
  67. data/lib/middleman/core_extensions/data.rb +14 -12
  68. data/lib/middleman/core_extensions/default_helpers.rb +11 -10
  69. data/lib/middleman/core_extensions/{features.rb → extensions.rb} +66 -20
  70. data/lib/middleman/core_extensions/front_matter.rb +16 -13
  71. data/lib/middleman/core_extensions/rendering.rb +224 -4
  72. data/lib/middleman/core_extensions/routing.rb +15 -12
  73. data/lib/middleman/core_extensions/sitemap.rb +6 -191
  74. data/lib/middleman/core_extensions/sprockets.rb +3 -2
  75. data/lib/middleman/extensions/asset_host.rb +34 -0
  76. data/lib/middleman/extensions/automatic_image_sizes.rb +38 -0
  77. data/lib/middleman/{features → extensions}/automatic_image_sizes/fastimage.rb +0 -0
  78. data/lib/middleman/extensions/cache_buster.rb +59 -0
  79. data/lib/middleman/extensions/directory_indexes.rb +62 -0
  80. data/lib/middleman/extensions/lorem.rb +130 -0
  81. data/lib/middleman/extensions/minify_css.rb +15 -0
  82. data/lib/middleman/{features → extensions}/minify_css/cssmin.rb +0 -0
  83. data/lib/middleman/extensions/minify_javascript.rb +54 -0
  84. data/lib/middleman/extensions/relative_assets.rb +46 -0
  85. data/lib/middleman/extensions/sitemap_tree.rb +38 -0
  86. data/lib/middleman/guard.rb +48 -35
  87. data/lib/middleman/renderers/erb.rb +3 -13
  88. data/lib/middleman/renderers/haml.rb +13 -0
  89. data/lib/middleman/renderers/liquid.rb +3 -3
  90. data/lib/middleman/renderers/markdown.rb +10 -12
  91. data/lib/middleman/renderers/sass.rb +3 -9
  92. data/lib/middleman/sitemap/page.rb +106 -0
  93. data/lib/middleman/sitemap/store.rb +141 -0
  94. data/lib/middleman/sitemap/template.rb +57 -0
  95. data/lib/middleman/step_definitions.rb +6 -0
  96. data/lib/middleman/step_definitions/builder_steps.rb +45 -0
  97. data/{features → lib/middleman}/step_definitions/generator_steps.rb +6 -6
  98. data/{features/step_definitions/middleman_steps.rb → lib/middleman/step_definitions/server_steps.rb} +3 -3
  99. data/lib/middleman/templates/default/source/index.html.erb +1 -1
  100. data/lib/middleman/version.rb +7 -1
  101. data/middleman-x86-mingw32.gemspec +1 -1
  102. data/middleman.gemspec +5 -3
  103. metadata +359 -381
  104. data/bin/mm-build +0 -9
  105. data/bin/mm-init +0 -9
  106. data/bin/mm-server +0 -9
  107. data/features/step_definitions/builder_steps.rb +0 -52
  108. data/features/tiny_src.feature +0 -15
  109. data/lib/middleman/features/asset_host.rb +0 -32
  110. data/lib/middleman/features/automatic_image_sizes.rb +0 -34
  111. data/lib/middleman/features/cache_buster.rb +0 -55
  112. data/lib/middleman/features/directory_indexes.rb +0 -59
  113. data/lib/middleman/features/lorem.rb +0 -126
  114. data/lib/middleman/features/minify_css.rb +0 -11
  115. data/lib/middleman/features/minify_javascript.rb +0 -50
  116. data/lib/middleman/features/relative_assets.rb +0 -42
  117. data/lib/middleman/features/sitemap_tree.rb +0 -34
@@ -0,0 +1 @@
1
+ <%= partial 'locals', :locals => { :foo => 'bar' } %>
@@ -0,0 +1,3 @@
1
+ = partial "shared/header"
2
+ = partial "main"
3
+ = partial "shared/footer"
@@ -0,0 +1 @@
1
+ %footer Footer
@@ -0,0 +1 @@
1
+ <header>Header</header>
@@ -0,0 +1 @@
1
+ <h2>Local Partial</h2>
@@ -0,0 +1,3 @@
1
+ <%= partial "shared/header" %>
2
+ <%= partial "local" %>
3
+ <%= partial "shared/footer" %>
@@ -15,6 +15,12 @@ page "/target_ignore.html", :proxy => "/should_be_ignored3.html", :ignore => tru
15
15
  end
16
16
  end
17
17
 
18
+ with_layout :content_for do
19
+ page "/content_for_erb.html"
20
+ page "/content_for_haml.html"
21
+ page "/content_for_slim.html"
22
+ end
23
+
18
24
  with_layout false do
19
25
  page "/markdown.html"
20
26
  page "/relative_image.html"
@@ -0,0 +1 @@
1
+ # I'm an htaccess file!
@@ -0,0 +1,5 @@
1
+ <% content_for :from_template do %>
2
+ I am the yielded content erb
3
+ <% end %>
4
+
5
+ I am in the template
@@ -0,0 +1,4 @@
1
+ - content_for :from_template do
2
+ = "I am the yielded content haml"
3
+
4
+ %p I am in the template
@@ -0,0 +1,4 @@
1
+ - content_for :from_template do
2
+ | I am the yielded content slim
3
+
4
+ | I am in the template
@@ -0,0 +1,231 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="256px" height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
6
+ <g id="Layer_2">
7
+ <g>
8
+ <circle fill="#4E4A4A" cx="128.075" cy="126.26" r="109"/>
9
+
10
+ <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="324.5693" y1="-144.0381" x2="427.235" y2="-261.3711" gradientTransform="matrix(1 0 0 -1 -256 -90)">
11
+ <stop offset="0" style="stop-color:#DED9D9"/>
12
+ <stop offset="1" style="stop-color:#6A6363"/>
13
+ </linearGradient>
14
+ <path fill="url(#SVGID_1_)" d="M67.243,45.813c0,0-8.167,4.917-5.292,15.667s8.125,16.75,12.25,21.875s8.292,12.542,7.625,17.625
15
+ s-2.375,25.419,10.75,38.647c13.125,13.227,22.875,13.602,22.875,13.602l-3.25,2.375l-40.597,33.256l11.472,16.787l27.833,23.832
16
+ l-19.833-3.666l-1.417,5.25l28.917,0.416l-12-19.5l-20.5-18.832c0,0-3.584-3.793,3.583-9.043s42.167-32.043,42.167-32.043
17
+ l38.833-57.581c0,0,3.125,0.125,9,0.5s51.542,20.75,51.542,20.75s-0.778-15.379-1.542-22.75c-0.316-3.062,0.979-2.7,2.834,1.667
18
+ c1.854,4.366,0.75,12,0.75,12l-1.25-17.333l-6.917-9.333l-1.75,8c0,0,1.375,8.125,1.75,11.125s-1,4-5.375,2s-18.875-6.75-28.5-8
19
+ s-24.375-1.875-24.375-1.875l-75,1l-4,2.917c0,0,0.937-3.438-3.063-10.104S67.243,45.813,67.243,45.813z"/>
20
+ <path fill="#007A3F" d="M74.794,89.323c0,0,4.563,8.094,4.094,14.469c-0.437,5.938-0.813,31.187,23.188,45.562
21
+ c6.234,3.734,11.599,5.156,11.599,5.156l0.568,2.303l-13.979,1.104L65.076,122.98l0.375-28.25l5.125-5.5l2.75-0.625L74.794,89.323
22
+ z"/>
23
+ <path fill="#005A2B" d="M99.409,231.063c0,0,11.5,1,16.25,0.5s23.583,5.5,23.583,5.5s-2.751,4.138-8.667,5.109
24
+ c-5.917,0.975-36.583-7.525-36.583-7.525L99.409,231.063z"/>
25
+ <path fill="#00663F" d="M114.243,156.813c0,0-36.739,26.406-41.667,35.834c-4.928,9.429,8.499,21.668,17.083,28.834
26
+ s21.167,18.873,44.792,19.373c0,0-15.625,4.875-39.125-4.125s-49.75-59-49.75-59L114.243,156.813z"/>
27
+ <polygon fill="#262626" points="65.258,38.479 54.201,46.979 53.076,39.979 61.576,36.854 "/>
28
+ <path fill="#007A3F" d="M65.451,35.896c0,0-5.917-2.458-10,1.917s-6.041,22,11.792,40.5c0,0-12.584-16.998-12.25-30.5
29
+ c0.333-13.5,10.833-9.083,10.833-9.083L65.451,35.896z"/>
30
+
31
+ <radialGradient id="SVGID_2_" cx="351.8242" cy="-188.4795" r="175.0517" gradientTransform="matrix(1 0 0 -1 -256 -90)" gradientUnits="userSpaceOnUse">
32
+ <stop offset="0.0765" style="stop-color:#8DDB92"/>
33
+ <stop offset="0.1633" style="stop-color:#77CE7C"/>
34
+ <stop offset="0.3431" style="stop-color:#3EAB45"/>
35
+ <stop offset="0.5021" style="stop-color:#078A0F"/>
36
+ <stop offset="0.581" style="stop-color:#108C18"/>
37
+ <stop offset="0.7085" style="stop-color:#28922F"/>
38
+ <stop offset="0.7148" style="stop-color:#299230"/>
39
+ </radialGradient>
40
+ <path fill="url(#SVGID_2_)" d="M122.201,241.104c-20.125-2.125-38-19.125-45-26.5s-16.25-15.25-4.625-26.75
41
+ s41.667-31.041,41.667-31.041l0,0c-22.215-5.442-38.668-25.774-38.668-49.667c0-4.174,0.718-7.782,1.095-11.76
42
+ c0.239-2.531-1.969-7.781-8.844-16.156S54.55,60.185,53.263,50.167c-1.438-11.188,6.271-14.688,6.271-14.688
43
+ c-6.541,0.25-17.958,11.5-17.958,11.5c-33.75,31.75-45.667,84.667-22.333,130.667c23.332,46,66.333,61.166,86.833,64.834
44
+ c20.5,3.666,28.375-1.627,28.375-1.627C130.7,241.916,122.201,241.104,122.201,241.104z"/>
45
+ <path fill="#AF8513" d="M238.139,114.566L238.139,114.566c5.396,3.643,6.938,4.414,5.438-10.586s-15.125-36.5-15.125-36.5
46
+ l0.029,0.145c4.205,7.844,11.629,23.352,12.93,37.189C242.402,115.375,241.773,116.59,238.139,114.566z"/>
47
+ <path fill="#591F00" d="M231.075,82.604l2,38.75h13.25c0,0,4.5-25.25-21.25-58.25L231.075,82.604z"/>
48
+ <path fill="#8F0404" d="M81.887,83.542l2.875,1.5c0,0,15.979-21.896,37.48-23.729c21.5-1.833,38.499,10.833,44.166,17
49
+ s8.501,8.833,16.834,8.833s36.138,4.457,46.221,8.957l6.078-2.341l-30.133-28.449L103.243,39.979L81.887,83.542z"/>
50
+
51
+ <radialGradient id="SVGID_3_" cx="386.7256" cy="-214.623" r="116.2404" gradientTransform="matrix(1 0 0 -1 -256 -90)" gradientUnits="userSpaceOnUse">
52
+ <stop offset="0.6157" style="stop-color:#F60000"/>
53
+ <stop offset="0.7247" style="stop-color:#E70505"/>
54
+ <stop offset="0.9171" style="stop-color:#C41212"/>
55
+ <stop offset="1" style="stop-color:#DD7878"/>
56
+ </radialGradient>
57
+ <path fill="url(#SVGID_3_)" d="M81.887,83.542c0,0,8.813-17.813,29.188-24.063s42.25-3.25,59.375,17.375l1.75,1.875
58
+ c0,0,2.875,3.188,11.063,3.5c8.188,0.312,34.313,4.083,44.979,9.333l5.041,2.167c0,0,3.541,1.625,2.875-2.792
59
+ s-3.932-24.363-21.583-42.958c-21.833-23-57.25-36-84.25-35.75s-47.583,6.75-64.917,17.417c0,0-0.833,10.75,0.917,17.75
60
+ s10.083,25.167,14.083,31.167C80.409,78.563,82.002,80.854,81.887,83.542z"/>
61
+
62
+ <radialGradient id="SVGID_4_" cx="383.8242" cy="-189.3115" r="52.1069" gradientTransform="matrix(1 0 0 -1 -256 -90)" gradientUnits="userSpaceOnUse">
63
+ <stop offset="0" style="stop-color:#B1DDF4"/>
64
+ <stop offset="0.0742" style="stop-color:#A9D7F3"/>
65
+ <stop offset="0.1904" style="stop-color:#93C7F1"/>
66
+ <stop offset="0.3332" style="stop-color:#6EADEE"/>
67
+ <stop offset="0.4" style="stop-color:#5B9FEC"/>
68
+ <stop offset="0.5273" style="stop-color:#0B85D1"/>
69
+ <stop offset="0.6182" style="stop-color:#1375B3"/>
70
+ <stop offset="0.6537" style="stop-color:#166FA8"/>
71
+ <stop offset="0.716" style="stop-color:#1E608B"/>
72
+ <stop offset="0.7971" style="stop-color:#2B475C"/>
73
+ <stop offset="0.8424" style="stop-color:#33383F"/>
74
+ <stop offset="1" style="stop-color:#363233"/>
75
+ </radialGradient>
76
+ <ellipse fill="url(#SVGID_4_)" cx="128.075" cy="110.792" rx="46.25" ry="42.75"/>
77
+
78
+ <linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="287.0811" y1="-168.9683" x2="311.8112" y2="-301.8506" gradientTransform="matrix(1 0 0 -1 -256 -90)">
79
+ <stop offset="0" style="stop-color:#FFFFFF"/>
80
+ <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0.53"/>
81
+ </linearGradient>
82
+ <path opacity="0.32" fill="url(#SVGID_5_)" enable-background="new " d="M51.493,45.813c0,0-32.666,37.333-32.334,78.166
83
+ c0.328,40.234,19.917,62,40.167,76.666c18.39,13.32,5.667,14.168-3.5,6.668c0,0-51.015-35.127-38.667-99.333
84
+ C23.827,73.313,51.493,45.813,51.493,45.813z"/>
85
+
86
+ <linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="303.5654" y1="-153.9297" x2="321.5654" y2="-194.5968" gradientTransform="matrix(1 0 0 -1 -256 -90)">
87
+ <stop offset="0" style="stop-color:#FFFFFF"/>
88
+ <stop offset="0.517" style="stop-color:#FFFFFF;stop-opacity:0.53"/>
89
+ </linearGradient>
90
+ <path opacity="0.5" fill="url(#SVGID_6_)" enable-background="new " d="M64.055,76.104c0,0-3.5,1.438-6.813-2.25
91
+ s-8.688,1.875-11.25,3s-5.438-1.938-5.375-4.438s-1-8.688,2.813-13.25s8.875-8.625,8.875-8.625S51.471,61.792,64.055,76.104z"/>
92
+
93
+ <linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="329.1895" y1="-367.6455" x2="329.1894" y2="-263.6457" gradientTransform="matrix(1 0 0 -1 -256 -90)">
94
+ <stop offset="0" style="stop-color:#FFFFFF"/>
95
+ <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0.53"/>
96
+ </linearGradient>
97
+ <path opacity="0.3" fill="url(#SVGID_7_)" enable-background="new " d="M11.928,159.467c1.869,6.135,4.289,12.215,7.314,18.18
98
+ c23.332,46,66.333,61.166,86.833,64.834c20.5,3.666,28.375-1.627,28.375-1.627c-3.75,1.063-12.25,0.25-12.25,0.25
99
+ c-16.375-1.875-33.292-14.375-40.292-21.75c-0.007-0.008,4.75,4.125,0,0C49.555,217.084,22.928,174.439,11.928,159.467z"/>
100
+ <path opacity="0.5" fill="#FFFFFF" enable-background="new " d="M71.346,57.354c0,0,4-6,0.875-12.063
101
+ c-2.152-4.177-5.5-4.5-6.5-3.625C65.721,41.667,66.721,51.854,71.346,57.354"/>
102
+ <path opacity="0.5" fill="#FFFFFF" enable-background="new " d="M79.159,41.313c0,0,6.084-4.25,8.25-6.167
103
+ c2.168-1.917,0.418-5.417-1.916-5.083s-7.5,1.625-10.625,4.917c-2.49,2.624-2.271,5.604-0.521,6.938S78.243,41.979,79.159,41.313z
104
+ "/>
105
+
106
+ <linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="365.0869" y1="-116.2905" x2="436.2679" y2="-153.5437" gradientTransform="matrix(1 0 0 -1 -256 -90)">
107
+ <stop offset="0" style="stop-color:#FFFFFF;stop-opacity:0.7"/>
108
+ <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0"/>
109
+ </linearGradient>
110
+ <path opacity="0.32" fill="url(#SVGID_8_)" enable-background="new " d="M183.492,38.479
111
+ c-56.75-41.5-118.243-0.275-118.243-0.275s52.743-50.225,130.493-0.725L183.492,38.479z"/>
112
+
113
+ <linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="279.0625" y1="-183.9019" x2="299.7944" y2="-194.7521" gradientTransform="matrix(1 0 0 -1 -256 -90)">
114
+ <stop offset="0" style="stop-color:#FFFFFF;stop-opacity:0.7"/>
115
+ <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0"/>
116
+ </linearGradient>
117
+ <path opacity="0.6" fill="url(#SVGID_9_)" enable-background="new " d="M54.952,38.071c-0.017-0.484-0.668-0.216-0.668-0.216
118
+ C-12.341,89.48,14.346,162.042,14.346,162.042C-2.841,78.229,54.502,38.745,54.502,38.745S54.967,38.524,54.952,38.071z"/>
119
+
120
+ <linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="357.2529" y1="-164.501" x2="356.9078" y2="-217.6514" gradientTransform="matrix(1 0 0 -1 -256 -90)">
121
+ <stop offset="0" style="stop-color:#FFFFFF;stop-opacity:0.7"/>
122
+ <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0"/>
123
+ </linearGradient>
124
+ <path opacity="0.6" fill="url(#SVGID_10_)" enable-background="new " d="M109.493,79.229c0,0-14,11.625-11.375,38.75
125
+ c0,0-0.688,3.688-3.75-1.125S90.868,85.604,109.493,79.229z"/>
126
+
127
+ <linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="360.1279" y1="-174.2256" x2="381.9963" y2="-168.7585" gradientTransform="matrix(1 0 0 -1 -256 -90)">
128
+ <stop offset="0" style="stop-color:#FFFFFF;stop-opacity:0.7"/>
129
+ <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0"/>
130
+ </linearGradient>
131
+ <path opacity="0.6" fill="url(#SVGID_11_)" enable-background="new " d="M128.118,75.854c0,0-13.625,3.375-18.063,9.25
132
+ s-6.167-0.313-1.229-3.875S121.118,74.854,128.118,75.854z"/>
133
+ <path fill="#AF8513" d="M179.117,91.854l-1.625,3c0,0,9.333,27.958-6.084,47.125l2.479,0.354l11-21l1-21.667L179.117,91.854z"/>
134
+
135
+ <radialGradient id="SVGID_12_" cx="384.8271" cy="-208.9785" r="125.9904" gradientTransform="matrix(1 0 0 -1 -256 -90)" gradientUnits="userSpaceOnUse">
136
+ <stop offset="0.182" style="stop-color:#FFE650"/>
137
+ <stop offset="0.703" style="stop-color:#FFDB00"/>
138
+ <stop offset="1" style="stop-color:#D5B319"/>
139
+ </radialGradient>
140
+ <path fill="url(#SVGID_12_)" d="M129.408,159.229l-43.333,33.918c0,0-10.251,7.166-3.583,14.416
141
+ c6.666,7.25,29.333,31.666,56.083,33.916s71-19,91-50s32.5-85.499-4-128.999c0,0,14.001,22.833,15.834,42.333
142
+ s-1.834,7.166-19.834,1.333s-30.333-8.667-34.833-10.167s-7.042-3.5-7.667-4.063c0,0,7.229,22.302-0.375,37.813
143
+ C169.2,149.104,154.741,157.479,129.408,159.229z"/>
144
+ <g opacity="0.64">
145
+ <path fill="#FFFFFF" d="M103.169,164.258c6.383-4.395,11.073-7.445,11.073-7.445c-22.215-5.442-38.668-25.774-38.668-49.667
146
+ c0-4.174,0.718-7.782,1.095-11.76c0.175-1.84-0.956-5.125-4.223-9.996c-3.071,7.257-4.771,15.226-4.771,23.59
147
+ C67.675,133.447,82.206,154.539,103.169,164.258z"/>
148
+ <path fill="#FFFFFF" d="M184.486,82.295c-9.979-20.314-30.994-34.315-55.313-34.315c-21.213,0-39.918,10.655-50.974,26.863
149
+ c0.817,1.487,1.569,2.76,2.208,3.72c0,0,1.563,2.229,1.479,4.979c0,0,8.813-17.813,29.188-24.063s42.25-3.25,59.375,17.375
150
+ l1.75,1.875c0,0,2.875,3.188,11.063,3.5C183.631,82.244,184.049,82.267,184.486,82.295z"/>
151
+ <path fill="#FFFFFF" d="M179.075,91.917c0,0,7.229,22.302-0.375,37.812c-9.5,19.375-23.959,27.75-49.292,29.5l-12.238,9.58
152
+ c3.883,0.762,7.896,1.17,12.004,1.17c33.967,0,61.5-27.311,61.5-60.999c0-4.174-0.425-8.249-1.229-12.187
153
+ c-1.08-0.307-1.998-0.579-2.703-0.813C182.242,94.479,179.7,92.479,179.075,91.917z"/>
154
+ </g>
155
+
156
+ <linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="428.9199" y1="-367.645" x2="428.9199" y2="-263.6455" gradientTransform="matrix(1 0 0 -1 -256 -90)">
157
+ <stop offset="0" style="stop-color:#FFFFFF"/>
158
+ <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0.53"/>
159
+ </linearGradient>
160
+ <path opacity="0.3" fill="url(#SVGID_13_)" enable-background="new " d="M229.575,191.479
161
+ c6.829-10.584,12.78-23.908,16.208-38.598c-15.189,29.146-45.028,66.418-99.775,72.766c-17.174,1.99-32.454,1.158-45.951-1.514
162
+ c10.27,8.127,23.77,16.105,38.518,17.346C165.325,243.729,209.575,222.479,229.575,191.479z"/>
163
+
164
+ <linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="341.9707" y1="-167.7676" x2="410.4909" y2="-167.1665" gradientTransform="matrix(1 0 0 -1 -256 -90)">
165
+ <stop offset="0" style="stop-color:#29506B"/>
166
+ <stop offset="0.0677" style="stop-color:#304D68"/>
167
+ <stop offset="0.1639" style="stop-color:#424560"/>
168
+ <stop offset="0.2766" style="stop-color:#613854"/>
169
+ <stop offset="0.297" style="stop-color:#673551"/>
170
+ <stop offset="0.5515" style="stop-color:#4D7EBE"/>
171
+ <stop offset="0.7455" style="stop-color:#633753"/>
172
+ <stop offset="1" style="stop-color:#29506B"/>
173
+ </linearGradient>
174
+ <path fill="url(#SVGID_14_)" d="M89.583,87.094c0.742-0.339,4.361-2.203,19.41-11.927c17.667-11.417,24.833-1.333,31.667,0.667
175
+ s10.583-2,10.583-2s-0.095-0.066-0.265-0.176c-6.754-3.567-14.567-5.616-22.902-5.616C112.017,68.042,97.875,75.609,89.583,87.094
176
+ z"/>
177
+ <path opacity="0.15" fill="#FFFFFF" enable-background="new " d="M127.999,69.188c25.181,0,45.646,19.332,46.222,42.479
178
+ c0.01-0.333,0.027-0.665,0.027-1c0-23.61-20.707-42.75-46.25-42.75s-46.25,19.14-46.25,42.75c0,0.335,0.02,0.667,0.027,1
179
+ C82.353,88.52,102.819,69.188,127.999,69.188z"/>
180
+
181
+ <linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="415.9873" y1="-229.3955" x2="402.3207" y2="-172.3946" gradientTransform="matrix(1 0 0 -1 -256 -90)">
182
+ <stop offset="0" style="stop-color:#343539"/>
183
+ <stop offset="0.3212" style="stop-color:#29506B"/>
184
+ <stop offset="1" style="stop-color:#C7DD85"/>
185
+ </linearGradient>
186
+ <path opacity="0.6" fill="url(#SVGID_15_)" enable-background="new " d="M155.688,86.479c0,0,14,17.5,3.334,32
187
+ c-10.668,14.5-15.502,18.833-16.168,23.667c0,0,30-9.168,28.5-25.5C169.854,100.313,166.521,93.979,155.688,86.479"/>
188
+
189
+ <linearGradient id="SVGID_16_" gradientUnits="userSpaceOnUse" x1="363.085" y1="-235.2949" x2="363.6172" y2="-212.6716" gradientTransform="matrix(1 0 0 -1 -256 -90)">
190
+ <stop offset="0" style="stop-color:#343539"/>
191
+ <stop offset="0.3212" style="stop-color:#29506B"/>
192
+ <stop offset="1" style="stop-color:#496D4E"/>
193
+ </linearGradient>
194
+ <path fill="url(#SVGID_16_)" d="M84.864,98.979c0,0,1.125,19.75,6.375,23.75c0,0,8.208,20.16,39.542,18.326l-3.042,5.674
195
+ c0,0-23.75,6.25-33.875-9.125C83.739,122.229,83.739,112.604,84.864,98.979z"/>
196
+
197
+ <linearGradient id="SVGID_17_" gradientUnits="userSpaceOnUse" x1="492.6963" y1="-215.0396" x2="499.5298" y2="-223.5401" gradientTransform="matrix(1 0 0 -1 -256 -90)">
198
+ <stop offset="0" style="stop-color:#F4DD80"/>
199
+ <stop offset="1" style="stop-color:#F4DD80;stop-opacity:0.3"/>
200
+ </linearGradient>
201
+ <path fill="url(#SVGID_17_)" d="M247.033,140.166c0,0-3.25-14.64-12.469-14.234l0.094-1.391
202
+ C234.658,124.542,244.283,123.792,247.033,140.166z"/>
203
+
204
+ <linearGradient id="SVGID_18_" gradientUnits="userSpaceOnUse" x1="491.7793" y1="-206.5625" x2="467.195" y2="-274.9928" gradientTransform="matrix(1 0 0 -1 -256 -90)">
205
+ <stop offset="0" style="stop-color:#F4DD80"/>
206
+ <stop offset="1" style="stop-color:#F4DD80;stop-opacity:0.3"/>
207
+ </linearGradient>
208
+ <path fill="url(#SVGID_18_)" d="M234.564,125.932h1.156c-0.779,11.214-6.832,50.207-35.229,68.214
209
+ C200.492,194.146,230.689,173.182,234.564,125.932z"/>
210
+ <path fill="#D1AB1A" d="M188.91,226.063c0,0,3.582-9-7.668-19.75c0,0,31.25-18,41.084-39.334
211
+ c9.832-21.332,11.166-38,10.832-43.666c0,0,11.75-1.896,14,16.478c0,0-2.375-14.375-12.5-15.25c0,0-1.461,25.083-12.125,44.563
212
+ c-9.375,17.125-24.75,27.375-39,37.5C183.533,206.604,193.16,217.52,188.91,226.063z"/>
213
+
214
+ <linearGradient id="SVGID_19_" gradientUnits="userSpaceOnUse" x1="440.0918" y1="-293.0024" x2="445.4176" y2="-309.92" gradientTransform="matrix(1 0 0 -1 -256 -90)">
215
+ <stop offset="0" style="stop-color:#F4DD80"/>
216
+ <stop offset="1" style="stop-color:#F4DD80;stop-opacity:0.3"/>
217
+ </linearGradient>
218
+ <path fill="url(#SVGID_19_)" d="M184.596,205.822c0,0,8.625,10.531,4.969,18.719c0,0,2.781-6.688-6.063-17.938L184.596,205.822z"
219
+ />
220
+
221
+ <linearGradient id="SVGID_20_" gradientUnits="userSpaceOnUse" x1="414.5322" y1="-303.7339" x2="426.1514" y2="-323.9412" gradientTransform="matrix(1 0 0 -1 -256 -90)">
222
+ <stop offset="0" style="stop-color:#F4DD80"/>
223
+ <stop offset="1" style="stop-color:#F4DD80;stop-opacity:0.3"/>
224
+ </linearGradient>
225
+ <path fill="url(#SVGID_20_)" d="M157.033,236.604c0,0-5.625-10-6.625-14.625c0,0,16.25-4,22.125-6.875c0,0,4.125,4.75,7,14.5
226
+ c0,0,0.125-9.25-6.875-16.5l-24.75,7.75C147.908,220.854,153.658,233.229,157.033,236.604z"/>
227
+ <path fill="#D1AB1A" d="M158.242,238.063c0,0-7.75-5.998-11.416-18.082c0,0,15.666-3.002,25.916-7.834c0,0,8.25,7.75,7.25,19.916
228
+ c0,0-0.5-10.916-7.334-18.332c0,0-16.25,6.498-23.75,7.416C148.908,221.146,151.326,229.98,158.242,238.063z"/>
229
+ </g>
230
+ </g>
231
+ </svg>
@@ -1,5 +1,8 @@
1
1
  %h1 Welcome
2
2
 
3
+ = image_tag "Chrome_Logo.svg"
4
+ = image_tag "cfb_tomb-perennial-energy.svgz"
5
+
3
6
  :markdown
4
7
  ## H2
5
8
 
@@ -0,0 +1,4 @@
1
+ In Layout: <%= yield_content(:from_template).chomp.strip %>
2
+
3
+ In Template:
4
+ <%= yield %>
data/lib/middleman.rb CHANGED
@@ -1,56 +1,3 @@
1
- # Middleman is a static site renderer that provides all the conveniences of
2
- # a modern web stack, like Ruby on Rails, while remaining focused on building
3
- # the fastest, most-professional sites possible
4
- #
5
- # Install Middleman:
6
- #
7
- # gem install middleman
8
- #
9
- # To accomplish its goals, Middleman supports provides access to:
10
- #
11
- #### Command-line tool:
12
- # * **middleman init**: A tool for creating to new static sites.
13
- # * **middleman server**: A tool for rapidly developing your static site.
14
- # * **middleman build**: A tool for exporting your site into optimized HTML, CSS & JS.
15
- #
16
- #### Tons of templating languages including:
17
- # * ERB (.erb)
18
- # * Interpolated String (.str)
19
- # * Sass (.sass)
20
- # * Scss (.scss)
21
- # * Haml (.haml)
22
- # * Slim (.slim)
23
- # * Less CSS (.less)
24
- # * Builder (.builder)
25
- # * Liquid (.liquid)
26
- # * RDiscount (.markdown)
27
- # * RedCloth (.textile)
28
- # * RDoc (.rdoc)
29
- # * Radius (.radius)
30
- # * Markaby (.mab)
31
- # * Nokogiri (.nokogiri)
32
- # * Mustache (.mustache)
33
- # * CoffeeScript (.coffee)
34
- #
35
- #### Compile-time Optimiztions
36
- # * Javascript Minifiers: YUI, Google Closure & UglifyJS
37
- # * Smush.it Image Compression
38
- # * CSS Minification
39
- #
40
- #### Robust Extensions:
41
- # Add your own runtime and build-time features!
42
- #
43
- #### Next Steps:
44
- # * [Visit the website]
45
- # * [Read the wiki]
46
- # * [Email the users group]
47
- # * [Submit bug reports]
48
- #
49
- # [Visit the website]: http://middlemanapp.com
50
- # [Read the wiki]: https://github.com/tdreyno/middleman/wiki
51
- # [Email the users group]: https://convore.com/middleman/
52
- # [Submit bug reports]: https://github.com/tdreyno/middleman/issues
53
-
54
1
  # Setup our load paths
55
2
  libdir = File.dirname(__FILE__)
56
3
  $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
@@ -59,7 +6,7 @@ $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
59
6
  module Middleman
60
7
  # Auto-load modules on-demand
61
8
  autoload :Base, "middleman/base"
62
- autoload :Hooks, "middleman/hooks"
9
+ autoload :Cache, "middleman/cache"
63
10
  autoload :Builder, "middleman/builder"
64
11
  autoload :CLI, "middleman/cli"
65
12
  autoload :Templates, "middleman/templates"
@@ -67,25 +14,31 @@ module Middleman
67
14
 
68
15
  # Custom Renderers
69
16
  module Renderers
17
+ autoload :Haml, "middleman/renderers/haml"
70
18
  autoload :Sass, "middleman/renderers/sass"
71
19
  autoload :Markdown, "middleman/renderers/markdown"
72
20
  autoload :ERb, "middleman/renderers/erb"
73
- autoload :CoffeeScript, "middleman/renderers/coffee_script"
74
21
  autoload :Liquid, "middleman/renderers/liquid"
75
22
  end
76
23
 
24
+ module Sitemap
25
+ autoload :Store, "middleman/sitemap/store"
26
+ autoload :Page, "middleman/sitemap/page"
27
+ autoload :Template, "middleman/sitemap/template"
28
+ end
29
+
77
30
  module CoreExtensions
78
31
  # File Change Notifier
79
32
  autoload :FileWatcher, "middleman/core_extensions/file_watcher"
80
33
 
81
34
  # In-memory Sitemap
82
- autoload :Sitemap, "middleman/core_extensions/sitemap"
35
+ autoload :Sitemap, "middleman/core_extensions/sitemap"
83
36
 
84
37
  # Add Builder callbacks
85
38
  autoload :Builder, "middleman/core_extensions/builder"
86
39
 
87
40
  # Custom Feature API
88
- autoload :Features, "middleman/core_extensions/features"
41
+ autoload :Extensions, "middleman/core_extensions/extensions"
89
42
 
90
43
  # Asset Path Pipeline
91
44
  autoload :Assets, "middleman/core_extensions/assets"
@@ -113,92 +66,124 @@ module Middleman
113
66
  autoload :Routing, "middleman/core_extensions/routing"
114
67
  end
115
68
 
116
- module Features
69
+ module Extensions
117
70
  # RelativeAssets allow any asset path in dynamic templates to be either
118
71
  # relative to the root of the project or use an absolute URL.
119
- autoload :RelativeAssets, "middleman/features/relative_assets"
72
+ autoload :RelativeAssets, "middleman/extensions/relative_assets"
120
73
 
121
74
  # AssetHost allows you to setup multiple domains to host your static
122
75
  # assets. Calls to asset paths in dynamic templates will then rotate
123
76
  # through each of the asset servers to better spread the load.
124
- autoload :AssetHost, "middleman/features/asset_host"
77
+ autoload :AssetHost, "middleman/extensions/asset_host"
125
78
 
126
79
  # CacheBuster adds a query string to assets in dynamic templates to avoid
127
80
  # browser caches failing to update to your new content.
128
- autoload :CacheBuster, "middleman/features/cache_buster"
81
+ autoload :CacheBuster, "middleman/extensions/cache_buster"
129
82
 
130
83
  # AutomaticImageSizes inspects the images used in your dynamic templates
131
84
  # and automatically adds width and height attributes to their HTML
132
85
  # elements.
133
- autoload :AutomaticImageSizes, "middleman/features/automatic_image_sizes"
86
+ autoload :AutomaticImageSizes, "middleman/extensions/automatic_image_sizes"
134
87
 
135
88
  # MinifyCss uses the YUI compressor to shrink CSS files
136
- autoload :MinifyCss, "middleman/features/minify_css"
89
+ autoload :MinifyCss, "middleman/extensions/minify_css"
137
90
 
138
91
  # MinifyJavascript uses the YUI compressor to shrink JS files
139
- autoload :MinifyJavascript, "middleman/features/minify_javascript"
92
+ autoload :MinifyJavascript, "middleman/extensions/minify_javascript"
140
93
 
141
94
  # Lorem provides a handful of helpful prototyping methods to generate
142
95
  # words, paragraphs, fake images, names and email addresses.
143
- autoload :Lorem, "middleman/features/lorem"
96
+ autoload :Lorem, "middleman/extensions/lorem"
144
97
 
145
98
  # Automatically convert filename.html files into filename/index.html
146
- autoload :DirectoryIndexes, "middleman/features/directory_indexes"
99
+ autoload :DirectoryIndexes, "middleman/extensions/directory_indexes"
147
100
 
148
101
  # Organize the sitemap as a tree
149
- autoload :SitemapTree, "middleman/features/sitemap_tree"
102
+ autoload :SitemapTree, "middleman/extensions/sitemap_tree"
150
103
  end
151
104
 
152
- EXTENSION_FILE = File.join("lib", "middleman_init.rb")
153
- def self.load_extensions_in_path
154
- extensions = rubygems_latest_specs.select do |spec|
155
- spec_has_file?(spec, EXTENSION_FILE)
156
- end
105
+ # Where to look in gems for extensions to auto-register
106
+ EXTENSION_FILE = File.join("lib", "middleman_extension.rb")
107
+
108
+ class << self
109
+
110
+ # Automatically load extensions from available RubyGems
111
+ # which contain the EXTENSION_FILE
112
+ #
113
+ # @private
114
+ def load_extensions_in_path
115
+ extensions = rubygems_latest_specs.select do |spec|
116
+ spec_has_file?(spec, EXTENSION_FILE)
117
+ end
157
118
 
158
- extensions.each do |spec|
159
- require spec.name
160
- # $stderr.puts "require: #{spec.name}"
119
+ extensions.each do |spec|
120
+ require spec.name
121
+ end
161
122
  end
162
- end
163
123
 
164
- def self.rubygems_latest_specs
165
- # If newer Rubygems
166
- if ::Gem::Specification.respond_to? :latest_specs
167
- ::Gem::Specification.latest_specs
168
- else
169
- ::Gem.source_index.latest_specs
124
+ # Backwards compatible means of finding all the latest gemspecs
125
+ # available on the system
126
+ #
127
+ # @private
128
+ # @return [Array] Array of latest Gem::Specification
129
+ def rubygems_latest_specs
130
+ # If newer Rubygems
131
+ if ::Gem::Specification.respond_to? :latest_specs
132
+ ::Gem::Specification.latest_specs
133
+ else
134
+ ::Gem.source_index.latest_specs
135
+ end
170
136
  end
171
- end
172
137
 
173
- def self.spec_has_file?(spec, path)
174
- full_path = File.join(spec.full_gem_path, path)
175
- File.exists?(full_path)
176
- end
138
+ # Where a given Gem::Specification has a specific file. Used
139
+ # to discover extensions and Sprockets-supporting gems.
140
+ #
141
+ # @private
142
+ # @param [Gem::Specification]
143
+ # @param [String] Path to look for
144
+ # @return [Boolean] Whether the file exists
145
+ def spec_has_file?(spec, path)
146
+ full_path = File.join(spec.full_gem_path, path)
147
+ File.exists?(full_path)
148
+ end
177
149
 
178
- def self.server(&block)
179
- sandbox = Class.new(Middleman::Base)
180
- # sandbox.class_eval(&block) if block_given?
181
- sandbox
182
- end
150
+ # Create a new Class which is based on Middleman::Base
151
+ # Used to create a safe sandbox into which extensions and
152
+ # configuration can be included later without impacting
153
+ # other classes and instances.
154
+ #
155
+ # @return [Class]
156
+ def server(&block)
157
+ Class.new(Middleman::Base)
158
+ end
183
159
 
184
- def self.start_server(options={})
185
- opts = {
186
- :Port => options[:port] || 4567,
187
- :AccessLog => []
188
- }
160
+ # Creates a new Rack::Server
161
+ #
162
+ # @param [Hash] options to pass to Rack::Server.new
163
+ # @return [Rack::Server]
164
+ def start_server(options={})
165
+ opts = {
166
+ :Port => options[:port] || 4567,
167
+ :Host => options[:host] || "0.0.0.0",
168
+ :AccessLog => []
169
+ }
189
170
 
190
- app_class = options[:app] ||= ::Middleman.server.new
191
- opts[:app] = app_class
192
- opts[:server] = 'thin'
171
+ app_class = options[:app] ||= ::Middleman.server.inst
172
+ opts[:app] = app_class
173
+ opts[:server] = 'thin'
193
174
 
194
- # require "thin"
195
- # ::Thin::Logging.silent = true if options[:debug] != "true"
175
+ # require "thin"
176
+ # ::Thin::Logging.silent = true if options[:debug] != "true"
196
177
 
197
- server = ::Rack::Server.new(opts)
198
- server.start
199
- server
178
+ server = ::Rack::Server.new(opts)
179
+ server.start
180
+ server
181
+ end
200
182
  end
201
183
  end
202
184
 
185
+ # Make the VERSION string available
203
186
  require "middleman/version"
187
+
188
+ # Automatically discover extensions in RubyGems
204
189
  Middleman.load_extensions_in_path