stylesheets, titles, etc. added for standalones

This commit is contained in:
Luke Smith 2018-05-19 13:37:35 -07:00
parent 333589cb21
commit a4cbf4242d
1 changed files with 7 additions and 1 deletions

8
lb
View File

@ -4,8 +4,11 @@
rssfile="rss.xml"
blogfile="2018.html"
website="https://lukesmith.xyz/"
stylesheet="..\/style.css" # Characters should be escaped for this variable.
dir=$(pwd)
# See other variables defined later, such as `header` and `webdate` for more customizability.
getHelp() { \
echo -e "This system will take the blog entries you write and add them into the RSS file and HTML file of your choosing. Set which files to use by editing the 'lb' file directly and changing the variables at the top.\n"
echo -e "To fully prepare these files, add the following line to both files where you want the content to be added:\n"
@ -43,7 +46,10 @@ finalize() { \
echo -e "\n<div class=\"entry\">\n$(cat $dir/blog/.drafts/$chosen)\n<small>$webdate</small>\n</div>\n" > $tmpdir/html.html
sed -i "/<!-- LB -->/r $tmpdir/html.html" $blogfile
sed -i "/<!-- LB -->/r $tmpdir/rss.xml" $rssfile
mv $dir/blog/.drafts/$chosen $dir/blog/$chosen
header="<html>\n<head>\n<title>$title<\/title>\n<link rel='stylesheet type='text\/css' href='$stylesheet'>\n<meta charset='utf-8'\/>\n<\/head>\n<body>"
footer="<\/body>\n<\/html>"
sed "0,/^/s//$header/;0,/<h2 id=/s//<h1 id=/;0,/h2>/s//h1>/;\$a$footer" $dir/blog/.drafts/$chosen > $dir/blog/$chosen
rm $dir/blog/.drafts/$chosen
}
delete() { \