From feb7f415ce54631613ba9b9dfa6f6023d818767f Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Sun, 22 Jun 2014 08:26:39 +0200 Subject: [PATCH 1/3] $preview_url for those who writes posts locally before uploading them --- bb.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bb.sh b/bb.sh index 3e89977..409af87 100755 --- a/bb.sh +++ b/bb.sh @@ -223,6 +223,12 @@ global_variables() { # This default filter respects backwards compatibility convert_filename="iconv -f utf-8 -t ascii//translit | sed 's/^-*//' | tr [:upper:] [:lower:] | tr ' ' '-' | tr -dc '[:alnum:]-'" + # URL where you can view the post while it's being edited + # same as global_url by default + # You can change it to path on your computer, if you write posts locally + # before copying them to the server + preview_url="" + # Markdown location. Trying to autodetect by default. # The invocation must support the signature 'markdown_bin in.md > out.html' markdown_bin="$(which Markdown.pl)" @@ -635,7 +641,8 @@ EOF read p if [[ "$p" != "n" ]] && [[ "$p" != "N" ]]; then chmod 644 "$filename" - echo "Open $global_url/$filename in your browser" + [ $preview_url ] || preview_url="$global_url" + echo "Open $preview_url/$filename in your browser" fi echo -n "[P]ost this entry, [E]dit again, [D]raft for later? (p/E/d) " From 97f413e66682cec9e2bfcd80d71c7894691c5a58 Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Sun, 22 Jun 2014 08:41:21 +0200 Subject: [PATCH 2/3] one forgotten translated string template --- bb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bb.sh b/bb.sh index 409af87..2317575 100755 --- a/bb.sh +++ b/bb.sh @@ -700,7 +700,7 @@ all_posts() { echo "" >> "$contentfile" echo '' >> "$contentfile" - create_html_page "$contentfile" "$archive_index.tmp" yes "$global_title — All posts" + create_html_page "$contentfile" "$archive_index.tmp" yes "$global_title — $template_archive_title" mv "$archive_index.tmp" "$archive_index" chmod 644 "$archive_index" rm "$contentfile" From b7cd230ae96b06e93b391661726c986d25e3c9ea Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Wed, 25 Jun 2014 06:42:39 +0200 Subject: [PATCH 3/3] clean_filename in RSS links --- bb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bb.sh b/bb.sh index 2317575..a4f33f7 100755 --- a/bb.sh +++ b/bb.sh @@ -856,7 +856,7 @@ make_rss() { echo "$(get_post_title "$i")" >> "$rssfile" echo '> "$rssfile" echo "$(get_html_file_content 'text' 'entry' $cut_do <$i)" >> "$rssfile" - echo "]]>$global_url/$i" >> "$rssfile" + echo "]]>$global_url/$(clean_filename $i)" >> "$rssfile" echo "$global_url/$i" >> "$rssfile" echo "$global_author" >> "$rssfile" echo ''$(LC_ALL=C date -r "$i" +"%a, %d %b %Y %H:%M:%S %z")'' >> "$rssfile"