blob: 075ebb8105a3515ae1fbb49789a7993ed5b49141 (
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 Util
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
|