From 3aa2c29a9ad084639a1ea348809210dd781cb41d Mon Sep 17 00:00:00 2001 From: qorg11 Date: Sat, 17 Oct 2020 03:30:24 +0200 Subject: Now you can put README.MD in the document root and will be displayed! --- gitweb.cgi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gitweb.cgi b/gitweb.cgi index c73cc17..429cf64 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -6592,12 +6592,6 @@ sub git_summary { # If XSS prevention is on, we don't include README.html. # TODO: Allow a readme in some safe format. - if (!$prevent_xss && -s "$projectroot/$project/README.html") { - print "
readme
\n" . - "
\n"; - insert_file("$projectroot/$project/README.md"); - print "\n
\n"; # class="readme" - } # we need to request one more than 16 (0..15) to check if # those 16 are all @@ -6635,6 +6629,13 @@ sub git_summary { $cgi->a({-href => href(action=>"forks")}, "..."), 'no_header'); } + if (!$prevent_xss) { + print "
readme
\n" . + "
\n"; + system("cd /home/git/$project && git show HEAD:README.md|pandoc --to html"); # Which is a safer + # way to do this? + print "\n
\n"; # class="readme" + } git_footer_html(); } -- cgit v1.2.3