Permalink
Browse files

Replace the entire noscript section

Previously, the code only replaced the h2 element within the noscript
of the template file, but this did not work on subsequent runs. The h2
was gone and the replacement no longer worked. This commit replaces
the entire noscript tag with a new noscript tag containing the
overview we need, an so subsequent runs work as expected.
  • Loading branch information...
kensanata committed Jan 8, 2017
1 parent 64321e2 commit 75e0dab285b1abcd89a368f300882cd93a65082d
Showing with 1 addition and 1 deletion.
  1. +1 −1 fgallery
@@ -887,7 +887,7 @@ my $html = join("\n\t", map {
. qq{<img src="thumbs/$fbase" alt="$caption"/></a>} . qq{<img src="thumbs/$fbase" alt="$caption"/></a>}
} @aprops); } @aprops);
my $index = slurp("$out/index.html"); my $index = slurp("$out/index.html");
$index =~ s!<h2>.*?</h2>!<div id="photos">\n\t$html\n </div>!; $index =~ s!<noscript>.*?</noscript>!<noscript>\n <div id="photos">\n\t$html\n </div>\n </noscript>!s;
unless(open($fd, ">:encoding($ENCODING)", "$out/index.html")) { unless(open($fd, ">:encoding($ENCODING)", "$out/index.html")) {
fatal("cannot write new index file: $!"); fatal("cannot write new index file: $!");
} }

0 comments on commit 75e0dab

Please sign in to comment.