middleman-core 3.3.2 → 3.3.3
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.
- checksums.yaml +4 -4
- data/features/helpers_select_tag.feature +6 -8
- data/lib/middleman-core.rb +1 -2
- data/lib/middleman-core/application.rb +10 -9
- data/lib/middleman-core/cli.rb +9 -13
- data/lib/middleman-core/cli/build.rb +26 -27
- data/lib/middleman-core/cli/bundler.rb +6 -7
- data/lib/middleman-core/cli/console.rb +10 -13
- data/lib/middleman-core/cli/extension.rb +2 -4
- data/lib/middleman-core/cli/init.rb +27 -28
- data/lib/middleman-core/cli/server.rb +43 -44
- data/lib/middleman-core/configuration.rb +13 -11
- data/lib/middleman-core/core_extensions/data.rb +21 -29
- data/lib/middleman-core/core_extensions/extensions.rb +8 -8
- data/lib/middleman-core/core_extensions/external_helpers.rb +3 -5
- data/lib/middleman-core/core_extensions/file_watcher.rb +7 -11
- data/lib/middleman-core/core_extensions/front_matter.rb +5 -6
- data/lib/middleman-core/core_extensions/rendering.rb +40 -30
- data/lib/middleman-core/core_extensions/request.rb +16 -19
- data/lib/middleman-core/core_extensions/routing.rb +37 -36
- data/lib/middleman-core/core_extensions/show_exceptions.rb +1 -5
- data/lib/middleman-core/extension.rb +14 -16
- data/lib/middleman-core/extensions.rb +4 -6
- data/lib/middleman-core/load_paths.rb +3 -6
- data/lib/middleman-core/logger.rb +1 -3
- data/lib/middleman-core/meta_pages.rb +11 -11
- data/lib/middleman-core/meta_pages/config_setting.rb +4 -4
- data/lib/middleman-core/meta_pages/sitemap_resource.rb +2 -2
- data/lib/middleman-core/meta_pages/sitemap_tree.rb +4 -4
- data/lib/middleman-core/preview_server.rb +12 -11
- data/lib/middleman-core/profiling.rb +6 -8
- data/lib/middleman-core/renderers/asciidoc.rb +12 -13
- data/lib/middleman-core/renderers/coffee_script.rb +2 -4
- data/lib/middleman-core/renderers/erb.rb +3 -4
- data/lib/middleman-core/renderers/haml.rb +2 -4
- data/lib/middleman-core/renderers/kramdown.rb +3 -4
- data/lib/middleman-core/renderers/less.rb +3 -9
- data/lib/middleman-core/renderers/liquid.rb +4 -8
- data/lib/middleman-core/renderers/markdown.rb +7 -11
- data/lib/middleman-core/renderers/redcarpet.rb +14 -16
- data/lib/middleman-core/renderers/sass.rb +36 -15
- data/lib/middleman-core/renderers/slim.rb +7 -10
- data/lib/middleman-core/renderers/stylus.rb +2 -6
- data/lib/middleman-core/sitemap.rb +6 -13
- data/lib/middleman-core/sitemap/extensions/ignores.rb +4 -10
- data/lib/middleman-core/sitemap/extensions/on_disk.rb +3 -7
- data/lib/middleman-core/sitemap/extensions/proxies.rb +7 -12
- data/lib/middleman-core/sitemap/extensions/redirects.rb +7 -15
- data/lib/middleman-core/sitemap/extensions/request_endpoints.rb +7 -15
- data/lib/middleman-core/sitemap/extensions/traversal.rb +4 -7
- data/lib/middleman-core/sitemap/queryable.rb +22 -27
- data/lib/middleman-core/sitemap/resource.rb +13 -25
- data/lib/middleman-core/sitemap/store.rb +11 -15
- data/lib/middleman-core/templates.rb +9 -12
- data/lib/middleman-core/templates/default.rb +6 -7
- data/lib/middleman-core/templates/empty.rb +0 -1
- data/lib/middleman-core/templates/extension/Gemfile +1 -1
- data/lib/middleman-core/templates/extension/Rakefile +2 -2
- data/lib/middleman-core/templates/extension/lib/lib.rb +0 -1
- data/lib/middleman-core/templates/html5.rb +6 -7
- data/lib/middleman-core/templates/local.rb +1 -2
- data/lib/middleman-core/templates/mobile.rb +3 -4
- data/lib/middleman-core/templates/shared/config.ru +1 -1
- data/lib/middleman-core/util.rb +5 -6
- data/lib/middleman-core/version.rb +1 -1
- data/lib/middleman-more/core_extensions/compass.rb +0 -1
- data/lib/middleman-more/core_extensions/default_helpers.rb +25 -16
- data/lib/middleman-more/core_extensions/i18n.rb +24 -23
- data/lib/middleman-more/extensions/asset_hash.rb +4 -6
- data/lib/middleman-more/extensions/asset_host.rb +1 -1
- data/lib/middleman-more/extensions/automatic_alt_tags.rb +2 -3
- data/lib/middleman-more/extensions/automatic_image_sizes.rb +4 -5
- data/lib/middleman-more/extensions/cache_buster.rb +0 -1
- data/lib/middleman-more/extensions/gzip.rb +1 -1
- data/lib/middleman-more/extensions/lorem.rb +8 -8
- data/lib/middleman-more/extensions/minify_css.rb +9 -8
- data/lib/middleman-more/extensions/minify_javascript.rb +5 -6
- data/lib/middleman-more/extensions/relative_assets.rb +0 -1
- data/lib/middleman-more/templates/smacss.rb +6 -7
- data/middleman-core.gemspec +1 -1
- metadata +5 -5
|
@@ -2,7 +2,6 @@ require 'active_support/core_ext/object/inclusion'
|
|
|
2
2
|
|
|
3
3
|
module Middleman
|
|
4
4
|
module Sitemap
|
|
5
|
-
|
|
6
5
|
# Code adapted from https://github.com/ralph/document_mapper/
|
|
7
6
|
module Queryable
|
|
8
7
|
OPERATOR_MAPPING = {
|
|
@@ -21,11 +20,11 @@ module Middleman
|
|
|
21
20
|
OperatorNotSupportedError = Class.new StandardError
|
|
22
21
|
|
|
23
22
|
module API
|
|
24
|
-
def select(options
|
|
23
|
+
def select(options={})
|
|
25
24
|
documents = resources.select { |r| !r.raw_data.empty? }
|
|
26
25
|
options[:where].each do |selector, selector_value|
|
|
27
26
|
documents = documents.select do |document|
|
|
28
|
-
next unless document.raw_data.
|
|
27
|
+
next unless document.raw_data.key? selector.attribute
|
|
29
28
|
document_value = document.raw_data[selector.attribute]
|
|
30
29
|
operator = OPERATOR_MAPPING[selector.operator]
|
|
31
30
|
document_value.send operator, selector_value
|
|
@@ -74,51 +73,47 @@ module Middleman
|
|
|
74
73
|
end
|
|
75
74
|
|
|
76
75
|
def where(constraints_hash)
|
|
77
|
-
selector_hash = constraints_hash.reject { |key,
|
|
78
|
-
symbol_hash = constraints_hash.reject { |key,
|
|
76
|
+
selector_hash = constraints_hash.reject { |key, _| !key.is_a? Selector }
|
|
77
|
+
symbol_hash = constraints_hash.reject { |key, _| key.is_a? Selector }
|
|
79
78
|
symbol_hash.each do |attribute, value|
|
|
80
|
-
selector = Selector.new(:
|
|
81
|
-
selector_hash.update(
|
|
79
|
+
selector = Selector.new(attribute: attribute, operator: 'equal')
|
|
80
|
+
selector_hash.update(selector => value)
|
|
82
81
|
end
|
|
83
|
-
Query.new @model, opts(:
|
|
82
|
+
Query.new @model, opts(where: @where.merge(selector_hash))
|
|
84
83
|
end
|
|
85
84
|
|
|
86
|
-
def opts
|
|
87
|
-
{ :
|
|
88
|
-
:
|
|
89
|
-
:
|
|
90
|
-
:
|
|
85
|
+
def opts(new_opts)
|
|
86
|
+
{ where: {}.merge(@where),
|
|
87
|
+
order_by: @order_by,
|
|
88
|
+
offset: @offset,
|
|
89
|
+
limit: @limit
|
|
91
90
|
}.merge(new_opts)
|
|
92
91
|
end
|
|
93
92
|
|
|
94
93
|
def order_by(field)
|
|
95
|
-
Query.new @model, opts(:
|
|
94
|
+
Query.new @model, opts(order_by: field.is_a?(Symbol) ? { field => :asc } : field)
|
|
96
95
|
end
|
|
97
96
|
|
|
98
97
|
def offset(number)
|
|
99
|
-
Query.new @model, opts(:
|
|
98
|
+
Query.new @model, opts(offset: number)
|
|
100
99
|
end
|
|
101
100
|
|
|
102
101
|
def limit(number)
|
|
103
|
-
Query.new @model, opts(:
|
|
102
|
+
Query.new @model, opts(limit: number)
|
|
104
103
|
end
|
|
105
104
|
|
|
106
105
|
def first
|
|
107
|
-
|
|
106
|
+
all.first
|
|
108
107
|
end
|
|
109
108
|
|
|
110
109
|
def last
|
|
111
|
-
|
|
110
|
+
all.last
|
|
112
111
|
end
|
|
113
112
|
|
|
114
113
|
def all
|
|
115
|
-
result = @model.select(:
|
|
116
|
-
if @offset.present?
|
|
117
|
-
|
|
118
|
-
end
|
|
119
|
-
if @limit.present?
|
|
120
|
-
result = result.first(@limit)
|
|
121
|
-
end
|
|
114
|
+
result = @model.select(where: @where, order_by: @order_by)
|
|
115
|
+
result = result.last([result.size - @offset, 0].max) if @offset.present?
|
|
116
|
+
result = result.first(@limit) if @limit.present?
|
|
122
117
|
result
|
|
123
118
|
end
|
|
124
119
|
end
|
|
@@ -126,7 +121,7 @@ module Middleman
|
|
|
126
121
|
class Selector
|
|
127
122
|
attr_reader :attribute, :operator
|
|
128
123
|
|
|
129
|
-
def initialize(opts
|
|
124
|
+
def initialize(opts={})
|
|
130
125
|
unless VALID_OPERATORS.include? opts[:operator]
|
|
131
126
|
raise OperatorNotSupportedError
|
|
132
127
|
end
|
|
@@ -149,7 +144,7 @@ class Symbol
|
|
|
149
144
|
|
|
150
145
|
unless method_defined?(:"<=>")
|
|
151
146
|
def <=>(other)
|
|
152
|
-
|
|
147
|
+
to_s <=> other.to_s
|
|
153
148
|
end
|
|
154
149
|
end
|
|
155
150
|
end
|
|
@@ -2,10 +2,8 @@ require 'middleman-core/sitemap/extensions/traversal'
|
|
|
2
2
|
require 'middleman-core/sitemap/extensions/content_type'
|
|
3
3
|
|
|
4
4
|
module Middleman
|
|
5
|
-
|
|
6
5
|
# Sitemap namespace
|
|
7
6
|
module Sitemap
|
|
8
|
-
|
|
9
7
|
# Sitemap Resource class
|
|
10
8
|
class Resource
|
|
11
9
|
include Middleman::Sitemap::Extensions::Traversal
|
|
@@ -13,7 +11,7 @@ module Middleman
|
|
|
13
11
|
|
|
14
12
|
# @return [Middleman::Application]
|
|
15
13
|
attr_reader :app
|
|
16
|
-
delegate :logger, :instrument, :
|
|
14
|
+
delegate :logger, :instrument, to: :app
|
|
17
15
|
|
|
18
16
|
# @return [Middleman::Sitemap::Store]
|
|
19
17
|
attr_reader :store
|
|
@@ -46,7 +44,7 @@ module Middleman
|
|
|
46
44
|
@source_file = source_file
|
|
47
45
|
@destination_path = @path
|
|
48
46
|
|
|
49
|
-
@local_metadata = { :
|
|
47
|
+
@local_metadata = { options: {}, locals: {}, page: {}, blocks: [] }
|
|
50
48
|
end
|
|
51
49
|
|
|
52
50
|
# Whether this resource has a template file
|
|
@@ -62,15 +60,11 @@ module Middleman
|
|
|
62
60
|
result = store.metadata_for_path(path).dup
|
|
63
61
|
|
|
64
62
|
file_meta = store.metadata_for_file(source_file).dup
|
|
65
|
-
if file_meta.
|
|
66
|
-
result[:blocks] += file_meta.delete(:blocks)
|
|
67
|
-
end
|
|
63
|
+
result[:blocks] += file_meta.delete(:blocks) if file_meta.key?(:blocks)
|
|
68
64
|
result.deep_merge!(file_meta)
|
|
69
65
|
|
|
70
66
|
local_meta = @local_metadata.dup
|
|
71
|
-
if local_meta.
|
|
72
|
-
result[:blocks] += local_meta.delete(:blocks)
|
|
73
|
-
end
|
|
67
|
+
result[:blocks] += local_meta.delete(:blocks) if local_meta.key?(:blocks)
|
|
74
68
|
result.deep_merge!(local_meta)
|
|
75
69
|
|
|
76
70
|
result[:blocks] = result[:blocks].flatten.compact
|
|
@@ -81,11 +75,9 @@ module Middleman
|
|
|
81
75
|
# @param [Hash] metadata A metadata block like provides_metadata_for_path takes
|
|
82
76
|
def add_metadata(metadata={}, &block)
|
|
83
77
|
metadata = metadata.dup
|
|
84
|
-
if metadata.
|
|
85
|
-
@local_metadata[:blocks] += metadata.delete(:blocks)
|
|
86
|
-
end
|
|
78
|
+
@local_metadata[:blocks] += metadata.delete(:blocks) if metadata.key?(:blocks)
|
|
87
79
|
@local_metadata.deep_merge!(metadata)
|
|
88
|
-
@local_metadata[:blocks] += [
|
|
80
|
+
@local_metadata[:blocks] += [block] if block_given?
|
|
89
81
|
end
|
|
90
82
|
|
|
91
83
|
# The output/preview URL for this resource
|
|
@@ -99,19 +91,17 @@ module Middleman
|
|
|
99
91
|
end
|
|
100
92
|
|
|
101
93
|
def request_path
|
|
102
|
-
|
|
94
|
+
destination_path
|
|
103
95
|
end
|
|
104
96
|
|
|
105
97
|
# Render this resource
|
|
106
98
|
# @return [String]
|
|
107
99
|
def render(opts={}, locs={}, &block)
|
|
108
|
-
|
|
109
|
-
return app.template_data_for_file(source_file)
|
|
110
|
-
end
|
|
100
|
+
return app.template_data_for_file(source_file) unless template?
|
|
111
101
|
|
|
112
102
|
relative_source = Pathname(source_file).relative_path_from(Pathname(app.root))
|
|
113
103
|
|
|
114
|
-
instrument 'render.resource', :
|
|
104
|
+
instrument 'render.resource', path: relative_source, destination_path: destination_path do
|
|
115
105
|
md = metadata.dup
|
|
116
106
|
opts = md[:options].deep_merge(opts)
|
|
117
107
|
|
|
@@ -126,18 +116,16 @@ module Middleman
|
|
|
126
116
|
locs = md[:locals].deep_merge(locs)
|
|
127
117
|
|
|
128
118
|
# Forward remaining data to helpers
|
|
129
|
-
if md.
|
|
130
|
-
app.data.store('page', md[:page])
|
|
131
|
-
end
|
|
119
|
+
app.data.store('page', md[:page]) if md.key?(:page)
|
|
132
120
|
|
|
133
121
|
blocks = Array(md[:blocks]).dup
|
|
134
122
|
blocks << block if block_given?
|
|
135
123
|
|
|
136
|
-
app.current_path ||=
|
|
124
|
+
app.current_path ||= destination_path
|
|
137
125
|
|
|
138
126
|
# Certain output file types don't use layouts
|
|
139
|
-
|
|
140
|
-
opts[:layout] = false if %w(.js .json .css .txt).include?(
|
|
127
|
+
unless opts.key?(:layout)
|
|
128
|
+
opts[:layout] = false if %w(.js .json .css .txt).include?(ext)
|
|
141
129
|
end
|
|
142
130
|
|
|
143
131
|
app.render_template(source_file, locs, opts, blocks)
|
|
@@ -4,10 +4,8 @@ require 'monitor'
|
|
|
4
4
|
require 'middleman-core/sitemap/queryable'
|
|
5
5
|
|
|
6
6
|
module Middleman
|
|
7
|
-
|
|
8
7
|
# Sitemap namespace
|
|
9
8
|
module Sitemap
|
|
10
|
-
|
|
11
9
|
# The Store class
|
|
12
10
|
#
|
|
13
11
|
# The Store manages a collection of Resource objects, which represent
|
|
@@ -15,7 +13,6 @@ module Middleman
|
|
|
15
13
|
# which is the path relative to the source directory, minus any template
|
|
16
14
|
# extensions. All "path" parameters used in this class are source paths.
|
|
17
15
|
class Store
|
|
18
|
-
|
|
19
16
|
# @return [Middleman::Application]
|
|
20
17
|
attr_accessor :app
|
|
21
18
|
|
|
@@ -52,12 +49,13 @@ module Middleman
|
|
|
52
49
|
# @param [Symbol] name Name of the manipulator for debugging
|
|
53
50
|
# @param [Class, Module] inst Abstract namespace which can update the resource list
|
|
54
51
|
# @return [void]
|
|
55
|
-
def register_resource_list_manipulator(name, inst,
|
|
52
|
+
def register_resource_list_manipulator(name, inst, *)
|
|
56
53
|
@resource_list_manipulators << [name, inst]
|
|
57
54
|
rebuild_resource_list!(:registered_new)
|
|
58
55
|
end
|
|
59
56
|
|
|
60
57
|
# Rebuild the list of resources from scratch, using registed manipulators
|
|
58
|
+
# rubocop:disable UnusedMethodArgument
|
|
61
59
|
# @return [void]
|
|
62
60
|
def rebuild_resource_list!(reason=nil)
|
|
63
61
|
@lock.synchronize do
|
|
@@ -120,14 +118,14 @@ module Middleman
|
|
|
120
118
|
# @param [String] source_file
|
|
121
119
|
# @return [Hash]
|
|
122
120
|
def metadata_for_file(source_file)
|
|
123
|
-
blank_metadata = { :
|
|
121
|
+
blank_metadata = { options: {}, locals: {}, page: {}, blocks: [] }
|
|
124
122
|
|
|
125
|
-
provides_metadata.
|
|
123
|
+
provides_metadata.reduce(blank_metadata) do |result, (callback, matcher)|
|
|
126
124
|
next result if matcher && !source_file.match(matcher)
|
|
127
125
|
|
|
128
126
|
metadata = callback.call(source_file).dup
|
|
129
127
|
|
|
130
|
-
if metadata.
|
|
128
|
+
if metadata.key?(:blocks)
|
|
131
129
|
result[:blocks] << metadata[:blocks]
|
|
132
130
|
metadata.delete(:blocks)
|
|
133
131
|
end
|
|
@@ -154,9 +152,9 @@ module Middleman
|
|
|
154
152
|
def metadata_for_path(request_path)
|
|
155
153
|
return @_cached_metadata[request_path] if @_cached_metadata[request_path]
|
|
156
154
|
|
|
157
|
-
blank_metadata = { :
|
|
155
|
+
blank_metadata = { options: {}, locals: {}, page: {}, blocks: [] }
|
|
158
156
|
|
|
159
|
-
@_cached_metadata[request_path] = provides_metadata_for_path.
|
|
157
|
+
@_cached_metadata[request_path] = provides_metadata_for_path.reduce(blank_metadata) do |result, (callback, matcher)|
|
|
160
158
|
case matcher
|
|
161
159
|
when Regexp
|
|
162
160
|
next result unless request_path =~ matcher
|
|
@@ -213,7 +211,7 @@ module Middleman
|
|
|
213
211
|
|
|
214
212
|
@app.logger.debug '== Rebuilding resource list'
|
|
215
213
|
|
|
216
|
-
@resources = @resource_list_manipulators.
|
|
214
|
+
@resources = @resource_list_manipulators.reduce([]) do |result, (_, inst)|
|
|
217
215
|
newres = inst.manipulate_resource_list(result)
|
|
218
216
|
|
|
219
217
|
# Reset lookup cache
|
|
@@ -255,9 +253,7 @@ module Middleman
|
|
|
255
253
|
if @app.respond_to? :langs
|
|
256
254
|
path_bits = path.split('.')
|
|
257
255
|
lang = path_bits.last
|
|
258
|
-
if @app.langs.include?(lang.to_sym)
|
|
259
|
-
return path_bits[0..-2].join('.')
|
|
260
|
-
end
|
|
256
|
+
return path_bits[0..-2].join('.') if @app.langs.include?(lang.to_sym)
|
|
261
257
|
end
|
|
262
258
|
|
|
263
259
|
path
|
|
@@ -269,9 +265,9 @@ module Middleman
|
|
|
269
265
|
def find_extension(path, file)
|
|
270
266
|
input_ext = File.extname(file)
|
|
271
267
|
|
|
272
|
-
|
|
268
|
+
unless input_ext.empty?
|
|
273
269
|
input_ext = input_ext.split('.').last.to_sym
|
|
274
|
-
if @app.template_extensions.
|
|
270
|
+
if @app.template_extensions.key?(input_ext)
|
|
275
271
|
path << ".#{@app.template_extensions[input_ext]}"
|
|
276
272
|
end
|
|
277
273
|
end
|
|
@@ -4,10 +4,8 @@ require 'thor/group'
|
|
|
4
4
|
|
|
5
5
|
# Templates namespace
|
|
6
6
|
module Middleman::Templates
|
|
7
|
-
|
|
8
7
|
# Static methods
|
|
9
8
|
class << self
|
|
10
|
-
|
|
11
9
|
# Get list of registered templates and add new ones
|
|
12
10
|
#
|
|
13
11
|
# Middleman::Templates.register(:ext_name, klass)
|
|
@@ -22,7 +20,7 @@ module Middleman::Templates
|
|
|
22
20
|
end
|
|
23
21
|
|
|
24
22
|
# Middleman::Templates.register(name, klass)
|
|
25
|
-
|
|
23
|
+
alias_method :registered, :register
|
|
26
24
|
end
|
|
27
25
|
|
|
28
26
|
# Base Template class. Handles basic options and paths.
|
|
@@ -41,13 +39,13 @@ module Middleman::Templates
|
|
|
41
39
|
end
|
|
42
40
|
|
|
43
41
|
# Required path for the new project to be generated
|
|
44
|
-
argument :location, :
|
|
42
|
+
argument :location, type: :string
|
|
45
43
|
|
|
46
44
|
# Name of the template being used to generate the project.
|
|
47
|
-
class_option :template, :
|
|
45
|
+
class_option :template, default: 'default'
|
|
48
46
|
|
|
49
47
|
# Output a config.ru file for Rack if --rack is passed
|
|
50
|
-
class_option :rack, :
|
|
48
|
+
class_option :rack, type: :boolean, default: false
|
|
51
49
|
|
|
52
50
|
# Write a Rack config.ru file for project
|
|
53
51
|
# @return [void]
|
|
@@ -56,8 +54,8 @@ module Middleman::Templates
|
|
|
56
54
|
template 'shared/config.ru', File.join(location, 'config.ru')
|
|
57
55
|
end
|
|
58
56
|
|
|
59
|
-
class_option :'skip-bundle', :
|
|
60
|
-
class_option :'skip-gemfile', :
|
|
57
|
+
class_option :'skip-bundle', type: :boolean, default: false
|
|
58
|
+
class_option :'skip-gemfile', type: :boolean, default: false
|
|
61
59
|
|
|
62
60
|
# Write a Bundler Gemfile file for project
|
|
63
61
|
# @return [void]
|
|
@@ -72,7 +70,7 @@ module Middleman::Templates
|
|
|
72
70
|
end
|
|
73
71
|
|
|
74
72
|
# Output a .gitignore file
|
|
75
|
-
class_option :'skip-git', :
|
|
73
|
+
class_option :'skip-git', type: :boolean, default: false
|
|
76
74
|
|
|
77
75
|
# Write a .gitignore file for project
|
|
78
76
|
# @return [void]
|
|
@@ -96,9 +94,8 @@ require 'middleman-core/templates/mobile'
|
|
|
96
94
|
require 'middleman-more/templates/smacss'
|
|
97
95
|
|
|
98
96
|
# Local templates
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
end
|
|
97
|
+
# Sometimes HOME doesn't exist, in which case there's no point to local templates
|
|
98
|
+
require 'middleman-core/templates/local' if ENV['HOME']
|
|
102
99
|
|
|
103
100
|
# Barebones template
|
|
104
101
|
require 'middleman-core/templates/empty'
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# Default Middleman template
|
|
2
2
|
class Middleman::Templates::Default < Middleman::Templates::Base
|
|
3
|
-
|
|
4
3
|
class_option 'css_dir',
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
default: 'stylesheets',
|
|
5
|
+
desc: 'The path to the css files'
|
|
7
6
|
class_option 'js_dir',
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
default: 'javascripts',
|
|
8
|
+
desc: 'The path to the javascript files'
|
|
10
9
|
class_option 'images_dir',
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
default: 'images',
|
|
11
|
+
desc: 'The path to the image files'
|
|
13
12
|
|
|
14
13
|
# Template files are relative to this file
|
|
15
14
|
# @return [String]
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# HTML5 Boilerplate template
|
|
2
2
|
class Middleman::Templates::Html5 < Middleman::Templates::Base
|
|
3
|
-
|
|
4
3
|
class_option 'css_dir',
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
default: 'css',
|
|
5
|
+
desc: 'The path to the css files'
|
|
7
6
|
class_option 'js_dir',
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
default: 'js',
|
|
8
|
+
desc: 'The path to the javascript files'
|
|
10
9
|
class_option 'images_dir',
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
default: 'img',
|
|
11
|
+
desc: 'The path to the image files'
|
|
13
12
|
|
|
14
13
|
# Templates are relative to this file
|
|
15
14
|
# @return [String]
|