feat(repo): prioritize well-known READMEs and optimize discovery (#38532)

This PR adjusts the repository README discovery logic to mirror GitHub's
priority order, while retaining support for Gitea's specific `.gitea/`
directory.

Previously, Gitea would prioritize a `README.md` at the root of the
repository over any READMEs in `.gitea/` or `.github/`. With this
change, well-known subdirectories are evaluated first when viewing the
repository root.

**New Priority Order:**
1. `.gitea/README.md`
2. `.github/README.md`
3. `/README.md` (root directory)
4. `docs/README.md`

This allows repository maintainers to use `.github/README.md` (or
`.gitea/README.md`) as the repository homepage without having to remove
or rename generic root `/README.md` files required by package managers
(like NPM, Crates.io, Docker, etc.).

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Shudhanshu Singh
2026-07-21 11:44:25 +08:00
committed by GitHub
co-authored by wxiaoguang
parent a4526d5a82
commit c0f4e5583e
48 changed files with 248 additions and 231 deletions
@@ -1,2 +0,0 @@
xŽ;Â0 @™s
_€*NÒÄH±±1q×u(¢?•tàöTˆ0¾á==™†áQÀ·+‹*4¤Ìd¹¥h“SÌη.z¢à°¢Í™Z3ó¢ctˆ0'As“5hÉzL¶=D¡ÌB˜\cx-Ý´Àõ!O¸¬›ÚéÇqÃêþÃó<õï¡ô•ð 0¦T×装½­­5ò=-›õÃÜôU sß7,Oó#ÆMÜ
@@ -1 +0,0 @@
xÎM †aל‚ Ø 0&ƸsçÊ ئô'•.¼½Õx—ïâùòñ4 ]•õ®.)ÉDÖñQÅ|@b6Xbdƒì2+b¦%ƒI>g 27QÇÀˆ. (c­ µ¶Ó"o÷òºn´M<[6_^橼†Z¦³Tç¬Uƹ øû´nêÿ␍qOÏ*3•ˆ{ñ™²N\
@@ -1,3 +0,0 @@
xŽ;Â0 @™s
_€*N뤕bccâŽëЊþTÒÛS!NÀø†÷ôdÇ>ƒ«Ü!¯ª­Ö„LUlÙ#qô¡´”líQÅ,¼ê”¡Œ®lCBn$6¶’XùDɹàbbÒ–R0ÅÆð–»y…[/O¸n»Úé
§iÇâñÃË2ï1…ðЇ@„ep´d­‘ïiÞ­ÿ殯 ‰‡!²<Í™ÜN—
@@ -1,3 +0,0 @@
xÎM
1 †a×=E. ¤mšŽ âÎwh›¨ƒó#µ"ÞÞA<Ëgñ~|eǾ#»jU:×ÙØ$%ž9o‰Ø{µ9F ™Õ£QdsOU§‘H‘ÕrA´(œ=¡xôçEœØÅ$nkÒ³]ç
§¾Üàø\Ò«VØM 7—÷yxmØ”´Ë1ê-¬1 šò}Ú–êÿ␍3Ì/­%=úf>&L¨
@@ -1,2 +0,0 @@
P pack-8933bd634b76f8154310cccb52537a0195e43166.pack