I just stick and extra <title> tag in the HTML before the regular
album-generated one, which I'm sure isn't exactly standards compliant.
The browser seems to only show the first one that it encounters.
Any thoughts on a more elegant way to do this? What about just adding a
hook to header() that does:
my $title = $tAlbum $this;
$title = do_hooks($opt, $data, 'html_title', $dir, $album);
print ALBUM <<END_OF_HEADER;
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>
$title
</title>
...
---
# My hackish plugin
sub start_plugin {
my ($opt) = @_;
album::hook($opt,'write_index',\&add_title);
#album::hook($opt,'do_album_top',\&add_title);
return {
author => 'David Hansen',
href => 'http://www.sr71.net/',
version => '1.0',
description => "add a new title.",
};
}
sub add_title {
my $opt = shift;
my $data = shift;
my $hook_name = shift;
my $pic = shift;
return undef if ($pic ne '/home/mike/www');
my $js =<<END;
<title>Mike Hansen's photo album</title>
END
print STDERR $data->{head};
$data->{head} .= $js;
return undef;
}
1;
-- Dave