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 # Iterate through entries sorted by lastmod of their source files, write entry.
19 # FIXME: This ls parsing is a bad way to loop through the sorted files. Besides,
20 # $('\0') is a bashism.
22 files=`ls -1t *.rst *.md | tr '\n' $'\0'`
25 for file in $files; do
26 if [ "$first_run" -lt "1" ]; then
30 intermediate_file="${file%.*}.intermediate"
31 html_file="${file%.*}.html"
32 redo-ifchange "$intermediate_file"
33 redo-ifchange "$html_file"
34 title_html=`cat "$intermediate_file" | head -1`
35 html_file_escaped=`escape_url "$html_file"`
36 printf "<li><a href=\"%s\" />%s</a></li>\n" "$html_file_escaped" "$title_html"
39 printf "</ul>\n</body>\n</html>"