From fde2090ab9f9dff34ea111019b795d6697454e4a Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 22 Feb 2023 13:47:50 +0300 Subject: [PATCH] .html inclusion --- README | 10 +++++----- galgen.zsh | 12 ++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README b/README index 36251cc..ae9d26d 100644 --- a/README +++ b/README @@ -19,12 +19,12 @@ If it is JPEG XL, then, for compatibility reason with non-bleeding edge software, alternative format is generated too: either JPEG (if JPEG XL contains losslessly transcoded JPEG), or PNG (leaving off the alpha channel). -If image file has corresponding .txt, then it will be included as a -preformatted text on HTML page. +If image file has corresponding .txt/.html, then it will be included on +HTML page. -All images are sorted my modification date and grouped by pages, -linking them together. If directory contains ".txt", then it will be -included on the first page as a preformatted text. +All images are sorted my modification date and grouped by pages, linking +them together. If directory contains ".txt"/".html", then it will be +included on the first page. Following external utilities are called: djxl, jxlinfo, exiftool, pamtopng, pnmscale, pngcrush, advpng, webpinfo, dwebp, cwebp. diff --git a/galgen.zsh b/galgen.zsh index 0e03a3a..521f4c3 100755 --- a/galgen.zsh +++ b/galgen.zsh @@ -63,6 +63,7 @@ EOF cat ${img}.txt >> $dst echo "" >> $dst } + [[ -r ${img}.html ]] && cat ${img}.html >> $dst echo "
" >> $dst if [[ $img:e = jxl ]] ; then echo "
" >> $dst
@@ -128,10 +129,13 @@ EOF
     
 
 EOF
-    [[ $p -eq 1 ]] && [[ -r .txt ]] && {
-        echo "
" >> $dst
-        cat .txt >> $dst
-        echo "
" >> $dst + [[ $p -eq 1 ]] && { + [[ -r .txt ]] && { + echo "
" >> $dst
+            cat .txt >> $dst
+            echo "
" >> $dst + } + [[ -r .html ]] && cat .html >> $dst } [[ $p -eq 1 ]] || echo "<<<" >> $dst -- 2.44.0