From 5491a7702b967c3b786520a9d838f41d4bd39314 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 24 Jan 2010 16:06:34 -0800 Subject: [PATCH] Breadcrumb trails. --- doc-src/content/reference/blueprint.haml | 2 ++ doc-src/content/reference/blueprint.yaml | 1 + doc-src/content/reference/blueprint/colors.haml | 2 ++ doc-src/content/reference/blueprint/colors.yaml | 1 + doc-src/content/stylesheets/main.sass | 8 +++++++- doc-src/layouts/partials/breadcrumbs.haml | 6 ++++++ doc-src/layouts/partials/breadcrumbs.yaml | 1 + doc-src/lib/default.rb | 1 + 8 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 doc-src/layouts/partials/breadcrumbs.haml create mode 100644 doc-src/layouts/partials/breadcrumbs.yaml diff --git a/doc-src/content/reference/blueprint.haml b/doc-src/content/reference/blueprint.haml index 1a1def6f..5ec71218 100644 --- a/doc-src/content/reference/blueprint.haml +++ b/doc-src/content/reference/blueprint.haml @@ -1,5 +1,7 @@ %h1= item[:title] += render "partials/breadcrumbs" + %p The blueprint module is a simple way of importing all of the most commonly used blueprint modules. In addition, it provides diff --git a/doc-src/content/reference/blueprint.yaml b/doc-src/content/reference/blueprint.yaml index ffc26779..58862e4d 100644 --- a/doc-src/content/reference/blueprint.yaml +++ b/doc-src/content/reference/blueprint.yaml @@ -1,5 +1,6 @@ --- title: Blueprint Module +crumb: Blueprint framework: blueprint stylesheet: _blueprint.sass classnames: diff --git a/doc-src/content/reference/blueprint/colors.haml b/doc-src/content/reference/blueprint/colors.haml index fb04fc6c..b75e7db4 100644 --- a/doc-src/content/reference/blueprint/colors.haml +++ b/doc-src/content/reference/blueprint/colors.haml @@ -1,5 +1,7 @@ %h1= item[:title] += render "partials/breadcrumbs" + %p The blueprint colors module defines the default colors that are used by the blueprint framework. diff --git a/doc-src/content/reference/blueprint/colors.yaml b/doc-src/content/reference/blueprint/colors.yaml index 6741d19d..6404943f 100644 --- a/doc-src/content/reference/blueprint/colors.yaml +++ b/doc-src/content/reference/blueprint/colors.yaml @@ -1,5 +1,6 @@ --- title: Blueprint Color Module +crumb: Colors framework: blueprint stylesheet: blueprint/_colors.sass classnames: diff --git a/doc-src/content/stylesheets/main.sass b/doc-src/content/stylesheets/main.sass index 198892a4..4a8b89dd 100644 --- a/doc-src/content/stylesheets/main.sass +++ b/doc-src/content/stylesheets/main.sass @@ -78,4 +78,10 @@ table.constants td, th padding: 0.25em 0.5em - \ No newline at end of file +ol#breadcrumbs + +horizontal-list + +no-bullets + li:after + content: " > " + li.last:after + content: "" \ No newline at end of file diff --git a/doc-src/layouts/partials/breadcrumbs.haml b/doc-src/layouts/partials/breadcrumbs.haml new file mode 100644 index 00000000..1c15bd6a --- /dev/null +++ b/doc-src/layouts/partials/breadcrumbs.haml @@ -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 }) + \ No newline at end of file diff --git a/doc-src/layouts/partials/breadcrumbs.yaml b/doc-src/layouts/partials/breadcrumbs.yaml new file mode 100644 index 00000000..2fbf0ffd --- /dev/null +++ b/doc-src/layouts/partials/breadcrumbs.yaml @@ -0,0 +1 @@ +--- {} diff --git a/doc-src/lib/default.rb b/doc-src/lib/default.rb index dd40a1a2..7809063f 100644 --- a/doc-src/lib/default.rb +++ b/doc-src/lib/default.rb @@ -4,6 +4,7 @@ include Nanoc3::Helpers::LinkTo include Nanoc3::Helpers::Capturing include Nanoc3::Helpers::Rendering +include Nanoc3::Helpers::Breadcrumbs def body_class(item) (item[:classnames] || []).join(" ")