@ -30,7 +30,7 @@ unset SKIP_SITEMAP
unset SKIP_FEED
unset SKIP_FEED
usage( ) {
usage( ) {
printf "Usage: rivet [-ho velfsu] [-p string] [-o destdir] srcdir domain\n"
printf "Usage: rivet [-hvelfsu] [-p string] [-o destdir] srcdir domain\n"
printf "\t-h: prints this message\n"
printf "\t-h: prints this message\n"
printf "\t-o [destdir]: specifies the output direcotory to be [destdir]\n"
printf "\t-o [destdir]: specifies the output direcotory to be [destdir]\n"
printf "\t-p [string]: Rename the \"Pages\" section to [string]\n"
printf "\t-p [string]: Rename the \"Pages\" section to [string]\n"
@ -104,6 +104,7 @@ unset src
headerfile = $srcdir /_header.html
headerfile = $srcdir /_header.html
footerfile = $srcdir /_footer.html
footerfile = $srcdir /_footer.html
objlist = objlist.tmp
objlist = objlist.tmp
objdate = objdate.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
@ -152,6 +153,10 @@ rm -f "$destdir"/_header.html "$destdir"/_footer.html
# Generate an ordered (by open time) file list
# Generate an ordered (by open time) file list
find " $srcdir " -type f -regex '.*\/[^_].+\..*' -exec ls -1t { } + |
find " $srcdir " -type f -regex '.*\/[^_].+\..*' -exec ls -1t { } + |
awk '/.*\.(md|html)$/' > " $objlist "
awk '/.*\.(md|html)$/' > " $objlist "
rm -f " $objdate "
while IFS = "" read -r file; do
stat -c '%y' " $file " >> " $objdate "
done < " $objlist "
sed -i -e " s,^\/*[^\/]*\/, $destdir /, " " $objlist "
sed -i -e " s,^\/*[^\/]*\/, $destdir /, " " $objlist "
# Convert markdown files
# Convert markdown files
@ -206,7 +211,8 @@ EOF
if [ -z " $title " ] ; then
if [ -z " $title " ] ; then
title = " ${ tfile ##*/ } "
title = " ${ tfile ##*/ } "
fi
fi
printf "<p><a href=\"%s\">%s</a></p>\n" " $line " " $title " >> " $tmpfile "
ldate = " $( awk " NR== $count " " $objdate " | sed 's/\s.*$//' ) "
printf "<p><a href=\"%s\">%s - %s</a></p>\n" " $line " " $ldate " " $title " >> " $tmpfile "
done < " $linklist "
done < " $linklist "
echo '</div>' >> " $tmpfile "
echo '</div>' >> " $tmpfile "
sed -i '/<\/body>/i REPLACE' " $destdir " /index.html
sed -i '/<\/body>/i REPLACE' " $destdir " /index.html
@ -255,7 +261,7 @@ EOF
if [ -z " $title " ] ; then
if [ -z " $title " ] ; then
title = " ${ tfile ##*/ } "
title = " ${ tfile ##*/ } "
fi
fi
ldate = " $( stat -c '%y' " $tfil e " ) "
ldate = " $( awk " NR== $count " " $objda te " ) "
{
{
printf '\t<entry>\n'
printf '\t<entry>\n'
printf '\t\t<title>%s</title>\n' " $title "
printf '\t\t<title>%s</title>\n' " $title "
@ -269,6 +275,6 @@ EOF
printf '</feed>\n' >> " $feed "
printf '</feed>\n' >> " $feed "
fi
fi
rm -f " $objlist " " $linklist "
rm -f " $objlist " " $linklist " " $objdate "
exit
exit