From dc3526b18c7e473da3ba7cd1de4e88e7d6ee919a Mon Sep 17 00:00:00 2001 From: dangrain Date: Wed, 30 Apr 2025 12:59:25 +0200 Subject: [PATCH] Add blogr.sh --- blogr.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 blogr.sh diff --git a/blogr.sh b/blogr.sh new file mode 100644 index 0000000..45a49de --- /dev/null +++ b/blogr.sh @@ -0,0 +1,39 @@ + +echo "Enter filename (no extentions)" +read filename +filename="${filename}.html" + +echo "Enter blog title" +read title +postTitle="${title}" + +echo "Save - CTRL + D" +input_text=$(cat) + +formatted_text="" +while IFS= read -r line; do + formatted_text+="

${line}

\n" +done <<< "$input_text" + +formatted_title="" +while IFS= read -r line; do + formatted_title+="

${line}

\n" +done <<< "$postTitle" + + + +{ + echo "" + echo "" + echo "${postTitle}" + echo '' + echo '' + echo '' + echo "" + echo "" + echo -e "$formatted_title" + echo -e "$formatted_text" + echo "Home" + echo "" + echo "" +} > "$filename" \ No newline at end of file