2010-01-21 06:25:44 +00:00
|
|
|
# All files in the 'lib' directory will be loaded
|
|
|
|
# before nanoc starts compiling.
|
|
|
|
|
2010-01-21 19:54:47 +00:00
|
|
|
include Nanoc3::Helpers::LinkTo
|
2010-01-23 09:09:59 +00:00
|
|
|
include Nanoc3::Helpers::Capturing
|
|
|
|
include Nanoc3::Helpers::Rendering
|
2010-01-21 19:54:47 +00:00
|
|
|
|
|
|
|
def body_class(item)
|
|
|
|
(item[:classnames] || []).join(" ")
|
|
|
|
end
|
|
|
|
|
|
|
|
def body_id(item)
|
2010-01-22 19:41:08 +00:00
|
|
|
if id = item.identifier.chop[1..-1]
|
|
|
|
id.gsub(/\/|_/, "-")
|
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
2010-01-21 19:54:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def body_attributes(item)
|
|
|
|
{
|
|
|
|
:id => body_id(item),
|
|
|
|
:class => body_class(item)
|
|
|
|
}
|
|
|
|
end
|