diff --git a/middleman-core/features/page-id.feature b/middleman-core/features/page-id.feature index 74d08cb5..b67d7659 100644 --- a/middleman-core/features/page-id.feature +++ b/middleman-core/features/page-id.feature @@ -11,6 +11,7 @@ Feature: Page IDs And I should see 'URL5: Imp' And I should see 'URL6: Foldern' And I should see 'URL7: Feed' + And I should see "URL8: /fourty-two.html" When I go to "/fm.html" Then I should see "I am: frontmatter" @@ -45,9 +46,10 @@ Feature: Page IDs And I should see "URL2: /2.html" And I should see 'URL3: Hi' And I should see 'URL4: Sym' - And I should see 'URL8: Imp' - And I should see 'URL9: Foldern' - And I should see 'URL10: Feed' + And I should see "URL8: /fourty-two.html" + And I should see 'URL9: Imp' + And I should see 'URL10: Foldern' + And I should see 'URL11: Feed' When I go to "/fm.html" Then I should see "I am: frontmatter" diff --git a/middleman-core/fixtures/page-id-app/source/fourty-two.html.erb b/middleman-core/fixtures/page-id-app/source/fourty-two.html.erb new file mode 100644 index 00000000..62a13f25 --- /dev/null +++ b/middleman-core/fixtures/page-id-app/source/fourty-two.html.erb @@ -0,0 +1,5 @@ +--- +id: 42 +--- + +I am: <%= current_resource.page_id %> diff --git a/middleman-core/fixtures/page-id-app/source/index.html.erb b/middleman-core/fixtures/page-id-app/source/index.html.erb index 6060bc3f..071b22ef 100644 --- a/middleman-core/fixtures/page-id-app/source/index.html.erb +++ b/middleman-core/fixtures/page-id-app/source/index.html.erb @@ -7,8 +7,9 @@ URL4: <%= link_to "Sym", :"something-else" %> URL5: <%= link_to "Imp", :implicit %> URL6: <%= link_to "Foldern", "folder/foldern" %> URL7: <%= link_to "Feed", "feed.xml" %> +URL8: <%= url_for "42" %> <%# If custom proc %> -URL8: <%= link_to "Imp", "implicit.html-foo" %> -URL9: <%= link_to "Foldern", "folder/foldern.html-foo" %> -URL10: <%= link_to "Feed", "feed.xml-foo" %> +URL9: <%= link_to "Imp", "implicit.html-foo" %> +URL10: <%= link_to "Foldern", "folder/foldern.html-foo" %> +URL11: <%= link_to "Feed", "feed.xml-foo" %> diff --git a/middleman-core/fixtures/queryable-app/config.rb b/middleman-core/fixtures/queryable-app/config.rb deleted file mode 100644 index e69de29b..00000000 diff --git a/middleman-core/fixtures/queryable-app/source/2010-08-08-test-document-file.html.markdown b/middleman-core/fixtures/queryable-app/source/2010-08-08-test-document-file.html.markdown deleted file mode 100644 index 2fa1d6c5..00000000 --- a/middleman-core/fixtures/queryable-app/source/2010-08-08-test-document-file.html.markdown +++ /dev/null @@ -1,8 +0,0 @@ ---- -id: 1 -title: Some fancy title -tags: [ruby] -status: :published ---- - -I like being the demo text. diff --git a/middleman-core/fixtures/queryable-app/source/2010-08-09-another-test-document.html.markdown b/middleman-core/fixtures/queryable-app/source/2010-08-09-another-test-document.html.markdown deleted file mode 100644 index 91b89f46..00000000 --- a/middleman-core/fixtures/queryable-app/source/2010-08-09-another-test-document.html.markdown +++ /dev/null @@ -1,10 +0,0 @@ ---- -id: 2 -title: Another title, that's for sure -tags: [ruby, rails] -special_attribute: Yes! -friends: [Anton, Paul] -status: :published ---- - -The body copy. diff --git a/middleman-core/fixtures/queryable-app/source/2011-12-26-some-test-document.html.markdown b/middleman-core/fixtures/queryable-app/source/2011-12-26-some-test-document.html.markdown deleted file mode 100644 index 12f3060c..00000000 --- a/middleman-core/fixtures/queryable-app/source/2011-12-26-some-test-document.html.markdown +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: 5 -title: Some test document ---- - -This is just some test document. diff --git a/middleman-core/fixtures/queryable-app/source/document_with_date_in_yaml.html.markdown b/middleman-core/fixtures/queryable-app/source/document_with_date_in_yaml.html.markdown deleted file mode 100644 index bf608463..00000000 --- a/middleman-core/fixtures/queryable-app/source/document_with_date_in_yaml.html.markdown +++ /dev/null @@ -1,7 +0,0 @@ ---- -id: 3 -title: Document with date in YAML -date: 2011-04-05 ---- - -This document has no date in the filename, but in the YAML front matter. diff --git a/middleman-core/fixtures/queryable-app/source/document_without_date.html.markdown b/middleman-core/fixtures/queryable-app/source/document_without_date.html.markdown deleted file mode 100644 index 94e68a19..00000000 --- a/middleman-core/fixtures/queryable-app/source/document_without_date.html.markdown +++ /dev/null @@ -1,7 +0,0 @@ ---- -id: 4 -title: This document has no date -seldom_attribute: is seldom ---- - -This document has no date at all. diff --git a/middleman-core/lib/middleman-core/sitemap/store.rb b/middleman-core/lib/middleman-core/sitemap/store.rb index 25913c7e..56da14e6 100644 --- a/middleman-core/lib/middleman-core/sitemap/store.rb +++ b/middleman-core/lib/middleman-core/sitemap/store.rb @@ -163,7 +163,7 @@ module Middleman def find_resource_by_page_id(page_id) @lock.synchronize do ensure_resource_list_updated! - @_lookup_by_page_id[page_id.to_sym] + @_lookup_by_page_id[page_id.to_s.to_sym] end end @@ -249,7 +249,7 @@ module Middleman # since some proxy resources are looked up by path in order to # get their metadata and subsequently their page_id. @resources.each do |resource| - @_lookup_by_page_id[resource.page_id.to_sym] = resource + @_lookup_by_page_id[resource.page_id.to_s.to_sym] = resource end invalidate_resources_not_ignored_cache!