#!/bin/bash # clear out the old files and copy back the files [ -x output ] && rm -rf output/ && mkdir output [ ! -x output ] && mkdir output # just in case ö_ö cp -r ressources-orig output/ressources insHeader(){ #takes $1 for the title cat <<< '' cat <<< ' ' cat <<< "$1" cat <<< ' ' } insNavbar(){ cat <<< '
' # end navbar content } insFooter(){ cat <<< ' ' cat <<< ' ' cat <<< '' } genHTML(){ content=$1 # name of the file without ending as title for the webpage insHeader $(basename $content .html) # insert the navigation bar insNavbar # insert the body cat <<< '' # main content cat $content # insert the script links and footer insFooter } for content in content/*.html do genHTML $content > output/$(basename $content) done