1
0
Fork 0
mirror of https://github.com/fmap/muflax65ngodyewp.onion synced 2024-07-03 11:00:42 +02:00
muflax65ngodyewp.onion/lib/default.rb
muflax 8ba3958797 * added explanation of epistemic states
* added basic techne/episteme to categories
* port categorie template to erb
2011-09-04 14:30:09 +02:00

53 lines
893 B
Ruby

# Helper functions for site-building.
include Nanoc3::Helpers::Breadcrumbs
include Nanoc3::Helpers::Rendering
class Nanoc3::Item
def add_content content
@raw_content += "\n\n#{content}"
end
def add_references refs
add_content refs
end
def name
identifier.split("/").last
end
end
def category name
render "category", :category => name
end
def techne status
case status
when :rough
"needs revisiting"
when :incomplete
"work in progress"
when :done
"finished"
else
status.to_s
end
end
def episteme status
s = case status
when :broken
"partly believed"
when :discredited
"not believed anymore"
else
status.to_s
end
"[#{s}][Epistemic State]{:.episteme}"
end
# only articles that actually get printed
def printed_items
@items.select { |i| not i[:is_hidden] and not i.binary? }
end