blob: 2b4eda74b4cb9b506b3703c5e2f3e9247c5ddd8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# coding: utf-8
module SiteUtil
def self.html_escape(html)
html
.gsub('&', '&')
.gsub('>', '>')
.gsub('<', '<')
end
def self.breadcrumbs(url)
# TODO
bc = []
u = url.path
u = "/" if u == ""
while u != "/"
bc.unshift("<a href=\"#{u}\">#{File::basename(u, File::extname(u))}</a>")
u = File::dirname(u)
end
bc.unshift("<a href=\"/\">Andrew D. Murrell</a>")
return bc.join(' » ')
end
end
|