diff --git a/README.md b/README.md
index 0c22047..8a5e362 100644
--- a/README.md
+++ b/README.md
@@ -7,10 +7,14 @@ I created it because I wanted a very, very simple way to post entries to a blog
*How simple? Just type `./bb.sh post` and start writing your blogpost.*
-You can see it live here: [read the initial blog post](https://web.archive.org/web/20130520204024/http://mmb.pcb.ub.es/~carlesfe/blog/creating-a-simple-blog-system-with-a-500-line-bash-script.html). That page was 100% generated using bashblog, no additional tweaking.
+[![asciinema](https://asciinema.org/a/4nr44km9ipow4s7u2w2eabeik.png)](https://asciinema.org/a/4nr44km9ipow4s7u2w2eabeik)
+
+You can see a sample here: [read the initial blog post](https://web.archive.org/web/20130520204024/http://mmb.pcb.ub.es/~carlesfe/blog/creating-a-simple-blog-system-with-a-500-line-bash-script.html). That page was 100% generated using bashblog, no additional tweaking.
[![demo](https://raw.githubusercontent.com/cfenollosa/bashblog/gh-pages/images/demo_thumb.png)](https://raw.githubusercontent.com/cfenollosa/bashblog/gh-pages/images/demo.png)
+Check out [other bashblog users](https://www.google.com/search?q=%22Generated+with+bashblog,+a+single+bash+script+to+easily+create+blogs+like+this+one%22)
+
Usage
-----
@@ -128,6 +132,8 @@ As a guideline, pull requests should:
Changelog
---------
+- 2.7 Store post date on a comment in the html file (#96).
+ On rebuild, the post date will be synchronised between comment date and file date, with precedence for comment date.
- 2.6 Support for multiple authors, use a different `.config` for each one
- 2.5 Massive code cleanup by Martijn Dekker
'tags' command
diff --git a/bb.sh b/bb.sh
index 144f9b9..23bdab6 100755
--- a/bb.sh
+++ b/bb.sh
@@ -29,7 +29,7 @@ global_config=".config"
# by the 'global_config' file contents
global_variables() {
global_software_name="BashBlog"
- global_software_version="2.6"
+ global_software_version="2.7"
# Blog title
global_title="My fancy blog"
@@ -136,10 +136,14 @@ global_variables() {
template_twitter_button="Tweet"
template_twitter_comment="<Type your comment here but please leave the URL so that other people can follow the comments>"
- # The locale to use for the dates displayed on screen (not for the timestamps)
+ # The locale to use for the dates displayed on screen
date_format="%B %d, %Y"
- date_allposts_header="%B %Y"
date_locale="C"
+ date_inpost="bashblog_timestamp"
+ # Don't change these dates
+ date_format_full="%a, %d %b %Y %H:%M:%S %z"
+ date_format_timestamp="%Y%m%d%H%M.%S"
+ date_allposts_header="%B %Y"
# Perform the post title -> filename conversion
# Experts only. You may need to tune the locales too
@@ -285,9 +289,10 @@ invoke_editor() {
# "full" to edit full HTML, and not only text part (keeps old filename)
# leave empty for default behavior (edit only text part and change name)
edit() {
+ [[ ! -f "${1%%.*}.html" ]] && echo "Can't edit post "${1%%.*}.html", did you mean to use \"bb.sh post \"?" && exit -1
# Original post timestamp
- edit_timestamp=$(LC_ALL=C date -r "${1%%.*}.html" +"%a, %d %b %Y %H:%M:%S %z" )
- touch_timestamp=$(LC_ALL=C date -r "${1%%.*}.html" +'%Y%m%d%H%M')
+ edit_timestamp=$(LC_ALL=C date -r "${1%%.*}.html" +"$date_format_full" )
+ touch_timestamp=$(LC_ALL=C date -r "${1%%.*}.html" +"$date_format_timestamp")
tags_before=$(tags_in_post "${1%%.*}.html")
if [[ $2 == full ]]; then
invoke_editor "$1"
@@ -323,6 +328,7 @@ edit() {
rm "$TMPFILE"
fi
touch -t "$touch_timestamp" "$filename"
+ touch -t "$touch_timestamp" "$1"
chmod 644 "$filename"
echo "Posted $filename"
tags_after=$(tags_in_post "$filename")
@@ -454,11 +460,17 @@ create_html_page() {
echo "$title"
echo ''
if [[ -z $timestamp ]]; then
- echo "