summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgenerate_gallery.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/generate_gallery.pl b/generate_gallery.pl
index 978857d..8373fd2 100755
--- a/generate_gallery.pl
+++ b/generate_gallery.pl
@@ -17,8 +17,9 @@ my %opts = ();
$opts{template} = "$templatedir/template.html";
$opts{thumbnailsize} = 200;
+$opts{basepath} = "";
-GetOptions(\%opts, "exif|e", "verbose|v", "help|h", "filenamedesc", "template=s", "thumbnailsize|s=i", "htmlonly") or pod2usage(2);
+GetOptions(\%opts, "exif|e", "verbose|v", "help|h", "filenamedesc", "template=s", "thumbnailsize|s=i", "htmlonly", "basepath=s") or pod2usage(2);
pod2usage(0) if $opts{help};
pod2usage(-verbose => 0) if (@ARGV== 0);
@@ -77,8 +78,8 @@ for my $dir (@ARGV) {
$html .= "<div class=\"thumbnail\">\n";
$html .= "<a rel=\"images\" class=\"thumbnail\" ";
$html .= "title=\"$description\" " if $description;
- $html .= "href=\"$file\">\n";
- $html .= "<img class=\"thumbnail\" alt=\"\" src=\"thumbs/$file\" />\n";
+ $html .= "href=\"$opts{basepath}$file\">\n";
+ $html .= "<img class=\"thumbnail\" alt=\"\" src=\"$opts{basepath}thumbs/$file\" />\n";
$html .= "</a>\n</div>\n";
}
open TEMPLATE, "<", "$opts{template}";
@@ -115,6 +116,7 @@ generate_gallery.pl [options] <directory ...>
--htmlonly don't copy the fancybox directory
--thumbnailsize, -s <size> change size of the thumbnails in pixels
(default: 200)
+ --basepath <string> Prepend this path to the URLs in the output HTML
=head1 DESCRIPTION
@@ -156,6 +158,10 @@ Only generate thumbnails and the html file. This disables copying of fancybox.
Change the size of the generated thumbnails in pixels. Default: 200
+=item B<--basepath> <string>
+
+Prepend this path to the URLs in the output HTML. The path should probably end with a /.
+
=back
=cut