Breadcrumb trails.

This commit is contained in:
Chris Eppstein 2010-01-24 16:06:34 -08:00
parent 3b88df6bbe
commit 5491a7702b
8 changed files with 21 additions and 1 deletions

View File

@ -1,5 +1,7 @@
%h1= item[:title] %h1= item[:title]
= render "partials/breadcrumbs"
%p %p
The blueprint module is a simple way of importing all of the most The blueprint module is a simple way of importing all of the most
commonly used blueprint modules. In addition, it provides commonly used blueprint modules. In addition, it provides

View File

@ -1,5 +1,6 @@
--- ---
title: Blueprint Module title: Blueprint Module
crumb: Blueprint
framework: blueprint framework: blueprint
stylesheet: _blueprint.sass stylesheet: _blueprint.sass
classnames: classnames:

View File

@ -1,5 +1,7 @@
%h1= item[:title] %h1= item[:title]
= render "partials/breadcrumbs"
%p %p
The blueprint colors module defines the default colors that are used by the blueprint The blueprint colors module defines the default colors that are used by the blueprint
framework. framework.

View File

@ -1,5 +1,6 @@
--- ---
title: Blueprint Color Module title: Blueprint Color Module
crumb: Colors
framework: blueprint framework: blueprint
stylesheet: blueprint/_colors.sass stylesheet: blueprint/_colors.sass
classnames: classnames:

View File

@ -78,4 +78,10 @@ table.constants
td, th td, th
padding: 0.25em 0.5em padding: 0.25em 0.5em
ol#breadcrumbs
+horizontal-list
+no-bullets
li:after
content: " > "
li.last:after
content: ""

View File

@ -0,0 +1,6 @@
%ol#breadcrumbs
- breadcrumbs_trail.each_with_index do |bc, index|
- klass = "first" if index == 0
- klass = "last" if index == breadcrumbs_trail.size - 1
%li{:class => klass}= link_to_unless_current((bc[:crumb] || bc[:title]), bc.reps.find { |r| r.name == :default })

View File

@ -0,0 +1 @@
--- {}

View File

@ -4,6 +4,7 @@
include Nanoc3::Helpers::LinkTo include Nanoc3::Helpers::LinkTo
include Nanoc3::Helpers::Capturing include Nanoc3::Helpers::Capturing
include Nanoc3::Helpers::Rendering include Nanoc3::Helpers::Rendering
include Nanoc3::Helpers::Breadcrumbs
def body_class(item) def body_class(item)
(item[:classnames] || []).join(" ") (item[:classnames] || []).join(" ")