Permalink
Browse files

added breadcrumbs; more info on homepage

  • Loading branch information...
1 parent cc6bd72 commit e742946be4943aadf683d1e5de9296d72f560ec1 @banker banker committed Apr 20, 2010
Showing with 69 additions and 8 deletions.
  1. +27 −4 content/css/style.css
  2. +11 −4 content/index.txt
  3. +1 −0 layouts/default.txt
  4. +28 −0 lib/breadcrumbs.rb
  5. +2 −0 lib/helpers.rb
View
@@ -2,6 +2,7 @@ body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
margin: 0;
+ color: #303030;
}
a {
@@ -25,16 +26,14 @@ p {
h1 {
font-size: 30px;
- color: #6686BD;
}
h2 {
- font-size: 18px;
- color: black;
+ font-size: 25px;
}
h3 {
- font-size:14px;
+ font-size:18px;
}
h4 {
@@ -95,3 +94,27 @@ body pre {
font-size: 15px;
line-height: 20px;
}
+
+ul.breadcrumbs {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+}
+
+ul.breadcrumbs li {
+ float:left;
+ line-height:2em;
+ padding-right:.75em;
+}
+
+ul.breadcrumbs li a {
+ display: block;
+}
+
+.clearfix:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
View
@@ -1,5 +1,5 @@
---
-title: MongoDB Recipes
+title: The MongoDB Cookbook
created_at: 2008-08-02 14:06:40.000000 -06:00
dirty: true
filter:
@@ -10,18 +10,25 @@ filter:
</p>
<p>
-If you're just here to browse, see our recipes below.
+If you're new to MongoDB, be sure to check out:
</p>
+<ul>
+ <li><a href="http://mongodb.org/">MongoDB Docs and Homepage</a></li>
+ <li><a href="http://www.mongodb.org/display/DOCS/Production+Deployments">MongoDB Production Deployments</a></li>
+</ul>
+<h2>Recipes</h2>
<% ['patterns', 'operations'].each do |subject| %>
<% articles = @pages.find(:all, :in_directory => subject, :recursive => true, :recipe => true) %>
-<h2><%= subject.capitalize %></h2>
+<h3><%= subject.capitalize %></h3>
<ul>
<% articles.each do |article| %>
<li><%= link_to_page(article) %></li>
<% end %>
</ul>
-
<% end %>
+
+<h2>Getting more help</h2>
+<p>Can find the answer you're looking for? Send a question to the <a href="http://groups.google.com/group/mongodb-user">MongoDB User List</a> or check out #mongodb on irc.freenode.net.</p>
View
@@ -29,6 +29,7 @@ description: A cookbook full of mouth-watering MongoDB recipes.
<div class='main'>
<% if @page.recipe %>
+ <%= breadcrumbs(@page) %>
<h1><%= @page.title %></h1>
<div class='credit'>
View
@@ -0,0 +1,28 @@
+# breadcrumbs.rb
+
+module BreadcrumbsHelper
+ # call-seq:
+ # breadcrumbs( page ) => html
+ #
+ # Create breadcrumb links for the current page. This will return an HTML
+ # <ul></ul> object.
+ #
+ def breadcrumbs( page )
+ list = ["<li> > &nbsp;#{h(page.title)}</li>"]
+ loop do
+ page = @pages.parent_of(page)
+ break if page.nil?
+ list << "<li>#{link_to_page(page)}</li>"
+ end
+ list.reverse!
+
+ html = "<ul class=\"breadcrumbs clearfix\">\n"
+ html << list.join("\n")
+ html << "\n</ul>\n"
+ html
+ end
+end # module Breadcrumbs
+
+Webby::Helpers.register(BreadcrumbsHelper)
+
+# EOF
View
@@ -1,3 +1,5 @@
+require File.join(File.dirname(__FILE__), 'breadcrumbs')
+
module Helpers
def code(lang, &block)
uv(:lang => lang, :theme => "twilight", &block)

0 comments on commit e742946

Please sign in to comment.