From efbe8e78a32e14e791f764ae80397c5d5b13f3b9 Mon Sep 17 00:00:00 2001 From: zeldakatze Date: Wed, 8 Oct 2025 10:23:53 +0200 Subject: updated the generator. Added a robots.txt --- qdsg.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) (limited to 'qdsg.sh') diff --git a/qdsg.sh b/qdsg.sh index 28bbb07..41cd9b5 100755 --- a/qdsg.sh +++ b/qdsg.sh @@ -1,14 +1,61 @@ #!/bin/bash +run_ffmpeg_if_not_exist() { + local vid_input = $1 + local out_basename = $2 + local vid_codec = $3 + + ffmpeg -i "$vid_input" -c:v "$vid_codec" +} + +# generates multiple resolution for the given video files. +# $1: file name +# @return +encode_video() { + # name the input + local vid_input = $1 + local vid + + +} + +# ensure that the necessary directories exist mkdir -p out/ +mkdir -p out/video/mp4/ + +# copy robots.txt +echo "Copying robots.txt" +cp robots.txt out/ +# process every html site for inFile in in/*.html; do [ -e "$inFile" ] || continue echo "Processing file $inFile" filename=$(basename "$inFile") outFile="out/$filename" - cat header.html > "$outFile" - cat "$inFile" >> "$outFile" + + # get the title of the file if it is noted in the file + site_title="" + firstline=$(cat $inFile | head -n1) + [[ $firstline == TITLE:* ]] && { + site_title="$(echo $firstline | sed 's/TITLE: //g') - " + } + + # assemble the page + cat header.html | sed "s/%SITE_TITLE%/$site_title/g" > "$outFile" + if [[ $firstline == TITLE:* ]]; then + cat "$inFile" | tail -n +2 >> "$outFile" + else + echo -en "\t" && echo "$filename does not seem to have a title!" + cat "$inFile" >> "$outFile" + fi + cat footer.html >> "$outFile" done + +for inFile in videos/*; do + sleep 0 +done + + -- cgit v1.2.3