]> source.dussan.org Git - gitea.git/commitdiff
Fix view of readme file in the home code page. (#30564)
authorJiaxin Zhu <shin00pku@gmail.com>
Thu, 25 Apr 2024 00:07:38 +0000 (08:07 +0800)
committerGitHub <noreply@github.com>
Thu, 25 Apr 2024 00:07:38 +0000 (00:07 +0000)
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>
templates/repo/view_list.tmpl

index fb257bd474cbb45f855c7ab234de2a8371eaf701..7ec9acc84ecc1bce1c15ebcd2622b02cfcdcf934 100644 (file)
@@ -68,6 +68,6 @@
                {{end}}
        </tbody>
 </table>
-{{if .ReadmeExist}}
+{{if and .ReadmeExist (or .IsMarkup .IsPlainText)}}
        {{template "repo/view_file" .}}
 {{end}}