diff --git a/kewt.sh b/kewt.sh index 9a4c49c..1095754 100755 --- a/kewt.sh +++ b/kewt.sh @@ -31,7 +31,7 @@ style = "kewt" dir_indexes = true single_file_index = true flatten = false -footer = "made with kewt" +footer = "made with kewt" logo = "" display_logo = false display_title = true @@ -60,6 +60,7 @@ EOF
{{CONTENT}}
+ EOF @@ -172,10 +173,25 @@ favicon="" load_config() { [ -f "$1" ] || return - while IFS='= ' read -r key val; do - val=$(echo "$val" | tr -d '" ' | tr -d "'") + while IFS= read -r line; do + case "$line" in + ''|'#'*) continue ;; + *=*) ;; + *) continue ;; + esac + + key=${line%%=*} + val=${line#*=} + + key=$(printf '%s' "$key" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//') + val=$(printf '%s' "$val" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//') + case "$val" in + \"*\") val=${val#\"}; val=${val%\"} ;; + \'*\') val=${val#\'}; val=${val%\'} ;; + esac + case "$key" in - title) ;; + title) title="$val" ;; style) style="$val" ;; dir_indexes) dir_indexes="$val" ;; single_file_index) single_file_index="$val" ;; @@ -188,9 +204,6 @@ load_config() { favicon) favicon="$val" ;; esac done < "$1" - - t=$(grep "^title" "$1" | cut -d= -f2- | sed 's/^[ "]*//;s/[ "]*$//') - [ -n "$t" ] && title="$t" } load_config "./site.conf" diff --git a/styles/kewt.css b/styles/kewt.css index 33e85c9..db668b3 100644 --- a/styles/kewt.css +++ b/styles/kewt.css @@ -177,6 +177,7 @@ footer { padding-top: 80px; font-style: italic; font-size: 17px; + margin-bottom: 20px; } article, diff --git a/template.html b/template.html index a7f5582..2e95156 100644 --- a/template.html +++ b/template.html @@ -16,5 +16,6 @@
{{CONTENT}}
+