From: Paul Hänsch Date: Mon, 14 Aug 2023 23:40:28 +0000 (+0200) Subject: stub for changelog and translation info X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=f8aef4eba181cf0ff368b96ffd26bdc30bd67852;p=shellwiki stub for changelog and translation info --- diff --git a/macros/changes b/macros/changes new file mode 100755 index 0000000..be4dfec --- /dev/null +++ b/macros/changes @@ -0,0 +1,48 @@ +#!/bin/sh + +. "$_EXEC/cgilite/cgilite.sh" +. "$_EXEC/tools.sh" +. "$_EXEC/acl.sh" + +LANGUAGES='' + +glob="/" depth=-1 +while [ $# -gt 0 ]; do case $1 in + --system) glob_system_pages=true; shift 1;; + :*) LANGUAGES="${LANGUAGES}${LANGUAGES:+ }${1#:}"; shift 1;; + --depth) depth="$2"; shift 2;; + *) glob="$1"; shift 1;; +esac; done + +printf '\n' +for l in $LANGUAGES; do printf '' "$l"; done +printf '\n\n' + +page_glob "$glob" "$depth" |while read page; do + acl_read "$page" || continue + + printf '' + read ostamp odate <<-EOF + $(git -C "$_DATA" log --pretty="format:%at %ar" -- "pages/${page}#page.md") + EOF + printf '' "$(HTML "$page")" "$(HTML "$page")" "${odate}" + + for l in $LANGUAGES; do + if [ -f "${_DATA}/pages/${page}:${l}/#page.md" ]; then + read lstamp ldate <<-EOF + $(git -C "$_DATA" log --pretty="format:%at %ar" -- "pages/${page}:${l}/#page.md") + EOF + if [ $lstamp -lt $ostamp ]; then + printf '' "$(HTML "${page}:${l}")" "$ldate" + else + printf '' "$(HTML "${page}:${l}")" "$ldate" + fi + else + printf '' "$(HTML "${page}:${l}")" + fi + done + + printf '\n' +done + +printf '
Page%s
%s%soutdated%scurrent%smissing
'