Conditionally set $hsty_base to http://www.FreeBSD.org/:

1. If we're not running under cgi (for the mailindex run out of cron)
 2. If we're running on docs.freebsd.org (because it doesn't have the
    style files, and the "home" link would point to docs home, not
    the home home)
 3. If we're running on people.freebsd.org, to facilitate my testing

Otherwise, keep it relative for the benefit of mirrors.

docs problem pointed out by: Mark Trettin (mkt AT trettin DOT org)
This commit is contained in:
Bill Fenner 2005-10-29 15:08:21 +00:00
parent 5639f63573
commit 97fa1675c8
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=26178

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.23 2005/10/28 14:55:13 fenner Exp $
# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.24 2005/10/28 19:07:36 fenner Exp $
#
# Perl routines to encapsulate various elements of HTML page style.
@ -9,7 +9,15 @@ $mo += 1;
$timestamp = "$mo-$md-$yr";
if (!defined($hsty_base)) {
$hsty_base = '..';
# $hsty_base should be relative if possible, so that mirrors
# serve their local copy instead of going to the main site.
# However, if we aren't running as a cgi, or if we're
# running on docs or people, use the absolute home path.
if (!defined($ENV{'HTTP_HOST'}) || $ENV{'HTTP_HOST'} =~ /(docs|people).freebsd.org/) {
$hsty_base = 'http://www.FreeBSD.org'
} else {
$hsty_base = '..';
}
}
if (!defined($hsty_email)) {
$hsty_email = 'www@FreeBSD.org';