diff options
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -1,6 +1,7 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | basedir="$(pwd)" | 3 | basedir="$(pwd)" |
| 4 | bottomtmp="$(mktemp)" | ||
| 4 | 5 | ||
| 5 | recursivebuild() { | 6 | recursivebuild() { |
| 6 | local destdir=$(echo "$1" | sed 's|^src|http|') | 7 | local destdir=$(echo "$1" | sed 's|^src|http|') |
| @@ -44,7 +45,7 @@ copyfile() { | |||
| 44 | mdpreprocess "$file" | \ | 45 | mdpreprocess "$file" | \ |
| 45 | lowdown --html-no-skiphtml --html-no-escapehtml \ | 46 | lowdown --html-no-skiphtml --html-no-escapehtml \ |
| 46 | >> "$ind" | 47 | >> "$ind" |
| 47 | cat bottom.html >> "$ind" | 48 | cat "$bottomtmp" >> "$ind" |
| 48 | ;; | 49 | ;; |
| 49 | noheadermd) | 50 | noheadermd) |
| 50 | t="$(markdowntitle "$file")" | 51 | t="$(markdowntitle "$file")" |
| @@ -55,7 +56,7 @@ copyfile() { | |||
| 55 | ;; | 56 | ;; |
| 56 | html) | 57 | html) |
| 57 | t="$(htmltitle "$file")" | 58 | t="$(htmltitle "$file")" |
| 58 | cat top.html "$file" bottom.html | sed "s/TITLE/$t/" > "$ind" | 59 | cat top.html "$file" "$bottomtmp" | sed "s/TITLE/$t/" > "$ind" |
| 59 | ;; | 60 | ;; |
| 60 | raw) | 61 | raw) |
| 61 | namenoraw="$(basename "$file" | sed 's/\.raw$//')" | 62 | namenoraw="$(basename "$file" | sed 's/\.raw$//')" |
| @@ -118,7 +119,7 @@ makeblogindexandfeed() { | |||
| 118 | done | 119 | done |
| 119 | 120 | ||
| 120 | echo '</table>' >> "$bf" | 121 | echo '</table>' >> "$bf" |
| 121 | cat bottom.html >> "$bf" | 122 | cat "$bottomtmp" >> "$bf" |
| 122 | 123 | ||
| 123 | { echo ""; echo "</channel>"; echo "</rss>"; } >> "$ff" | 124 | { echo ""; echo "</channel>"; echo "</rss>"; } >> "$ff" |
| 124 | } | 125 | } |
| @@ -164,5 +165,6 @@ month() { | |||
| 164 | esac | 165 | esac |
| 165 | } | 166 | } |
| 166 | 167 | ||
| 168 | sed "s/LASTUPDATE/$(date +'%Y-%m-%d')/" <bottom.html >"$bottomtmp" | ||
| 167 | makeblogindexandfeed | 169 | makeblogindexandfeed |
| 168 | recursivebuild src | 170 | recursivebuild src |
