From f8aef4eba181cf0ff368b96ffd26bdc30bd67852 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 15 Aug 2023 01:40:28 +0200 Subject: [PATCH] stub for changelog and translation info --- macros/changes | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 macros/changes 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
' -- 2.39.2