Pull newly created themes to the top

This commit is contained in:
Bjørn Erik Pedersen committed 2021-07-06 20:25:56 +02:00
1 parent e795f31db8
commit 532f67c345
2 files changed
+6 -7

No files matched your search

@@ -1624,11 +1624,6 @@
"noMounts": true,
"path": "github.com/themefisher/parsa-hugo"
},
{
"ignoreImports": true,
"noMounts": true,
"path": "github.com/themefisher/parsa-hugo-personal-blog-theme"
},
{
"ignoreImports": true,
"noMounts": true,
+6 -2
View File
@@ -293,11 +293,11 @@ func (t *theme) calculateWeight(maxStars int) {
boostRecent(time.Since(t.m.Time), (3 * d30), 20)
}
// Boost themes created the last month.
// Pull themes created the last 3 months to the top.
// Note that we currently only have that information for themes
// hosted on GitHub.
if !t.ghRepo.IsZero() {
boostRecent(time.Since(t.ghRepo.CreatedAt), (1 * d30), 50)
boostRecent(time.Since(t.ghRepo.CreatedAt), (3 * d30), 50000)
}
// Boost themes with a Hugo version indicator set that covers.
@@ -308,6 +308,10 @@ func (t *theme) calculateWeight(maxStars int) {
weight -= boost
}*/
if t.weight < 0 {
t.weight = 1
}
}
func (t *theme) toFrontMatter() map[string]interface{} {