]> git.plutz.net Git - shellwiki/blobdiff - handlers/40_revision.sh
Merge commit '6bc502434737d7f08379e79b94fc6fda424ef779'
[shellwiki] / handlers / 40_revision.sh
index 1ab4649ef3c1ddc9a7db7d61621b3b5bc2abf760..e06a95b16843b256a3610a21aa41a03d0373d2a6 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright 2022 - 2023 Paul Hänsch
+# Copyright 2022 - 2024 Paul Hänsch
 # 
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -19,11 +19,12 @@ case "${PATH_INFO}" in
     REDIRECT "${_BASE}${PATH_INFO%/}"
     ;;
   */\[revision\])
-    if ! acl_read "${PATH_INFO%\[revision\]}"; then
+    page="${PATH_INFO%\[revision\]}"
+    if ! acl_read "${page}"; then
       theme_error 403
     else
-      "$_EXEC/macros/revisions" --list --diff "$page" \
-      | theme_revisions -
+      "$_EXEC/macros/revisions" --list --diff "${page}" \
+      | theme_revisions - "$(_ Revisions): ${PAGE_TITLE:-"${page##*/}"}"
     fi
     return 0
     ;;
@@ -40,7 +41,7 @@ case "${PATH_INFO}" in
       cd "${_DATA}/pages${page}" || cd "${_DATA}/pages/"
       git -C "${_DATA}" show "${rev}:pages${PATH_INFO}#page.md" \
       | { printf '<article class="revision">'; md; printf '</article>'; } \
-      | theme_page - "${page##*/}"
+      | theme_page - "${PAGE_TITLE:-"${page##*/}"} (${rev})"
     )
     fi
     return 0