0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-12-12 06:19:38 +01:00

Improve markup code preview rendering

This commit is contained in:
silverwind 2025-10-29 19:11:44 +01:00
parent 8aa1179ce4
commit 86bad44824
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<div class="code-preview-container file-content">
<div class="code-preview-header">
<a href="{{.FullURL}}" class="muted" rel="nofollow">{{.FilePath}}</a>
{{$link := HTMLFormat `<a href="%s/src/commit/%s" rel="nofollow">%s</a>` .RepoLink .CommitID (.CommitID | ShortSha) -}}
<a href="{{.FullURL}}" rel="nofollow" class="tw-font-semibold">{{.FilePath}}</a>
{{$link := HTMLFormat `<a href="%s/src/commit/%s" class="muted tw-font-mono tw-text-text">%s</a>` .RepoLink .CommitID (.CommitID | ShortSha) -}}
{{- if eq .LineStart .LineStop -}}
{{ctx.Locale.Tr "repo.code_preview_line_in" .LineStart $link}}
{{- else -}}

View File

@ -5,6 +5,7 @@
}
.markup .code-preview-container .code-preview-header {
color: var(--color-text-light-1);
border-bottom: 1px solid var(--color-secondary);
padding: 0.5em;
font-size: 12px;