Created
November 22, 2013 19:42
-
-
Save LightGuard/7605639 to your computer and use it in GitHub Desktop.
Trying to fix the breadcrumb helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/_ext/breadcrumb.rb b/_ext/breadcrumb.rb | |
index 410c2dd..71dc4e5 100644 | |
--- a/_ext/breadcrumb.rb | |
+++ b/_ext/breadcrumb.rb | |
@@ -56,13 +56,11 @@ module Awestruct | |
def findInPages(path) | |
- | |
- for page in site.pages | |
- if page.output_path.eql?(path) | |
- return page | |
- end | |
+ if site.page_map.nil? | |
+ site.send("page_map=", Hash[site.pages.map { |p| [p.output_path, p]}.flatten.each_slice(2).to_a]) | |
end | |
- nil | |
+ | |
+ site.page_map[path] | |
end | |
def generateAnchorHtml( page , isLast ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment