diff options
| author | lemurianmage <azureazure@disroot.org> | 2026-06-22 23:03:23 +0200 |
|---|---|---|
| committer | lemurianmage <azureazure@disroot.org> | 2026-06-22 23:03:23 +0200 |
| commit | 95363147e9f8cf3186531e5f249d3869abc622e6 (patch) | |
| tree | fbb503e470c6bfdf2828fb4ee9616840942a6b4a /template.pl | |
| parent | fb6d875e98a3d1211b4d275b6c012679ac26c446 (diff) | |
| download | slimegirl.nexus-markdown-rewrite.tar.gz | |
lowdown for templating nowmarkdown-rewrite
Diffstat (limited to 'template.pl')
| -rwxr-xr-x | template.pl | 17 |
1 files changed, 2 insertions, 15 deletions
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 @ <article> -$dom->at('article')->content($content); - -# replace <title> 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]; |
