4 files changed,
37 insertions(+),
34 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-01-28 18:40:04 +0200
Authored at:
2026-01-28 16:29:13 +0200
Change ID:
yposxkvklnuolmpnutxwtpwlszokzmxm
Parent:
1731de8
M
internal/git/repo.go
路路路 6 6 "os" 7 7 "path/filepath" 8 8 "sort" 9 + "strings" 9 10 "time" 10 11 11 12 "github.com/go-git/go-git/v5" 路路路 149 150 return branches, err 150 151 } 151 152 153 +const defaultDescription = "Unnamed repository; edit this file 'description' to name the repository" 154 + 152 155 func (g *Repo) Description() (string, error) { 153 156 // TODO: ??? Support both mugit.description and /description file 154 157 path := filepath.Join(g.path, "description") 路路路 161 164 return "", fmt.Errorf("failed to read description: %w", err) 162 165 } 163 166 164 - return string(d), nil 167 + desc := string(d) 168 + if strings.Contains(desc, defaultDescription) { 169 + return "", nil 170 + } 171 + 172 + return desc, nil 165 173 } 166 174 167 175 func (g *Repo) IsPrivate() (bool, error) {
M
web/static/style.css
路路路 95 95 color: var(--gray); 96 96 } 97 97 98 +.repo-breadcrumb:before { 99 + content: "<"; /* TODO: add an arrow */ 100 +} 101 + 98 102 .repo-breadcrumb a { 99 103 color: var(--gray); 100 104 } 路路路 155 159 156 160 .index .url { white-space: nowrap; } 157 161 .index .desc { width: 100%; } 162 +.index .desc .unset { color: var(--gray); } 158 163 .index .idle { white-space: nowrap; } 164 + 159 165 160 166 .index tbody tr.nohover:hover { 161 167 background: transparent; 路路路 404 410 margin-bottom: 1rem; 405 411 } 406 412 407 - .commit pre { 408 - padding-bottom: 0; 409 - white-space: pre-wrap; 410 - } 411 - 412 - .commit-message { 413 - margin-top: 0.25rem; 414 - font-size: 1rem; 415 - line-height: 1.35; 416 - margin-bottom: 0; 417 - } 418 - 419 - 420 - .commit .box { 421 - margin-bottom: 0.25rem; 422 - } 423 - 424 - 425 - .commit .commit-info { 426 - padding-bottom: 0.25rem; 427 - } 413 +.commit pre { 414 + padding-bottom: 0; 415 + white-space: pre-wrap; 416 +} 428 417 418 +.commit-message { 419 + margin-top: 0.25rem; 420 + font-size: 1rem; 421 + line-height: 1.35; 422 + margin-bottom: 0; 423 +} 429 424 425 +.commit .box { 426 + margin-bottom: 0.25rem; 427 +} 430 428 429 +.commit .commit-info { 430 + padding-bottom: 0.25rem; 431 +} 431 432 432 433 .diff-add { 433 434 color: green; 路路路 443 444 444 445 .ref { 445 446 font-family: var(--sans-font); 446 - font-size: 14px; 447 + font-size: 1rem; 447 448 color: var(--gray); 448 449 display: inline-block; 449 450 padding-top: 0.7em; 路路路 478 479 gap: 1rem; 479 480 padding: 0.5rem; 480 481 background: var(--light-gray); 481 - overflow-x: auto; 482 -} 483 - 484 -.chroma-file-wrapper { 485 - display: flex; 486 - flex-direction: row; 487 - grid-template-columns: 1rem minmax(0, 1fr); 488 482 overflow-x: auto; 489 483 } 490 484
M
web/templates/_repo_header.html
路路路 2 2 <header class="repo-header"> 3 3 <div class="repo-breadcrumb"> 4 4 <a href="/">all repos</a> 5 + </div> 6 + <h1 class="repo-name"> 7 + {{ .name }} 5 8 {{- if .ref }} 6 9 <span class="ref">@ {{ .ref }}</span> 7 10 {{- end }} 8 - </div> 9 - 10 - <h1 class="repo-name">{{ .name }}</h1> 11 + </h1> 11 12 {{- if .desc }} 12 13 <div class="desc">{{ .desc }}</div> 13 14 {{- end }}
M
web/templates/index.html
路路路 23 23 {{ range .repos }} 24 24 <tr> 25 25 <td class="url"><a href="/{{ .Name }}">{{ .Name }}</a></td> 26 - <td class="desc">{{ .Desc }}</td> 26 + <td class="desc">{{- if .Desc }}{{ .Desc }}{{- else }}<span class="unset">No description set</span>{{- end }} 27 27 <td class="idle">{{ humanizeTime .LastCommit }}</td> 28 28 </tr> 29 29 {{ end}}