summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-07-14 11:08:58 +0200
committerThomas Letan <lthms@soap.coffee>2020-07-14 11:08:58 +0200
commit3deedaa389ab67148e1ca55febf919b30fbb4df2 (patch)
treef92fcffaa9c7f31272320d8a09e2d955c00c49a6
parentMore spellchecking and typos (diff)
Identify the creation and last update date from the revisions table
-rw-r--r--site/cleopatra/soupault.org15
1 files changed, 13 insertions, 2 deletions
diff --git a/site/cleopatra/soupault.org b/site/cleopatra/soupault.org
index dc23461..18e01d1 100644
--- a/site/cleopatra/soupault.org
+++ b/site/cleopatra/soupault.org
@@ -361,8 +361,10 @@ https://code.soap.coffee/writing/lthms.git
<table>
{{#history}}
<tr>
- <td class="date">{{date}}</a></td>
- <td class="subject">{{subject}}</a></td>
+ <td class="date"{{#created}} id="created-at"{{/created}}{{#modified}} id="modified-at"{{/modified}}>
+ {{date}}
+ </td>
+ <td class="subject">{{subject}}</td>
<td class="commit">
<a href="<<repo>>/commit/{{filename}}/?id={{hash}}">
{{abbr_hash}}
@@ -510,9 +512,16 @@ To manipulate JSON, we rely on three operators (yet to be defined):
#+BEGIN_SRC bash :noweb no-export
local name="${file}"
local revisions='[]'
+local first=0
while read -r rev; do
rev=$(jset "${rev}" "filename" "\"${name}\"")
+
+ if [ ${first} -eq 0 ]; then
+ rev=$(jset "${rev}" "modified" "true")
+ first=1
+ fi
+
revisions=$(jappend "${revisions}" "${rev}")
local hash=$(jget "${rev}" "hash")
@@ -522,6 +531,8 @@ while read -r rev; do
name=${rename}
fi
done < <(echo "${logs}")
+
+revisions=$(_jq "${revisions}" "length as \$l | .[\$l - 1].created |= true")
#+END_SRC
#+BEGIN_SRC bash :tangle scripts/history.sh