From 532f67c345ced8b6ad699e8aaceca20b993dd79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 6 Jul 2021 20:25:56 +0200 Subject: [PATCH] Pull newly created themes to the top --- cmd/hugothemesitebuilder/build/config.json | 5 ----- pkg/buildcmd/build.go | 8 ++++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/hugothemesitebuilder/build/config.json b/cmd/hugothemesitebuilder/build/config.json index e68eee5..19cd1f0 100644 --- a/cmd/hugothemesitebuilder/build/config.json +++ b/cmd/hugothemesitebuilder/build/config.json @@ -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, diff --git a/pkg/buildcmd/build.go b/pkg/buildcmd/build.go index 1c47600..713d577 100644 --- a/pkg/buildcmd/build.go +++ b/pkg/buildcmd/build.go @@ -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{} {