Compare commits

..

No commits in common. "81fd16023d7d97e31ca32290a40ce5ebd9b81aae" and "ba65e5b0d9076b9102d0eb4fcb28594fc6f15e7c" have entirely different histories.

2 changed files with 8 additions and 16 deletions

5
TODO
View File

@ -3,11 +3,6 @@ Improvements
* Order article list by last modified
* Add support for article description in list
* Add support for html files in srcdir, currently they are being copied but no
link is generated
* Convert links to present .md files to .html
* Add support for a ignore list (.rivetignore) maybe per-folder
* MORE COMMENTS
Additions
=========

View File

@ -46,10 +46,10 @@ convert() {
tmpfile="tmpconvfile.tmp"
infile="$1"
outfile="${infile%???}.html"
cp "$infile" "$tmpfile"
cp "$1" "$tmpfile"
# TODO: convert links to .md to .html
lowdown -s -Thtml -o "$outfile" "$tmpfile"
rm -f "$tmpfile" "$infile"
rm -f "$tmpfile" "$1"
}
# Check dependencies
@ -87,7 +87,6 @@ srcdir=${src%%\/}
unset src
headerfile=$srcdir/_header.html
footerfile=$srcdir/_footer.html
filelist=filelist.tmp
# Check if index.md is present
if ! [ -e "$srcdir"/index.md ]; then
@ -133,15 +132,11 @@ mkdir -p "$destdir"
cp -r "$srcdir"/* "$destdir"
rm -f "$destdir"/_header.html "$destdir"/_footer.html
# Generate an ordered (by open time) file list
find "$srcdir" -type f -name "*.md" -exec ls -1t {} + > "$filelist"
sed -i "s,^\/*[^\/]*\/,$destdir/," "$filelist"
# Convert markdown files
find "$destdir" -name "*.md" |
while IFS="" read -r file; do
convert "$file"
done < "$filelist"
sed -i 's/\.md$/\.html/' "$filelist"
done
# Prepare the header
if ! [ "$SKIP_HEADER" ]; then
@ -166,10 +161,12 @@ fi
# Prepare the sitemap & file list
if ! [ "$SKIP_SITEMAP" ] || ! [ "$SKIP_LIST" ]; then
linklist="linklist.tmp"
# echo "" > "$linklist"
rm -f "$linklist" "$destdir"/sitemap.xml
find "$destdir" -name "*.html" |
while IFS="" read -r file; do
echo "${file#$destdir/}" >> "$linklist"
done < "$filelist"
done
if ! [ "$SKIP_LIST" ]; then
tmpfile="linkindex.tmp"
@ -209,7 +206,7 @@ EOF
done < "$linklist"
sed -i 's/^<url>/\t<url>/' "$destdir"/sitemap.xml
fi
rm -f "$linklist" "$filelist"
rm -f "$linklist"
fi
exit