second alpha (v0.2)
This commit is contained in:
parent
7a343254e2
commit
7a1094c733
22 changed files with 2343 additions and 1511 deletions
38
site_generator/functions/03_html_helpers.sh
Normal file
38
site_generator/functions/03_html_helpers.sh
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
# 03_html_helpers.sh - Funktionen zum Erstellen von Header und Footer
|
||||
|
||||
generate_html_header() {
|
||||
local current_page_title="$1"
|
||||
local relative_path_prefix="${2:-.}"
|
||||
local active_page_id="${3:-}"
|
||||
local active_class_home=""; local active_class_worlds=""; local active_class_downloads=""
|
||||
case "$active_page_id" in
|
||||
home) active_class_home="active" ;;
|
||||
worlds) active_class_worlds="active" ;;
|
||||
downloads) active_class_downloads="active" ;;
|
||||
esac
|
||||
|
||||
local header_file
|
||||
header_file=$(mktemp)
|
||||
render_template "${TEMPLATE_DIR_PATH}/html_header.template" "$header_file" \
|
||||
"current_page_title" "$current_page_title" \
|
||||
"relative_path_prefix" "$relative_path_prefix" \
|
||||
"active_class_home" "$active_class_home" \
|
||||
"active_class_worlds" "$active_class_worlds" \
|
||||
"active_class_downloads" "$active_class_downloads" \
|
||||
"CACHE_BUSTER" "$CACHE_BUSTER" \
|
||||
"SITE_TITLE" "$SITE_TITLE"
|
||||
cat "$header_file"
|
||||
rm "$header_file"
|
||||
}
|
||||
|
||||
generate_html_footer() {
|
||||
local footer_file
|
||||
footer_file=$(mktemp)
|
||||
render_template "${TEMPLATE_DIR_PATH}/html_footer.template" "$footer_file" \
|
||||
"CURRENT_YEAR" "$CURRENT_YEAR" \
|
||||
"SITE_TITLE" "$SITE_TITLE" \
|
||||
"SITE_OWNER_NAME" "$SITE_OWNER_NAME"
|
||||
cat "$footer_file"
|
||||
rm "$footer_file"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue