diff options
| author | Paul Buetow <paul@buetow.org> | 2022-04-15 21:47:33 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-04-15 21:47:33 +0100 |
| commit | 61ccafe143df1b25a9134a802130676405665b97 (patch) | |
| tree | 2bc7a6c1684a0a63c84413c10be864b11299fc3b | |
| parent | 8511cab2ccd79b8d6bc237548a8e4e6050d0b8c3 (diff) | |
refactor
| -rw-r--r-- | favicon.ico | bin | 0 -> 16958 bytes | |||
| -rw-r--r-- | frame.html.templ | 18 | ||||
| -rwxr-xr-x | katana.raku | 24 |
3 files changed, 18 insertions, 24 deletions
diff --git a/favicon.ico b/favicon.ico Binary files differnew file mode 100644 index 0000000..720413a --- /dev/null +++ b/favicon.ico diff --git a/frame.html.templ b/frame.html.templ index 4343552..00cf2d1 100644 --- a/frame.html.templ +++ b/frame.html.templ @@ -1,8 +1,12 @@ -<html> - <head> - <title>{title}</title> - </head> - <body> - {body} - </body> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>{title}</title> +<link rel="shortcut icon" type="image/gif" href="favicon.ico" /> +<link rel="stylesheet" href="style.css" /> +</head> +<body> + {body} +</body> </html> diff --git a/katana.raku b/katana.raku index 2b9b4fd..48e7202 100755 --- a/katana.raku +++ b/katana.raku @@ -8,11 +8,6 @@ sub prefix:<❱>(*@args) { sub prefix:<⁉>(*@args) { ❱ @args unless @args[*-1].IO.f } -class Template { - has Str %!vars; - has Str $!frame = 'frame.html'; -} - class Image { has Str $.filename; has Str $!source; @@ -39,16 +34,15 @@ class Image { method large_tag { "<img class='large' src='./large/{$.filename}' />" } } -sub dist-dirs(Str $dist-dir --> List) { - $dist-dir <<~>> </large /blur /thumb> -} +sub dist-dirs(Str $dist-dir --> List) { $dist-dir <<~>> </large /blur /thumb> } +sub make-mr-proper(Str $dist-dir) { ❱ ['rm', '-rf', $dist-dir] if $dist-dir.IO.d } -sub ensure-directories(Str :$dist-dir) { +sub ensure-directories(Str $dist-dir) { mkdir $dist-dir unless $dist-dir.IO.d; mkdir $_ unless .IO.d for dist-dirs $dist-dir; } -sub cleanup-nonexistent (Str :$dist-dir, :@images) { +sub cleanup-nonexistent (Str $dist-dir, @images) { my $images = set @images.map:{ $_.filename }; for dist-dirs $dist-dir -> $dir { unlink $_ if .IO.basename ∉ $images @@ -56,10 +50,6 @@ sub cleanup-nonexistent (Str :$dist-dir, :@images) { } } -sub make-mr-proper(Str :$dist-dir) { - ❱ ['rm', '-rf', $dist-dir] if $dist-dir.IO.d; -} - multi MAIN( Bool :$mr-proper, #= Clean output dir Str :$in-dir = './in', #= Input dir @@ -75,9 +65,9 @@ multi MAIN( @images = @images.pick: * if $randomize; say "Found {@images.elems} images"; - cleanup-nonexistent :$dist-dir, :@images; - make-mr-proper :$dist-dir if $mr-proper; - ensure-directories :$dist-dir; + cleanup-nonexistent $dist-dir, @images; + make-mr-proper $dist-dir if $mr-proper; + ensure-directories $dist-dir; @images.hyper.map: { .generate: :$thumb-geometry, :$bg-blur }; } |
