middleman-targets 1.0.12 → 1.0.13
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/documentation_project/config.rb +1 -1
- data/lib/middleman-targets/extension.rb +21 -4
- data/lib/middleman-targets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9dac61ef46f8718f9048a416f5b2b2f94c1a609
|
4
|
+
data.tar.gz: 6c54d519c2966b012339ab7164cd8d63d49457a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57d35e792099d180d7103b55fa27060dfcb9e197370fe4b18cacd003cbba691c57a1743807d97e7f8f010d4b974082210c511fbf16f5353259877903ccc0a781
|
7
|
+
data.tar.gz: c597317043df3192021c94ad65edeb6e5f4e97ad954ad41c4c66fdae8e48faa802c92a82fd45ed7b3f324d9a3ad1dc1f5518002bef2f5f1e96ce8abca76458b5
|
@@ -31,16 +31,17 @@ class MiddlemanTargets < ::Middleman::Extension
|
|
31
31
|
|
32
32
|
# @!attribute [rw] config[:targets]=
|
33
33
|
# A hash that defines all of the characteristics of your individual targets.
|
34
|
-
# The `build_dir
|
35
|
-
# other keys can be added arbitrarily and helpers can fetch these
|
36
|
-
# A best practice is to assign the same features to _all_ of your
|
37
|
-
# toggle them `on` or `off` on a target-specific basis.
|
34
|
+
# The `build_dir`, 'http_prefix', and `features` keys in a target have special
|
35
|
+
# meanings; other keys can be added arbitrarily and helpers can fetch these
|
36
|
+
# for you. A best practice is to assign the same features to _all_ of your
|
37
|
+
# targets and toggle them `on` or `off` on a target-specific basis.
|
38
38
|
# @example You might define this in your `config.rb` like this:
|
39
39
|
# config[:targets] = {
|
40
40
|
# :free =>
|
41
41
|
# {
|
42
42
|
# :sample_key => 'People who use free versions don\'t drive profits.',
|
43
43
|
# :build_dir => 'build (%s)',
|
44
|
+
# :http_prefix => '/free',
|
44
45
|
# :features =>
|
45
46
|
# {
|
46
47
|
# :feature_advertise_pro => true,
|
@@ -52,6 +53,7 @@ class MiddlemanTargets < ::Middleman::Extension
|
|
52
53
|
# :pro =>
|
53
54
|
# {
|
54
55
|
# :sample_key => 'You are a valued contributor to our balance sheet!',
|
56
|
+
# :http_prefix => '/pro',
|
55
57
|
# :features =>
|
56
58
|
# {
|
57
59
|
# :feature_advertise_pro => false,
|
@@ -98,6 +100,16 @@ class MiddlemanTargets < ::Middleman::Extension
|
|
98
100
|
# @note This is a Middleman application level config option.
|
99
101
|
|
100
102
|
|
103
|
+
# @!attribute [rw] config[:http_prefix]=
|
104
|
+
# Default prefix for building paths. Used by HTML helpers.
|
105
|
+
#
|
106
|
+
# If the `http_prefix` key is present for any of the `config[:targets]`,
|
107
|
+
# they will override this setting.
|
108
|
+
# @return [String] Indicate the HTTP prefix that will be used by
|
109
|
+
# HTML helpers.
|
110
|
+
# @note This is a Middleman application level config option.
|
111
|
+
|
112
|
+
|
101
113
|
# @!endgroup
|
102
114
|
|
103
115
|
|
@@ -146,6 +158,11 @@ class MiddlemanTargets < ::Middleman::Extension
|
|
146
158
|
else
|
147
159
|
say "Middleman will build using target \"#{requested_target}\".", :blue
|
148
160
|
say "Build directory is \"#{app.config[:build_dir]}\".", :blue
|
161
|
+
|
162
|
+
if (http_prefix = app.config[:targets][app.config[:target]][:http_prefix])
|
163
|
+
app.config[:http_prefix] = http_prefix
|
164
|
+
say "Using http_prefix \"#{app.config[:http_prefix]}\".", :blue
|
165
|
+
end
|
149
166
|
end
|
150
167
|
|
151
168
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-targets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Derry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|