From: Lady <redacted>
Date: Sat, 29 Jul 2023 00:17:58 +0000 (-0700)
Subject: Allow more git calls for Special:RecentlyChanged
X-Git-Tag: 0.2.1~1
X-Git-Url: https://git.ladys.computer/GitWikiWeb/commitdiff_plain/9cfc66dd6cde8171644c8a58f98983ca5a2b7676?ds=inline;hp=c539e7ea81a37c86e7fb13f0ba98ea90b7aefe9e

Allow more git calls for Special:RecentlyChanged

This is now configurable in `config.yaml` (`max_recency`) and defaults
to `7` instead of `5`.
---

diff --git a/build.js b/build.js
index bd8ff27..ca07283 100644
--- a/build.js
+++ b/build.js
@@ -664,7 +664,8 @@ class GitWikiWebPage {
         }
         const results = new Array(6);
         const seen = new Set();
-        let recency = 5;
+        const maxRecency = Math.max(config.max_recency | 0, 0);
+        let recency = maxRecency;
         let current;
         do {
           const show = new Deno.Command("git", {
@@ -672,7 +673,7 @@ class GitWikiWebPage {
               "show",
               "-s",
               "--format=%H%x00%cI%x00%cD",
-              recency ? `HEAD~${5 - recency}` : commit,
+              recency ? `HEAD~${maxRecency - recency}` : commit,
             ],
             stdout: "piped",
             stderr: "piped",
diff --git a/config.yaml b/config.yaml
index 555db2b..1972fa4 100644
--- a/config.yaml
+++ b/config.yaml
@@ -1,4 +1,11 @@
-# Modify this file to configure your GitWikiWeb instance.
+# The maximum number of calls to git in Special:RecentlyChanged before
+# giving up and just collecting all remaining files in the time·period.
+#
+# This configuration gives the maximum number of unique dates shown on
+# the page.
+max_recency: 7
+
+# Symbol conversions supported in Djot.
 symbols:
   nbsp: "\xA0" # no‐break space
   cgj: "\u034F" # combining grapheme joiner
diff --git a/style.css b/style.css
index 82330d0..e79e070 100644
--- a/style.css
+++ b/style.css
@@ -16,9 +16,11 @@ p{ Margin: 0 }
 p+p{ Margin-Block-Start: .75EM }
 :Any-Link[href^="/Special:NotFound?path="]{ Color: Firebrick }
 span.sig{ Font-Style: Italic; Font-Weight: Bold }
-strong[data-recency="5"]{ Font-Weight: 900 }
-strong[data-recency="4"]{ Font-Weight: 800 }
-strong[data-recency="3"]{ Font-Weight: 700 }
-strong[data-recency="2"]{ Font-Weight: 600 }
+strong[data-recency="7"]{ Font-Weight: 800 }
+strong[data-recency="6"]{ Font-Weight: 750 }
+strong[data-recency="5"]{ Font-Weight: 700 }
+strong[data-recency="4"]{ Font-Weight: 650 }
+strong[data-recency="3"]{ Font-Weight: 600 }
+strong[data-recency="2"]{ Font-Weight: 550 }
 strong[data-recency="1"]{ Font-Weight: 500 }
 strong[data-recency] time{ Font-Style: Italic }