forked from bentglasstube/blosxom-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfix_static_url-v20040822
75 lines (49 loc) · 1.91 KB
/
fix_static_url-v20040822
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Blosxom plugin: fix-static-url
# Author(s): Barijaona Ramaholimihaso
# Version: 2004-08-22blosxom2
# Documentation: see bottom of file or perldoc title
package fix_static_url;
# ------------------ Configuration variables ---------------
use vars qw($static_url);
# Define here the url of your blog i.e. http://homepage.mac.com/barijaona
# alternatively, use the prefs plugin to define $fix_static_url::static_url
$static_url = "" ;
# ---------------------------------------------------------
sub start {
if ( $blosxom::static_or_dynamic eq 'static') {
$saveurl = $blosxom::url;
$blosxom::url = '*DEFANG_STATIC_URL*';
return 1;
}
else {return 0 };
}
sub head {
$blosxom::url= $static_url;
}
sub last {
# for plugins who use $url before the head sub
$blosxom::output =~ s>\*DEFANG_STATIC_URL\*>$static_url>g;
1;
}
1;
__END__
=head1 NAME
Blosxom Plug-in: fix_static_url
=head1 SYNOPSIS
This plugin corrects the $blosxom::url variable for static rendering.
When you use blosxom for rendering static pages, the $url variable refers to your local machine, which is rarely acurate, especially if you intend to upload the static files to a different server... You have to explicitly assign the $url variable in the source of blosxom, or you can use this plugin as an alternative.
You can assign the $static_url variable in the config section, or use the prefs plugin (the alternative to the config plugin for static rendering) to define
$fix_static_url::static_url.
=head1 VERSION
2004-08-22blosxom2
=head2 CHANGES
2004-08-22blosxom2 : First published version
=head1 AUTHOR
Barijaona Ramaholimihaso <http://homepage.mac.com/barijaona>
=head1 SEE ALSO
Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
=head1 COPYRIGHT
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
=cut