summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJiaxin Zhu <shin00pku@gmail.com>2024-04-25 08:07:38 +0800
committerGitHub <noreply@github.com>2024-04-25 00:07:38 +0000
commita63f14b90839821a480fb56fd9b45a27864b77d1 (patch)
treeada9c4ded9753e8ade4aff3cc004aca90ab6f9fa /templates
parenta19d2bbd90dd22a897220425a1221af8ed065ba7 (diff)
downloadgitea-a63f14b90839821a480fb56fd9b45a27864b77d1.tar.gz
gitea-a63f14b90839821a480fb56fd9b45a27864b77d1.zip
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 <zhujiaxinabc@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/view_list.tmpl2
1 files changed, 1 insertions, 1 deletions
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}}
</tbody>
</table>
-{{if .ReadmeExist}}
+{{if and .ReadmeExist (or .IsMarkup .IsPlainText)}}
{{template "repo/view_file" .}}
{{end}}