middleman-alias 0.0.1 → 0.0.2
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/README.md +4 -1
- data/lib/middleman-alias/extension.rb +3 -3
- data/lib/middleman-alias/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 976b044b36b93a17d309632702866564f337eb3b
|
|
4
|
+
data.tar.gz: 7949793d4d39d83f1730499d99128935e7d605bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67d07bfdf091e0b6419e212b89560b5d823fad2ff50873f2397ecac270f62bd9e19bc5130131684a70e78bdf794cd1f26655a8cb28d45c3725847a54f16e9c70
|
|
7
|
+
data.tar.gz: 7eb6ffe0fac252d1e6ec76dd14081f121e31a2e8bab3bedaa4a453a9cdb99c5f248ff7608e2cbb3fc506843dfa12479488a0ee5a698e75889c52ce4cbcc54202
|
data/README.md
CHANGED
|
@@ -18,7 +18,10 @@ Or install it yourself as:
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
First you need to activate the module in your `config.rb`.
|
|
21
|
+
First you need to activate the module in your `config.rb`. *Make sure
|
|
22
|
+
that it is the LAST thing activated.* It's important that other modules
|
|
23
|
+
have the opportunity to do their own URL manipulations before the
|
|
24
|
+
alias redirect pages are generated.
|
|
22
25
|
|
|
23
26
|
```
|
|
24
27
|
activate :alias
|
|
@@ -9,13 +9,13 @@ module Middleman
|
|
|
9
9
|
def manipulate_resource_list(resources)
|
|
10
10
|
resources.each do |resource|
|
|
11
11
|
if resource.data["alias"]
|
|
12
|
-
|
|
12
|
+
Sitemap::Resource.new(@app.sitemap, resource.data["alias"]).tap do |p|
|
|
13
13
|
p.proxy_to("alias.html")
|
|
14
14
|
p.add_metadata locals: {
|
|
15
|
-
destination: resource.
|
|
15
|
+
destination: resource.url
|
|
16
16
|
}
|
|
17
|
+
resources.push p
|
|
17
18
|
end
|
|
18
|
-
resources.push redirect
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
resources
|