footer fix

This commit is contained in:
2026-03-07 12:34:32 +01:00
parent 43f7e1afaa
commit 23b4dca128
3 changed files with 22 additions and 7 deletions

27
kewt.sh
View File

@@ -31,7 +31,7 @@ style = "kewt"
dir_indexes = true dir_indexes = true
single_file_index = true single_file_index = true
flatten = false flatten = false
footer = "made with <a href="https://git.krzak.org/N0VA/kewt">kewt</a>" footer = "made with <a href="https://kewt.krzak.org">kewt</a>"
logo = "" logo = ""
display_logo = false display_logo = false
display_title = true display_title = true
@@ -60,6 +60,7 @@ EOF
<nav id="side-bar">{{NAV}}</nav> <nav id="side-bar">{{NAV}}</nav>
<article>{{CONTENT}}</article> <article>{{CONTENT}}</article>
<footer>{{FOOTER}}</footer>
</body> </body>
</html> </html>
EOF EOF
@@ -172,10 +173,25 @@ favicon=""
load_config() { load_config() {
[ -f "$1" ] || return [ -f "$1" ] || return
while IFS='= ' read -r key val; do while IFS= read -r line; do
val=$(echo "$val" | tr -d '" ' | tr -d "'") 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 case "$key" in
title) ;; title) title="$val" ;;
style) style="$val" ;; style) style="$val" ;;
dir_indexes) dir_indexes="$val" ;; dir_indexes) dir_indexes="$val" ;;
single_file_index) single_file_index="$val" ;; single_file_index) single_file_index="$val" ;;
@@ -188,9 +204,6 @@ load_config() {
favicon) favicon="$val" ;; favicon) favicon="$val" ;;
esac esac
done < "$1" done < "$1"
t=$(grep "^title" "$1" | cut -d= -f2- | sed 's/^[ "]*//;s/[ "]*$//')
[ -n "$t" ] && title="$t"
} }
load_config "./site.conf" load_config "./site.conf"

View File

@@ -177,6 +177,7 @@ footer {
padding-top: 80px; padding-top: 80px;
font-style: italic; font-style: italic;
font-size: 17px; font-size: 17px;
margin-bottom: 20px;
} }
article, article,

View File

@@ -16,5 +16,6 @@
<nav id="side-bar">{{NAV}}</nav> <nav id="side-bar">{{NAV}}</nav>
<article>{{CONTENT}}</article> <article>{{CONTENT}}</article>
<footer>{{FOOTER}}</footer>
</body> </body>
</html> </html>