ussg

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit e5a3b2087a2cb34f0772545e1e07a8d6f2d90cde
parent 26c60fff13113a1126bad519b9bbe3ccc7a30462
Author: Lightning <lightning@chatspeed.net>
Date:   Thu,  1 Jan 2026 12:17:26 +0000

prelim suffix support for ussg-page/plugins/navbar.tm

Diffstat:
Mplugins/navbar.tm | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/plugins/navbar.tm b/plugins/navbar.tm @@ -10,10 +10,15 @@ proc navbar {} { # So, the user wants a side navbar, huh? # We'll have to look in the Navbar-Source header. set prefix "" + set suffix "" + set urlprefix "" if {![catch {dict get $::headers navbar-prefix} navprefix]} {set prefix [file normalize $navprefix]} # This is the prefix that is assumed to be on $::outputfile during generation. This is used to calculate "this page." - if {![catch {dict get $::headers url-prefix} urlprefix]} {set prefix [file normalize $navprefix]} + if {![catch {dict get $::headers navbar-suffix} navsuffix]} {set suffix [file normalize $navsuffix]} + # This is the suffix that is assumed to be on $::outputfile during generation, but may not be in the link. This is used to calculate "this page." + + if {![catch {dict get $::headers url-prefix} curlprefix]} {set urlprefix [file normalize $curlprefix]} # This is the prefix that is assumed to be on URLs but not on $::outputfile during generation. This is used to calculate "this page." if {[catch {dict get $::headers navbar-title} navtitle]} {set navtitle ""} @@ -51,6 +56,7 @@ proc navbar {} { if {[string index $path 0] == "/"} { # then we can see if it's this path if {[file normalize [format "%s/%s" $prefix $path]] == [file normalize $outputfile]} {set isthispath 1} + if {[file normalize [format "%s/%s%s" $prefix $path $suffix]] == [file normalize $outputfile]} {set isthispath 1} } if {$isthispath} { puts $::outputfd [format "<li><a href=\"%s\" class=\"thisPage\">&raquo; <i>%s</i></a></li>" $path $label]