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)
pull/27686/head
sebastian-sauer 1 year ago committed by GitHub
parent 0a2b93d411
commit 7210f23fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      templates/repo/view_file.tmpl

@ -1,4 +1,4 @@
<div class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content">
<div {{if .ReadmeInList}}id="readme" {{end}}class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content">
{{- if .FileError}}
<div class="ui error message">
<div class="text left gt-whitespace-pre">{{.FileError}}</div>
@ -13,7 +13,7 @@
<div class="file-header-left gt-df gt-ac gt-py-3 gt-pr-4">
{{if .ReadmeInList}}
{{svg "octicon-book" 16 "gt-mr-3"}}
<strong>{{.FileName}}</strong>
<strong><a class="default-link muted" href="#readme">{{.FileName}}</a></strong>
{{else}}
{{template "repo/file_info" .}}
{{end}}

Loading…
Cancel
Save