refactor: split language card into repos-per-language and most-commit-language

Align card set with github-profile-summary-cards' 5-card layout:

  0-profile-details.svg       (unchanged)
  1-repos-per-language.svg    (new) owned repos grouped by primary language
  2-most-commit-language.svg  (new) last-year commits attributed to each repo's primary language
  3-stats.svg                 (renumbered)
  4-productive-time.svg       (renumbered)

- FetchProductive now fills p.CommitsByLanguage from the same commit history
  it uses for the heatmap, so no extra API calls are introduced.
- TopRepos carries primary language so productive-time can aggregate by lang.
- LangStat.Bytes renamed to Value (repo count or commit count, context-dependent).
- Shared bar+legend renderer extracted to language_bar.go.
- Ignore generated output/ directory.
This commit is contained in:
tiennm99 committed 2026-04-18 18:57:42 +07:00
1 parent ff4975fae2
commit 7eb83be9de
14 files changed
+151 -74

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
package card
import (
"github.com/tiennm99/ghstats/internal/github"
"github.com/tiennm99/ghstats/internal/theme"
)
type mostCommitLanguageCard struct{}
func (mostCommitLanguageCard) Filename() string { return "2-most-commit-language.svg" }
func (mostCommitLanguageCard) SVG(p *github.Profile, t theme.Theme) ([]byte, error) {
return renderLanguageCard("Most Commit Language (last year)", p.CommitsByLanguage, t), nil
}