Skip to content

Commit

Permalink
Fix graphviz trees on static sites
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Aug 2, 2024
1 parent e93ede3 commit 04df4fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -8588,7 +8588,7 @@ sub print_person

if(defined($dot)) {
print "Create family tree\n" if($opts{'v'});
my $png = 'static-site/img/' . make_filename_from_object(object => $person) . '.png';
my $png = 'static-site/img/family-tree-' . $person->xref() . '.png';
my $tmp = File::Temp->new();
my $filename = $tmp->filename();
if(open(my $fout, '|-', "$dot -Tpng -o$png -Tcmapx -o$filename")) {
Expand Down Expand Up @@ -8646,7 +8646,7 @@ sub print_person
close $fout;

print $html '<h2>Family Tree</h2>';
my $filename = make_filename_from_object(object => $person);
my $filename = 'family-tree-' . $person->xref();
my $dim = Image::Info::html_dim(Image::Info::image_info($png));
print $html "<img src=\"img/$filename.png\" $dim", ' usemap="#family" alt="Family Tree">';
$tmp->seek(0, SEEK_SET);
Expand All @@ -8655,7 +8655,7 @@ sub print_person
print $html $line;
}
}
$png = "dynamic-site/img/" . make_filename_from_object(object => $person) . '.png';
$png = 'dynamic-site/img/family-tree-' . $person->xref() . '.png';
$tmp = File::Temp->new();
$filename = $tmp->filename();
binmode($tmp, ':utf8');
Expand Down Expand Up @@ -8718,7 +8718,7 @@ sub print_person
print $fout '}';
close $fout;

my $filename = make_filename_from_object(object => $person);
my $filename = 'family-tree-' . $person->xref();
my $dim = Image::Info::html_dim(Image::Info::image_info($png));
print $csv "/img/$filename.png---$dim---";
print $xml "\n\t\t<profile>/img/$filename.png</profile>";
Expand Down Expand Up @@ -12339,9 +12339,9 @@ sub make_filename_from_person

sub make_filename_from_object
{
my %params = (ref($_[0]) eq 'HASH') ? %{$_[0]} : @_;
my $params = get_params('object', @_);

my $object = $params{'object'};
my $object = $params->{'object'};

my $rc = $object->title();
if(!$rc) {
Expand Down

0 comments on commit 04df4fc

Please sign in to comment.