diff options
author | Thomas Letan <lthms@soap.coffee> | 2020-07-14 11:08:58 +0200 |
---|---|---|
committer | Thomas Letan <lthms@soap.coffee> | 2020-07-14 11:08:58 +0200 |
commit | 3deedaa389ab67148e1ca55febf919b30fbb4df2 (patch) | |
tree | f92fcffaa9c7f31272320d8a09e2d955c00c49a6 /site/cleopatra | |
parent | More spellchecking and typos (diff) |
Identify the creation and last update date from the revisions table
Diffstat (limited to 'site/cleopatra')
-rw-r--r-- | site/cleopatra/soupault.org | 15 |
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 |