diff --git a/build.sh b/build.sh index fcec28f..c02b324 100755 --- a/build.sh +++ b/build.sh @@ -69,9 +69,9 @@ add_header_and_footer() { } replace_vars() { -# Loop through 'meta_key' array, search for the first occurence of the values in the HTML doc, and replace them with corresponding values in 'meta_value'. +# Loop through 'meta_key' array, search for all occurences of the values in the HTML doc, and replace them with corresponding values in 'meta_value'. for index in $(seq 0 `expr "${#meta_key[@]}" - 1`); do - sed -i "0, /[\$][\$]${meta_key[$index]}[\$][\$]/ {s/[\$][\$]${meta_key[$index]}[\$][\$]/${meta_value[index]}/}" $1 + sed -i "s/[\$][\$]${meta_key[$index]}[\$][\$]/${meta_value[index]}/g" $1 done } @@ -108,6 +108,26 @@ md_to_html() { done } +gen_index_page() { # Generate an index page (site map) that includes links to the other pages + files=$(find $BASE_PATH/output -name "*.html") + + for file in $files; do + title=$(cat $file | grep "