From a63f14b90839821a480fb56fd9b45a27864b77d1 Mon Sep 17 00:00:00 2001 From: Jiaxin Zhu Date: Thu, 25 Apr 2024 08:07:38 +0800 Subject: [PATCH] Fix view of readme file in the home code page. (#30564) Gitea attempts to display image file, pdf file, etc. named readme in the home code page (but it cannot). I think only the markdown and plain-text file should be displayed, which is also the behavior of GitHub. Co-authored-by: jxshin --- templates/repo/view_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index fb257bd474..7ec9acc84e 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -68,6 +68,6 @@ {{end}} -{{if .ReadmeExist}} +{{if and .ReadmeExist (or .IsMarkup .IsPlainText)}} {{template "repo/view_file" .}} {{end}}