diff --git a/content/blog/now.html b/content/blog/now.html
index 87b3005..ac75216 100644
--- a/content/blog/now.html
+++ b/content/blog/now.html
@@ -14,17 +14,19 @@
TIMESTAMP="$(date '+%Y-%m-%d %H:%M:%S %:z')"
ID="$(date -d "$TIMESTAMP" '+%Y%m%d%H%M%S')"
-POST="$*"
-CHARCOUNT="$(printf '%s' "$POST" | wc -c)"
-CHARLIMIT="500"
-if [[ "$CHARCOUNT" -gt "$CHARLIMIT" ]]; then
+INPUT="$*"
+CHAR_COUNT="$(printf '%s' "$INPUT" | wc -c)"
+CHAR_LIMIT="500"
+if [[ "$CHAR_COUNT" -eq 0 ]] || [[ "$CHAR_COUNT" -gt "$CHAR_LIMIT" ]]; then
if [[ "$(command -v vipe)" = "" ]]; then
- printf 'Error: Unable to create post. Character count is %s/%s' "$CHARCOUNT" "$CHARLIMIT"
+ printf 'Error: Unable to create post. Character count is %s/%s' "$CHAR_COUNT" "$CHAR_LIMIT"
printf 'Tip: Install moreutils for vipe command.'
exit 1
else
- printf %s "$POST" | vipe
+ POST="$(printf %s "$INPUT" | vipe)"
fi
+else
+ POST="$INPUT"
fi
masto() {
if [[ "$(command -v toot)" = "" ]]; then
@@ -43,13 +45,13 @@ now() {
THIS_TEMPLATES_DIR="$THIS_BLOG_DIR/$TEMPLATES_DIR"
test -d "$THIS_NOW_DIR" || mkdir -p "$THIS_NOW_DIR"
local HTML_DATE
- HTML_DATE="<p><i class=\"date\">$TIMESTAMP</i></p>"
+ HTML_DATE="<p id=\"$ID\"><i class=\"date\"<$TIMESTAMP</i<</p<"
local HTML_POST
- HTML_POST="<p>$(echo "$POST" | sed 's!\n!</p><p>!g')</p>"
- printf '<article>\n%s\n%s\n</article>' "$HTML_DATE" "$HTML_POST" > "$THIS_NOW_DIR/index.html"
+ HTML_POST="<p<$(echo "$POST" | sed 's!\n!</p<<p<!g')</p<"
+ printf '<article<\n<h1<Now</h1<\n%s\n%s\n