Skip to content

Commit 8d0e112

Browse files
committed
add repo name
1 parent b2e3bbf commit 8d0e112

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

services/markup/renderhelper_codepreview.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func renderRepoFileCodePreview(ctx context.Context, opts markup.RenderCodePrevie
110110
"FilePath": opts.FilePath,
111111
"LineStart": opts.LineStart,
112112
"LineStop": realLineStop,
113+
"RepoName": opts.RepoName,
113114
"RepoLink": dbRepo.Link(),
114115
"CommitID": opts.CommitID,
115116
"HighlightLines": highlightLines,

templates/base/markup_codepreview.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="code-preview-container file-content">
22
<div class="code-preview-header">
3-
<a href="{{.FullURL}}" rel="nofollow" class="tw-font-semibold">{{.FilePath}}</a>
3+
<a href="{{.FullURL}}" rel="nofollow" class="tw-font-semibold">{{.RepoName}}/{{.FilePath}}</a>
44
{{$link := HTMLFormat `<a href="%s/commit/%s" class="muted tw-font-mono tw-text-text">%s</a>` .RepoLink .CommitID (.CommitID | ShortSha) -}}
55
{{- if eq .LineStart .LineStop -}}
66
{{ctx.Locale.Tr "repo.code_preview_line_in" .LineStart $link}}

0 commit comments

Comments
 (0)