middleman-alias 0.0.7 → 0.0.8
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f99840444373ee02564cfb50610f11920273b8c9
|
4
|
+
data.tar.gz: a234d966d34650a0954de7e087ce590241fb9017
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4607577262b995a32bb5dcf0d3b42a0739ffa836f590a1216cc82f1a649e43cf767399174095eaa5af3f8c53f252a1347fc189adf4f13f78d02c18a21d31265e
|
7
|
+
data.tar.gz: 617bbfeceaa6756fca69158cc7bada55191eb82e842c2bca20e9324dd676d57f99dfbfcda1a5d74967cce1b0280dc6d2454388fe66f8982798a7c0c8bb541fc9
|
data/features/alias.feature
CHANGED
@@ -3,3 +3,10 @@ Feature: Aliases
|
|
3
3
|
Given the Server is running at "alias-app"
|
4
4
|
When I go to "/foo.html"
|
5
5
|
Then I should see "You are being redirected"
|
6
|
+
|
7
|
+
Scenario: Aliases should should not over-write existing routes
|
8
|
+
Given the Server is running at "alias-app"
|
9
|
+
When I go to "/double-foo.html"
|
10
|
+
Then I should not see "You are being redirected"
|
11
|
+
Then I should see "This is a page about double foo."
|
12
|
+
|
@@ -12,6 +12,9 @@ module Middleman
|
|
12
12
|
if resource.data["alias"]
|
13
13
|
alias_url = resource.data["alias"]
|
14
14
|
alias_url += "index.html" if alias_url.match(/\/$/)
|
15
|
+
existing_resource = resources.select{|r| r.destination_path == alias_url }.first
|
16
|
+
next if existing_resource
|
17
|
+
|
15
18
|
resources.push Middleman::Sitemap::AliasResource.new(@app.sitemap, alias_url, resource.url)
|
16
19
|
#Sitemap::Resource.new(@app.sitemap, alias_url).tap do |p|
|
17
20
|
#p.proxy_to("alias.html")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-alias
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Green
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- features/virtual-directory.feature
|
98
98
|
- fixtures/alias-app/config.rb
|
99
99
|
- fixtures/alias-app/source/bar.html.erb
|
100
|
+
- fixtures/alias-app/source/double-foo.html.erb
|
100
101
|
- fixtures/alias-app/source/layout.html.erb
|
101
102
|
- fixtures/alias-app/source/virtual.html.erb
|
102
103
|
- fixtures/empty-alias-app/config.rb
|