diff options
author | zeldakatze <coffee@zeldakatze.de> | 2025-10-08 10:23:53 +0200 |
---|---|---|
committer | zeldakatze <coffee@zeldakatze.de> | 2025-10-08 10:23:53 +0200 |
commit | efbe8e78a32e14e791f764ae80397c5d5b13f3b9 (patch) | |
tree | d345547ac0fdad306b9c1fd9af194afad54fbb40 /qdsg.sh | |
parent | d0c9031ef9cbe6ea8e92a5f8d2114fad524864f4 (diff) | |
download | website-efbe8e78a32e14e791f764ae80397c5d5b13f3b9.tar.gz website-efbe8e78a32e14e791f764ae80397c5d5b13f3b9.zip |
Diffstat (limited to 'qdsg.sh')
-rwxr-xr-x | qdsg.sh | 51 |
1 files changed, 49 insertions, 2 deletions
@@ -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 + + |