aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2013-04-05 18:32:36 +0300
committerMarin Ivanov <[email protected]>2013-04-05 18:32:36 +0300
commitc833c0a666d47147238eb013c4eaef4d389940ef (patch)
tree2c254a33881d6761863c0433974edffd65383271
parent5061f60b3f096f6f83a1ba27a5b2606430ae1453 (diff)
Added matching by post/page title
-rw-r--r--wikilinks.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/wikilinks.rb b/wikilinks.rb
index e8f9cad..ac5c894 100644
--- a/wikilinks.rb
+++ b/wikilinks.rb
@@ -18,7 +18,7 @@ module Jekyll
def title
if @title.nil?
if not @match.nil?
- match_title
+ match_title @match
else
@name
end
@@ -27,9 +27,9 @@ module Jekyll
end
end
- def match_title
- if not @match.data.nil? and @match.data.include? 'title'
- @match.data['title']
+ def match_title(m)
+ if not m.data.nil? and m.data.include? 'title'
+ m.data['title']
end
end
@@ -42,11 +42,11 @@ module Jekyll
end
def match_post(posts)
- @match = posts.find { |p| p.slug.downcase == @name.downcase }
+ @match = posts.find { |p| p.slug.downcase == @name.downcase or match_title(p) == name }
end
def match_page(pages)
- @match = pages.find { |p| p.basename.downcase == @name.downcase }
+ @match = pages.find { |p| p.basename.downcase == @name.downcase or match_title(p) == name }
end
def markdown