From 444212be46da3c375980b82d3828d7232417e4ac Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 25 Mar 2015 17:51:02 +0200 Subject: [PATCH] Preload logo --- lib/Plack/App/Gruntmaster/HTML.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index a595331..b4a0800 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -78,9 +78,13 @@ sub _render { $tree->as_HTML; } +my $logo = read_file 'mclogo.svg'; +$logo =~ y/\n//d; +$logo =~ s/(\s+)/ /g; + sub process_skel { my ($tree, %args) = @_; - $tree->fid('logo')->replace_with(literal scalar read_file "mclogo.svg"); + $tree->fid('logo')->replace_with(literal $logo); $tree->content_handler( title => $args{title}, content => literal $args{meat}); -- 2.39.2