]> git.plutz.net Git - shellwiki/commitdiff
work around for linking to page view from handler sub pages (i.e. revision pages)
authorPaul Hänsch <paul@plutz.net>
Mon, 23 May 2022 17:42:27 +0000 (19:42 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 23 May 2022 17:42:27 +0000 (19:42 +0200)
handlers/90_brackets.sh
themes/default.sh

index dadd6445f663c80abb3a03d3ed9e6bd5c570d121..1f11cf4448697124a7b4fdfe08a2f64cc42aecae 100755 (executable)
@@ -6,6 +6,10 @@
 # attachment and edit (and really all) handlers should take precedence
 
 case "${PATH_INFO}" in
+  */\[view\])
+    # explicit view handler for linking
+    REDIRECT "${_BASE}${PATH_INFO%\[view\]}"
+    ;;
   */)
     if [ ! "$(mdfile "${PATH_INFO}")" ]; then
       theme_error 404
index 001dd3caa85d1ca95825359afa8d69f47b0d3600..89d4fad6c12c934dc71dd2f61a89903c6592676b 100755 (executable)
@@ -24,7 +24,7 @@ theme_pagemenu(){
   if acl_write "$page"; then
     printf  '
     <ul class="pagemenu">
-      <li><a href="./">View</a></li>
+      <li><a href="./[view]">View</a></li>
       <li><a href="./[edit]">Edit</a></li>
       <li><a href="./[attachment]">Attachments</a></li>
       <li><a href="./[revision]">Revisions</a></li>