Add support for setting a directory to publish to

This commit is contained in:
Siina Mashek 2024-02-17 16:14:45 +02:00
parent 4a07ca6cb5
commit a8bfa8de77
2 changed files with 10 additions and 1 deletions

View File

@ -6,6 +6,7 @@ lastupdated="true"
site_title="koutsie's telenotes"
site_description="thoughts about mainly computers... maybe recipes and cats too?"
site_link="https://k0.tel/"
publish_dir="."
# Put CSS between <<EOF and EOF
site_css=$(cat <<EOF

View File

@ -133,8 +133,16 @@ generate_rss_feed() {
# godspeed notecount...
notecount=$(find notes -name "*.txt" ! -empty | wc -l)
if [[ ! -e $publish_dir ]]; then
mkdir $publish_dir
elif [[ ! -d $publish_dir ]]; then
echo "$dir already exists but is not a directory" 1>&2
exit
fi
# Create HTML file
output_file="index.html"
output_file="$publish_dir/index.html"
echo "<!DOCTYPE html>
<html>
<head>