Browse Source

Use previous blog post index

Bob Mottram 8 years ago
parent
commit
74437ea53a
No account linked to committer's email
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/freedombone-mesh-blog

+ 2
- 1
src/freedombone-mesh-blog View File

@@ -91,7 +91,8 @@ function edit_blog {
91 91
         return
92 92
     fi
93 93
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
94
-    LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${CURRENT_INDEX}_post.rst
94
+    PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
95
+    LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.rst
95 96
     if [ ! -f $LAST_BLOG_ENTRY ]; then
96 97
         return
97 98
     fi