lb

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 85c0d07b2074374b9f8b9f2895c9d7828a3b7872
parent 197624ebfa6724f685e9339e5dd0cd1250c97cf6
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Fri, 14 Dec 2018 12:36:56 -0500

important fixes!

Diffstat:
Mlb | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lb b/lb @@ -24,8 +24,8 @@ newpost() { read -erp "Give a title for your post: echo "$title" | grep "\"" >/dev/null && printf "Double quotation marks (\") are not allowed in entry titles.\\n" && exit url="$(echo "$title" | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')" echo "AddDescription \"$title\" \"$url.html\"" >> "$webdir/blog/.htaccess" || { echo "Error: Is htaccess writeable?"; exit; } - [ -f "$webdir/blog/.drafts/$url.html" ] && echo "There is already an existing draft entry of that same name/URL." - [ -f "$webdir/blog/$url.html" ] && echo "There is already an existing published entry of that same name/URL." + [ -f "$webdir/blog/.drafts/$url.html" ] && echo "There is already an existing draft entry of that same name/URL." && exit + [ -f "$webdir/blog/$url.html" ] && echo "There is already an existing published entry of that same name/URL." && exit $EDITOR "$webdir/blog/.drafts/$url.html" ;} listandReturn() { printf "Listing contents of %s.\\n" "$1" @@ -45,7 +45,7 @@ publish() { \ printf "<html>\\n<head>\\n<title>%s</title>\\n<link rel='stylesheet' type='text/css' href='%s'>\\n<meta charset='utf-8'/>\\n</head>\\n<body>\\n<h1>%s</h1>\\n<small>[<a href='%s#%s'>link</a>&mdash;<a href='%s'>standalone</a>]</small>\\n%s\\n<footer>by <strong><a href='%s'>%s</a></strong></footer>\\n</body>\\n\\n</html>" "$realname" "$css" "$realname" "../$blogfile" "$base" "$basefile" "$(cat "$webdir/blog/.drafts/$basefile")" "$website" "$name" > "$webdir/blog/$basefile" printf "\\n<item>\\n<title>%s</title>\\n<guid>%s%s#%s</guid>\\n<pubDate>%s</pubDate>\\n<description><![CDATA[\\n%s\\n]]></description>\\n</item>\\n\\n" "$realname" "$website" "$blogfile" "$basefile" "$rssdate" "$(cat "$webdir/blog/.drafts/$basefile")" > "$tmpdir/rss" printf "<div class='entry'>\\n<h2 id='%s'>%s</h2>\\n<small>[<a href='#%s'>link</a>&mdash;<a href='%s'>standalone</a>]</small>\\n%s\\n<small>%s</small>\\n</div>\\n" "$base" "$realname" "$base" "blog/$basefile" "$(cat "$webdir/blog/.drafts/$basefile")" "$webdate" > "$tmpdir/html" - printf "<li>%s &ndash; <a href=\"blog/%s\">%s</a></li>" "$(date '+%Y %b %d')" "$basefile" "$realname" > "$tmpdir/index" + printf "<li>%s &ndash; <a href=\"blog/%s\">%s</a></li>\\n" "$(date '+%Y %b %d')" "$basefile" "$realname" > "$tmpdir/index" sed -i "/<!-- LB -->/r $tmpdir/html" "$blogfile" sed -i "/<!-- LB -->/r $tmpdir/rss" "$rssfile" sed -i "/<!-- LB -->/r $tmpdir/index" "$indexfile"