3 # Pull in global dependencies.
6 redo-ifchange "$title_file"
14 blog_title=`read_and_escape_file "$title_file" | head -1`
15 printf "<title>%s</title>\n</head>\n<body>\n" "$blog_title"
16 printf "<h1>%s</h1>\n<ul>\n" "$blog_title"
18 # Generate link list entries.
19 mkdir -p index_snippets
20 for file in ./*.rst ./*.md; do
21 if [ -e "$file" ]; then
22 uuid_file="${file%.*}.uuid"
23 redo-ifchange "$uuid_file"
24 published=`stat -c%y "${uuid_file}"`
25 published_unix=$(date -u "+%s%N" -d "${published}")
26 intermediate_file="${file%.*}.intermediate"
27 html_file="${file%.*}.html"
28 redo-ifchange "$intermediate_file"
29 redo-ifchange "$html_file"
30 title_html=`cat "$intermediate_file" | head -1`
31 html_file_escaped=`escape_url "${html_file#\./}"`
32 printf "<li><a href=\"%s\" />%s</a></li>\n" "$html_file_escaped" "$title_html" > ./index_snippets/${published_unix}
37 for file in ./index_snippets/*; do
38 touch ./index_snippets/list
39 cat "$file" ./index_snippets/list > ./index_snippets/tmp
40 mv ./index_snippets/tmp ./index_snippets/list
42 if [ -e "./index_snippets/list" ]; then
43 cat ./index_snippets/list
48 printf "</ul>\n</body>\n</html>"