diff options
Diffstat (limited to 'bin/func')
-rw-r--r-- | bin/func | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -171,11 +171,32 @@ __generate_index() { echo "</ul>" } +__generate_metadata() { + # 1: filename + # Generate metadata with title + local _title + local _show_title + + _show_title=$(__get_value "${1}" show_title || true) + + if [ "${_show_title}" = "" ]; then + _title=$(__get_value_title "${1}") + + cat <<-EOF + <h1 id=\"${_title}\"> + ${_title} + </h1> + EOF + fi +} + __handle_md() { # 1: filename # Handle markdown files. __lowdown "${1}" > "${tmp_file}.body" + __generate_metadata "${1}" > "${tmp_file}.metadata" + if [ ! "$(__get_value ${1} index)" = "" ]; then __generate_index "${1}" > "${tmp_file}.index" else |