summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/conf5
-rwxr-xr-xsrc/html8
2 files changed, 6 insertions, 7 deletions
diff --git a/src/conf b/src/conf
index b7aeb45..c39ebf2 100755
--- a/src/conf
+++ b/src/conf
@@ -51,7 +51,7 @@ dateepoch() {
}
-unset header_links categories custombody
+unset categories custombody
unset url_pre site_name feed_title feed_url feed_alternate_url
unset list_addr discussions_url_prefix
@@ -201,6 +201,8 @@ lastmod_formatted="$(datefmt "$lastmod_iso" | shesc)"
LEN="$( printf '%s..' "$root_dir" | sed -e 's|//|/|g' -e 's|/$||' | wc -c)"
lang="$(printf '%s' "$FILENAME" | cut -c "$LEN"- | cut -d/ -f1 | shesc)"
+header_links="$(printf '%s/%s.txt' "$headers_dir" "$lang" | shesc)"
+
BASE_URL="$(base_url)"
TITLE_RAW="$(cat -- "$FILENAME" | grep '^= .*' | head -n1 | cut -d' ' -f2- ||
@@ -282,6 +284,7 @@ cat <<-EOF
export comment_url="$comment_url"
export discussions_url="$discussions_url"
export lang="$lang"
+ export header_links="$header_links"
EOF
cat "$FILENAME".embedded-config
diff --git a/src/html b/src/html
index e208af9..e00a2b7 100755
--- a/src/html
+++ b/src/html
@@ -113,13 +113,9 @@ fi
headlinks() {
- if [ -z "${header_links:-}" ]; then
- return
- fi
-
echo ' <ol>'
- while read -r line; do
+ cat "$header_links" | grep -v '^#' | grep . | while read -r line; do
link="$(printf '%s\n' "$line" | cut -d' ' -f1)"
name="$(printf '%s\n' "$line" | cut -d' ' -f2)"
cat <<EOF
@@ -127,7 +123,7 @@ headlinks() {
<a href="$base_url_prefix/$link">$name</a>
</li>
EOF
- done < "$header_links"
+ done
echo ' </ol>'
}