3 # Pull in global dependencies.
5 . "$metadata_dir"/helpers.sh
7 title_file="$metadata_dir"/title
8 redo-ifchange "$title_file"
16 blog_title=`read_and_escape_file "$title_file" | head -1`
17 printf "<title>%s</title>\n</head>\n<body>\n" "$blog_title"
18 printf "<h1>%s</h1>\n<ul>\n" "$blog_title"
20 # Generate link list entries.
21 tmp_snippets_dir=.tmp_index_snippets
22 mkdir -p "$tmp_snippets_dir"
23 for file in ./*.rst ./*.md; do
24 if [ -e "$file" ]; then
25 uuid_file="${metadata_dir}/${file%.*}.uuid"
26 redo-ifchange "$uuid_file"
27 published=`stat -c%y "${uuid_file}"`
28 published_unix=$(date -u "+%s%N" -d "${published}")
29 snippet_file="${metadata_dir}/${file%.*}.index_snippet"
30 redo-ifchange "$snippet_file"
31 ln -s "$srcdir/$snippet_file" "./${tmp_snippets_dir}/${published_unix}"
36 for file in ./${tmp_snippets_dir}/*; do
37 touch ./${tmp_snippets_dir}/list
38 cat "$file" ./${tmp_snippets_dir}/list > ./${tmp_snippets_dir}/tmp
39 mv ./${tmp_snippets_dir}/tmp ./${tmp_snippets_dir}/list
41 if [ -e "./${tmp_snippets_dir}/list" ]; then
42 cat ./${tmp_snippets_dir}/list
44 rm -rf "${tmp_snippets_dir}"
47 printf "</ul>\n</body>\n</html>"