Class: Ichiban::HTMLFile
Instance Attribute Summary
Attributes inherited from ProjectFile
#abs, #rel
Instance Method Summary
collapse
Methods inherited from ProjectFile
#dest, from_abs, #has_dest?, #initialize, register_type, #rel_to, #replace_ext
Instance Method Details
#dest_rel_to_compiled ⇒ Object
68
69
70
71
|
# File 'lib/ichiban/project_file.rb', line 68
def dest_rel_to_compiled
d = @rel.slice('html/'.length..-1)
(d.end_with?('.markdown') or d.end_with?('.md')) ? replace_ext(d, 'html') : d
end
|
#web_path ⇒ Object
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'lib/ichiban/project_file.rb', line 77
def web_path
d = dest_rel_to_compiled
fname = File.basename(d, File.extname(d))
if fname == 'index'
'/' + File.dirname(d) + '/'
else
p = '/' + File.join(File.dirname(d), fname) + '/'
p.sub!('/./', '/') if p.start_with?('/./')
p
end
end
|