From 95363147e9f8cf3186531e5f249d3869abc622e6 Mon Sep 17 00:00:00 2001 From: lemurianmage Date: Mon, 22 Jun 2026 23:03:23 +0200 Subject: lowdown for templating now --- template.pl | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'template.pl') diff --git a/template.pl b/template.pl index 5c97e61..793f9b3 100755 --- a/template.pl +++ b/template.pl @@ -11,22 +11,9 @@ use File::Basename; use open qw( :std :encoding(UTF-8) ); -my $template = do { - local $/; - open my $fh, '<', 'template.html'; - <$fh>; -}; +my $content = `lowdown --html-titleblock --html-no-head-ids -s --template template.html $ARGV[0]`; -my $dom = Mojo::DOM->new($template); - -my $content = `lowdown --html-no-head-ids $ARGV[0]`; - -# inject content @
-$dom->at('article')->content($content); - -# replace with the contents of the first <h1> -my $title_dom = $dom->at('h1'); -$dom->at('title')->content($title_dom->text) if ($title_dom); +my $dom = Mojo::DOM->new($content); # makes the up button go up a directory my $parent = dirname $ARGV[0]; -- cgit v1.2.3