Compare commits
No commits in common. "81fd16023d7d97e31ca32290a40ce5ebd9b81aae" and "ba65e5b0d9076b9102d0eb4fcb28594fc6f15e7c" have entirely different histories.
81fd16023d
...
ba65e5b0d9
5
TODO
5
TODO
@ -3,11 +3,6 @@ Improvements
|
|||||||
|
|
||||||
* Order article list by last modified
|
* Order article list by last modified
|
||||||
* Add support for article description in list
|
* 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
|
Additions
|
||||||
=========
|
=========
|
||||||
|
19
rivet.sh
19
rivet.sh
@ -46,10 +46,10 @@ convert() {
|
|||||||
tmpfile="tmpconvfile.tmp"
|
tmpfile="tmpconvfile.tmp"
|
||||||
infile="$1"
|
infile="$1"
|
||||||
outfile="${infile%???}.html"
|
outfile="${infile%???}.html"
|
||||||
cp "$infile" "$tmpfile"
|
cp "$1" "$tmpfile"
|
||||||
# TODO: convert links to .md to .html
|
# TODO: convert links to .md to .html
|
||||||
lowdown -s -Thtml -o "$outfile" "$tmpfile"
|
lowdown -s -Thtml -o "$outfile" "$tmpfile"
|
||||||
rm -f "$tmpfile" "$infile"
|
rm -f "$tmpfile" "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
@ -87,7 +87,6 @@ srcdir=${src%%\/}
|
|||||||
unset src
|
unset src
|
||||||
headerfile=$srcdir/_header.html
|
headerfile=$srcdir/_header.html
|
||||||
footerfile=$srcdir/_footer.html
|
footerfile=$srcdir/_footer.html
|
||||||
filelist=filelist.tmp
|
|
||||||
|
|
||||||
# Check if index.md is present
|
# Check if index.md is present
|
||||||
if ! [ -e "$srcdir"/index.md ]; then
|
if ! [ -e "$srcdir"/index.md ]; then
|
||||||
@ -133,15 +132,11 @@ mkdir -p "$destdir"
|
|||||||
cp -r "$srcdir"/* "$destdir"
|
cp -r "$srcdir"/* "$destdir"
|
||||||
rm -f "$destdir"/_header.html "$destdir"/_footer.html
|
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
|
# Convert markdown files
|
||||||
|
find "$destdir" -name "*.md" |
|
||||||
while IFS="" read -r file; do
|
while IFS="" read -r file; do
|
||||||
convert "$file"
|
convert "$file"
|
||||||
done < "$filelist"
|
done
|
||||||
sed -i 's/\.md$/\.html/' "$filelist"
|
|
||||||
|
|
||||||
# Prepare the header
|
# Prepare the header
|
||||||
if ! [ "$SKIP_HEADER" ]; then
|
if ! [ "$SKIP_HEADER" ]; then
|
||||||
@ -166,10 +161,12 @@ fi
|
|||||||
# Prepare the sitemap & file list
|
# Prepare the sitemap & file list
|
||||||
if ! [ "$SKIP_SITEMAP" ] || ! [ "$SKIP_LIST" ]; then
|
if ! [ "$SKIP_SITEMAP" ] || ! [ "$SKIP_LIST" ]; then
|
||||||
linklist="linklist.tmp"
|
linklist="linklist.tmp"
|
||||||
|
# echo "" > "$linklist"
|
||||||
rm -f "$linklist" "$destdir"/sitemap.xml
|
rm -f "$linklist" "$destdir"/sitemap.xml
|
||||||
|
find "$destdir" -name "*.html" |
|
||||||
while IFS="" read -r file; do
|
while IFS="" read -r file; do
|
||||||
echo "${file#$destdir/}" >> "$linklist"
|
echo "${file#$destdir/}" >> "$linklist"
|
||||||
done < "$filelist"
|
done
|
||||||
|
|
||||||
if ! [ "$SKIP_LIST" ]; then
|
if ! [ "$SKIP_LIST" ]; then
|
||||||
tmpfile="linkindex.tmp"
|
tmpfile="linkindex.tmp"
|
||||||
@ -209,7 +206,7 @@ EOF
|
|||||||
done < "$linklist"
|
done < "$linklist"
|
||||||
sed -i 's/^<url>/\t<url>/' "$destdir"/sitemap.xml
|
sed -i 's/^<url>/\t<url>/' "$destdir"/sitemap.xml
|
||||||
fi
|
fi
|
||||||
rm -f "$linklist" "$filelist"
|
rm -f "$linklist"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user