X-Git-Url: http://git.subgeniuskitty.com/gitweb-sgk/.git/blobdiff_plain/f35f44b788bd7ea9331f84c02cac0741da253a03..39ef91a31081cdafceea3da6bedcc76db52599fb:/gitweb.cgi diff --git a/gitweb.cgi b/gitweb.cgi index 16021cc..a3b31ce 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -3846,6 +3846,37 @@ sub insert_file { close $fd; } +sub insert_html_file { + my $file_name = shift; + insert_file($file_name); +} + +sub insert_text_file { + my $file_name = shift; + + open my $fd, $file_name or die_error(500, "Couldn't open $file_name"); + + print "
"; + while (my $line = <$fd>) { + print to_utf8($line); + } + print ""; +} + +sub insert_markdown_file { + my $file_name = shift; + + # TODO: Make this a config option? + my $markdown_cmd = "/usr/bin/markdown"; + + open my $fd, quote_command($markdown_cmd, $file_name)." |" + or die_error(500, "Couldn't open $file_name"); + + while (my $line = <$fd>) { + print to_utf8($line); + } +} + ## ...................................................................... ## mimetype related functions @@ -4070,10 +4101,11 @@ sub print_nav_breadcrumbs_path { while (my $part = shift) { $dirprefix .= "/" if defined $dirprefix; $dirprefix .= $part; - print $cgi->a({-href => href(project => undef, - project_filter => $dirprefix, - action => "project_list")}, - esc_html($part)) . " / "; + if (scalar @_ != 0) { + print $cgi->a({-href => href(action => "summary")}, esc_html($part)) . " / "; + } else { + print $cgi->a({-href => href(action => "summary")}, esc_html($part)); + } } } @@ -4087,7 +4119,9 @@ sub print_nav_breadcrumbs { my @dirname = split '/', $project; my $projectbasename = pop @dirname; print_nav_breadcrumbs_path(@dirname); - print $cgi->a({-href => href(action=>"summary")}, esc_html($projectbasename)); + if ($projectbasename != ".git") { + print $cgi->a({-href => href(action=>"summary")}, esc_html($projectbasename)); + } if (defined $action) { my $action_print = $action ; if (defined $opts{-action_extra}) { @@ -4434,7 +4468,7 @@ sub git_print_header_div { sub format_repo_url { my ($name, $url) = @_; - return "