X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=Documentation%2Ftxt2pre;h=7cab0fa259ead40462c19599a6404ee5b3ed0463;hb=73fe3421f1ecbdc83600d5acfc643c33dbb9a0f2;hp=2f1799fc15e70d42f416a16500a80b5f9d14a457;hpb=50f05cb638a643c70d5a78eb9cc40bdcc890ce87;p=public-inbox.git diff --git a/Documentation/txt2pre b/Documentation/txt2pre index 2f1799fc..7cab0fa2 100755 --- a/Documentation/txt2pre +++ b/Documentation/txt2pre @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (C) 2014-2016 all contributors +# Copyright (C) 2014-2019 all contributors # License: AGPL-3.0+ # # Stupid script to make HTML from preformatted, utf-8 text versions, @@ -11,8 +11,7 @@ use PublicInbox::Linkify; use PublicInbox::Hval qw(ascii_html); my $str = eval { local $/; <> }; -my $title = $ENV{TITLE}; -($title) = ($str =~ /\A([^\n]+)/) unless $title; +my ($title) = ($str =~ /\A([^\n]+)/); $title = ascii_html($title); my $l = PublicInbox::Linkify->new; $str = $l->linkify_1($str); @@ -23,3 +22,9 @@ print '', qq(), "$title", "
",  $str , '
'; + +# keep mtime on website consistent so clients can cache +if (-f STDIN && -f STDOUT) { + my @st = stat(STDIN); + utime($st[8], $st[9], \*STDOUT); +}