tagging: Allow using titles in for related stories.
[matthijs/upstream/blosxom-plugins.git] / barijaona / fix_static_url
1 # Blosxom plugin: fix-static-url
2 # Author(s): Barijaona Ramaholimihaso
3 # Version: 2004-08-22blosxom2
4 # Documentation: see bottom of file or perldoc title
5
6 package fix_static_url;
7 # ------------------ Configuration variables ---------------
8
9 use vars qw($static_url);
10
11 # Define here the url of your blog i.e. http://homepage.mac.com/barijaona
12 # alternatively, use the prefs plugin to define $fix_static_url::static_url
13 $static_url = "" ;
14
15 # ---------------------------------------------------------
16
17
18 sub start {
19         if ( $blosxom::static_or_dynamic eq 'static') {
20                 $saveurl = $blosxom::url;
21                 $blosxom::url = '*DEFANG_STATIC_URL*';
22                 return 1;
23          }
24          else {return 0 };
25 }
26
27 sub head {
28         $blosxom::url= $static_url;
29 }
30
31 sub last {
32         # for plugins who use $url before the head sub
33         $blosxom::output =~ s>\*DEFANG_STATIC_URL\*>$static_url>g; 
34         1;
35 }
36
37 1;
38 __END__
39 =head1 NAME
40
41 Blosxom Plug-in: fix_static_url
42
43 =head1 SYNOPSIS
44
45 This plugin corrects the $blosxom::url variable for static rendering.
46
47 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.
48
49 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
50 $fix_static_url::static_url.
51
52 =head1 VERSION
53
54 2004-08-22blosxom2
55
56 =head2 CHANGES
57
58 2004-08-22blosxom2 : First published version
59
60 =head1 AUTHOR
61
62 Barijaona Ramaholimihaso <blosxom@barijaona.com>
63
64 =head1 SEE ALSO
65
66 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net
67
68 Blosxom Plugin Docs: http://blosxom.sourceforge.net/plugins/
69
70 =head1 BUGS
71
72 None known; please send bug reports and feedback to the Blosxom development mailing list <blosxom-devel@lists.sourceforge.net>.
73
74 =head1 COPYRIGHT
75
76 This program is free software; you can redistribute
77 it and/or modify it under the same terms as Perl itself.
78
79 =cut