From e1e6ff8139a66ff1317df8f1e82d5103f190f8c5 Mon Sep 17 00:00:00 2001 From: notkoutsie Date: Fri, 14 Jul 2023 21:56:28 +0300 Subject: [PATCH] add some settings + get rid of the horrendeous favicon monster --- noter.sh | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/noter.sh b/noter.sh index 4343800..7a4eb88 100755 --- a/noter.sh +++ b/noter.sh @@ -1,12 +1,38 @@ #!/bin/bash # noter 1.0.2 - @k@layer8.space - mit +# ---- ---- ---- Useless Settings +favicon="favicon.png" + +# Show stuff at the bottom of the page: +showgenerator=true # Shows "generated with noter" +backtotop=true # Shows a back to top button for easier navigation +lastupdated=true # If we should show last update time at the bottom too + nlog() { local ORANGE='\033[0;33m' local NO_COLOR='\033[0m' echo -e "${ORANGE}[noter] | ${1} ${NO_COLOR}" } +checksetting() { + # Use this function to check for a setting without repetition + # Eg: + # checksetting "yourmom" "$isyourmom" + if [ "$2" = true ]; then + echo "$1" >>"$output_file" + fi +} + +givefavicon() { + local file_path="$1" + + if [ -f "$file_path" ]; then + local base64_data="$(base64 -w 0 "$file_path")" + echo "data:image/png;base64,$base64_data" + fi +} + generate_note_html() { local note_date="$(date -d "$(basename "$1" .txt)" +"%B %d, %Y")" echo "
" @@ -33,8 +59,7 @@ echo " - - +