3 files changed,
3 insertions(+),
5 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-01-28 18:40:04 +0200
Authored at:
2026-01-28 16:28:58 +0200
Change ID:
orznlzsoolwnupqxwmoltytrvtvmwwrm
Parent:
7b26905
M
internal/handlers/handlers.go
路路路 48 48 } 49 49 50 50 var templateFuncs = template.FuncMap{ 51 + "humanizeTime": func(t time.Time) string { return humanize.Time(t) }, 51 52 "commitSummary": func(v any) string { 52 53 s := fmt.Sprint(v) 53 54 if i := strings.IndexByte(s, '\n'); i >= 0 { 路路路 55 56 return s + "..." 56 57 } 57 58 return strings.TrimSuffix(s, "\r") 58 - }, 59 - "humanTime": func(t time.Time) string { 60 - return humanize.Time(t) 61 59 }, 62 60 }
M
web/templates/index.html
路路路 24 24 <tr> 25 25 <td class="url"><a href="/{{ .Name }}">{{ .Name }}</a></td> 26 26 <td class="desc">{{ .Desc }}</td> 27 - <td class="idle">{{ humanTime .LastCommit }}</td> 27 + <td class="idle">{{ humanizeTime .LastCommit }}</td> 28 28 </tr> 29 29 {{ end}} 30 30 </tbody>
M
web/templates/repo_log.html
路路路 32 32 <a href="mailto:{{ .Author.Email }}" class="commit-email">{{ .Author.Email }}</a> 33 33 </span> 34 34 </td> 35 - <td class="age">{{ humanTime .Committer.When }}</td> 35 + <td class="age">{{ humanizeTime .Committer.When }}</td> 36 36 </tr> 37 37 {{ end }} 38 38 </tbody>