perl: cover image of some cute camels
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 10 Jun 2024 23:22:54 +0000 (01:22 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 10 Jun 2024 23:22:54 +0000 (01:22 +0200)
Some kind of recognisable preview in Mastodon links.

Makefile
perl.plp
tools/mkimgthumb

index 7db808b04a03d1577d276026f9d05773b42a08b6..19fe1d174ba857a25383d784b66d83383cec7c2a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -86,6 +86,11 @@ data/xcolors: $(download)
 data/termcol-xcolor.inc.pl: tools/mktermcol-xcolor data/xcolors/themes
        $(call cmdsave,$^/*)
 
+data/camels.pexels-4321178.jpg:
+       tools/wget-ifmodified https://images.pexels.com/photos/4321178/pexels-photo-4321178.jpeg $@
+data/camels.jpg: data/camels.pexels-4321178.jpg
+       tools/mkimgthumb --jpg 800x400 'data/camels.smaller:-area:0x225.jpg' .
+
 data/wordlist.version.txt: force
        @[ -e $@ ] || date -Is >$@
        tools/lastword $@ || true
index 0ee9639da43603d99bdb4a47d090e02d595b4d9f..590cefa227b394355111725c814d77bcc027f22b 100644 (file)
--- a/perl.plp
+++ b/perl.plp
@@ -2,11 +2,12 @@
 
 Html({
        title => 'perl version cheat sheet',
-       version => '1.7',
+       version => '1.8',
        keywords => [qw'
                perl version feature features comparison
                sheet cheat overview summary
        '],
+       image => 'data/camels.jpg',
        stylesheet => [qw'light dark red'],
        data => ['perl.inc.pl'],
 });
index e9d6eb2159286003a9ccc6c28412334d2d01ee70..fae98690b44ca18b1756ab2cc6452cea27865b8b 100755 (executable)
@@ -40,10 +40,10 @@ for my $src (@ARGV) {
        my ($name, @cmds) = split /:(?<!\\:)/, $src =~ s/\.(\w+)\z//r;
        my $ext = $1 // '*';
        print $name;
-       next if $name =~ m/\./;
        unless (-e $src) {
                ($src) = grep {-e} glob qq<"$name"{,:*}.$ext> or next;
        }
+       $name =~ s/\..*//;
        s/\\(.)/$1/g for @cmds;
        print ':';