3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/textigniter/plugins/breadcrumbs.rb', line 3
def parse(h)
value = "#{h['breadcrumbs']}"
value.gsub!("#{$twd}/content/", '')
unless value == "index"
breadcrumbs = "<a href=\"#{$config['site_url']}\" class=\"home\">Home</a>"
values = value.split(/\//)
current = values.last
values.pop
values.each do |v|
breadcrumbs << " | <a href=\"#{$config['site_url']}/#{v}\">#{v}</a>"
end
breadcrumbs << " | <span class=\"current\">#{h['title']}</span>"
else
breadcrumbs = "Home"
end
return breadcrumbs
end
|