3 # Pull in dependencies.
5 src_file=$(get_source_file "$1")
6 intermediate_file="${1%.index_snippet}.intermediate"
7 redo-ifchange "$intermediate_file"
8 html_file="${src_file%.*}.html"
9 redo-ifchange "$html_file"
10 template_file=index_snippet.tmpl
11 redo-ifchange "$template_file"
14 title=$(cat "$intermediate_file" | head -1 | prep_sed)
15 link=$(escape_url "${1%.index_snippet}.html" | prep_sed)
17 # Put data into template.
18 template=$(cat "$template_file")
19 printf "%s\n" "$template" | \
20 sed 's/%TITLE%/'"$title"'/g' | \
21 sed 's/%LINK%/'"$link"'/g' | \