git: 64e54e27ba - main - no footer help link on help page (self reference)

Wolfram Schneider <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/doc/commit/?id=64e54e27ba37c9de522e6faefadcc7be728e611d

commit 64e54e27ba37c9de522e6faefadcc7be728e611d
Author:     Wolfram Schneider <[email protected]>
AuthorDate: 2023-10-03 11:44:19 +0000
Commit:     Wolfram Schneider <[email protected]>
CommitDate: 2023-10-03 11:44:19 +0000

    no footer help link on help page (self reference)
---
 website/content/en/cgi/man.cgi | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/website/content/en/cgi/man.cgi b/website/content/en/cgi/man.cgi
index 1f6889bce6..112312c590 100755
--- a/website/content/en/cgi/man.cgi
+++ b/website/content/en/cgi/man.cgi
@@ -51,6 +51,7 @@ $debug        = 2;
 $www{'title'} = 'FreeBSD Manual Pages';
 $www{'home'}  = 'https://www.FreeBSD.org';
 $www{'home_man'}  = 'https://man.FreeBSD.org';
+$www{'cgi_man'}  = '/cgi/man.cgi';
 $www{'head'}  = $www{'title'};
 
 # set to zero if your front-end cache has low memory
@@ -1117,14 +1118,10 @@ my $enable_intro = 0;
 sub html_footer {
     my %args = @_;
 
-    if (!$args{'no_home_link'}) {
-    print <<EOF;
-<span class="footer_links">
-  <a href="">home</a> |
-  <a href="/cgi/man.cgi/help.html">help</a>
-</span>
-EOF
-    }
+    print qq[<span class="footer_links">\n];
+    print qq[  <a href="$www{'cgi_man'}">home</a>\n] if !$args{'no_home_link'};
+    print qq[| <a href="$www{'cgi_man'}/help.html">help</a>\n] if !$args{'no_help_link'};
+    print qq[</span>\n\n];
 
     if (cgi_style::HAS_FREEBSD_CGI_STYLE) {
         print q{<hr noshade="noshade" />};
@@ -1958,7 +1955,7 @@ ETX
     if ($enable_section_indexes || $enable_intro) {
         print "<br />\n";
     }
-    &html_footer( 'no_home_link' => 1 );
+    &html_footer( 'no_home_link' => 1, 'no_help_link' => 1 );
 }
 
 sub formquery {
@@ -2050,8 +2047,8 @@ ETX
 
 <br/>
 <span class="footer_links">
-  <a href="">home</a> |
-  <a href="/cgi/man.cgi/help.html">help</a>
+  <a href="$www{'cgi_man'}">home</a> |
+  <a href="$www{'cgi_man'}/help.html">help</a>
 </span>
 ETX
     if ($query) {
@@ -2189,7 +2186,7 @@ sub faq_output {
     print &html_header( "FreeBSD manual page help", $base );
     print "<br/>\n<h1>$www{'head'}</h1>\n";
     print &faq . "<br/>\n";
-    &html_footer;
+    &html_footer('no_help_link' => 1);
 }
 
 sub html_header2 {
@@ -2232,10 +2229,6 @@ sub mydie {
     print &html_header("Error");
     print $message;
 
-    print qq{
-<p />
-<a href="$BASE">home</a>
-};
     &html_footer;
     exit(0);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.