You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2014/01/31 23:29:30 UTC

svn commit: r1563307 - /myfaces/site/cms-site/trunk/lib/view.pm

Author: lu4242
Date: Fri Jan 31 22:29:29 2014
New Revision: 1563307

URL: http://svn.apache.org/r1563307
Log:
test how to fix documentation

Modified:
    myfaces/site/cms-site/trunk/lib/view.pm

Modified: myfaces/site/cms-site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/lib/view.pm?rev=1563307&r1=1563306&r2=1563307&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/lib/view.pm (original)
+++ myfaces/site/cms-site/trunk/lib/view.pm Fri Jan 31 22:29:29 2014
@@ -353,15 +353,51 @@ sub downloadLink {
     return "[$label]([preferred]/sling/$artifact) ([asc]($dp/sling/$artifact.asc), [md5]($dp/sling/$artifact.md5))";
 }
 
+#sub breadcrumbs {
+#    my @path = split m!/!, shift;
+#    pop @path;
+#    my @rv;
+#    my $relpath = "";
+#    for (@path) {
+#        $relpath .= "$_/";
+#        $_ ||= "Home";
+#        push @rv, qq(<a href="$relpath">\u$_</a>);
+#    }
+#    return join "&nbsp;&raquo&nbsp;", @rv;
+#}
+
 sub breadcrumbs {
     my @path = split m!/!, shift;
     pop @path;
     my @rv;
     my $relpath = "";
+    my $ext;
+    my $sep = "/";
+    my $ignoreCount = 0;
     for (@path) {
-        $relpath .= "$_/";
-        $_ ||= "Home";
-        push @rv, qq(<a href="$relpath">\u$_</a>);
+      ++ignoreCount
+      if (ignoreCount > 1) {
+        $relpath .= "$sep$_";
+        if ($_) {
+            $_ = "";
+            my $datafile = "content$relpath.mdtext";
+            my %data;
+            if (-f $datafile) {
+                read_text_file $datafile, \%data;
+                $ext = ".html";
+                $sep = "/";
+                my $title = ${data{headers}}{title};
+                if ($title) {
+                    $_ = $title;
+                }
+            }
+        } else {
+            $_ = "Home";
+            $ext = "";
+            $sep = "";
+        }
+        push @rv, qq(<a href="$relpath$ext">$_</a>) if $_;
+      }
     }
     return join "&nbsp;&raquo&nbsp;", @rv;
 }