Skip to content

Commit 7210f23

Browse files
Add link for repositories README file (#27684)
this allows to deep link to the readme section of a repository. fixes #27641 Screenshots: No changes on initial display: ![image](https://github.com/go-gitea/gitea/assets/1135157/efbef50e-c24b-4cca-b19f-9092e70b5a5f) On hover the link is shown: ![image](https://github.com/go-gitea/gitea/assets/1135157/c8dff2b8-31dc-4b7b-96d0-27642318483d)
1 parent 0a2b93d commit 7210f23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/repo/view_file.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content">
1+
<div {{if .ReadmeInList}}id="readme" {{end}}class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content">
22
{{- if .FileError}}
33
<div class="ui error message">
44
<div class="text left gt-whitespace-pre">{{.FileError}}</div>
@@ -13,7 +13,7 @@
1313
<div class="file-header-left gt-df gt-ac gt-py-3 gt-pr-4">
1414
{{if .ReadmeInList}}
1515
{{svg "octicon-book" 16 "gt-mr-3"}}
16-
<strong>{{.FileName}}</strong>
16+
<strong><a class="default-link muted" href="#readme">{{.FileName}}</a></strong>
1717
{{else}}
1818
{{template "repo/file_info" .}}
1919
{{end}}

0 commit comments

Comments
 (0)