community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1035503 - in /comdev/site/trunk: content/localmentors.mdtext lib/view.pm templates/standard.html
Date Tue, 16 Nov 2010 00:20:50 GMT
Author: nick
Date: Tue Nov 16 00:20:49 2010
New Revision: 1035503

URL: http://svn.apache.org/viewvc?rev=1035503&view=rev
Log:
Improve breadcrumb generation

Modified:
    comdev/site/trunk/content/localmentors.mdtext
    comdev/site/trunk/lib/view.pm
    comdev/site/trunk/templates/standard.html

Modified: comdev/site/trunk/content/localmentors.mdtext
URL: http://svn.apache.org/viewvc/comdev/site/trunk/content/localmentors.mdtext?rev=1035503&r1=1035502&r2=1035503&view=diff
==============================================================================
--- comdev/site/trunk/content/localmentors.mdtext (original)
+++ comdev/site/trunk/content/localmentors.mdtext Tue Nov 16 00:20:49 2010
@@ -1,4 +1,4 @@
-Title: /home/nick/tmp/LocalMentors.cwiki
+Title: LocalMentors
 The Local Mentors project aims to allow people getting started in Apache (both within the
[Formal Mentoring Program](mentoringprogramme.html), and everyone else) to meet up with existing
Apache developers in their area.
 
 # Why?

Modified: comdev/site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/comdev/site/trunk/lib/view.pm?rev=1035503&r1=1035502&r2=1035503&view=diff
==============================================================================
--- comdev/site/trunk/lib/view.pm (original)
+++ comdev/site/trunk/lib/view.pm Tue Nov 16 00:20:49 2010
@@ -27,7 +27,6 @@ sub normal_page {
     my %args = @_;
     my $file = "content$args{path}";
     $args{path} =~ s/\.mdtext$/\.html/;
-    $args{breadcrumbs} = breadcrumbs($args{path});
 
     my $template = $file;
     if($args{template}) {
@@ -35,6 +34,7 @@ sub normal_page {
     }
 
     read_text_file $file, \%args;
+    $args{breadcrumbs} = breadcrumbs($args{path}, $args{headers});
 
     my $page_path = $file;
     $page_path =~ s/\.[^.]+$/.page/;
@@ -51,8 +51,15 @@ sub normal_page {
 
 # Generates cwiki-style breadcrumbs
 sub breadcrumbs {
-    my @path = split m!/!, shift;
-    pop @path;
+    my ($fullpath, $headerref) = @_;
+    my @path = split m!/!, $fullpath;
+    if($path[scalar@path-1] =~ /^index/) { 
+      pop @path; 
+    } else {
+      if($headerref && $headerref->{title}) {
+         $path[scalar@path-1] = $headerref->{title};
+      }
+    }
     my @rv;
     my $relpath = "";
     for (@path) {

Modified: comdev/site/trunk/templates/standard.html
URL: http://svn.apache.org/viewvc/comdev/site/trunk/templates/standard.html?rev=1035503&r1=1035502&r2=1035503&view=diff
==============================================================================
--- comdev/site/trunk/templates/standard.html (original)
+++ comdev/site/trunk/templates/standard.html Tue Nov 16 00:20:49 2010
@@ -87,7 +87,7 @@
         <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
             <TR class="topBar">
                 <td align="left" valign="middle" class="topBarDiv" nowrap="true" width="100%">
-                    &nbsp;{{ breadcrumbs }}
+                    &nbsp;{{ breadcrumbs|safe }}
                 </td>
                 <td align="right" valign="middle" class="topBarDiv" align="left" nowrap="true">
                     <A href="http://community.apache.org">Apache Community Development</A>
| <A href="http://mail-archives.apache.org/mod_mbox/community-dev/">Mailling List</A>



Mime
View raw message