summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--favicon.icobin0 -> 16958 bytes
-rw-r--r--frame.html.templ18
-rwxr-xr-xkatana.raku24
3 files changed, 18 insertions, 24 deletions
diff --git a/favicon.ico b/favicon.ico
new file mode 100644
index 0000000..720413a
--- /dev/null
+++ b/favicon.ico
Binary files differ
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 };
}