Browse Source

Change to markdown blog posts

Bob Mottram 8 years ago
parent
commit
d095710eb0
No account linked to committer's email
3 changed files with 14 additions and 12 deletions
  1. 2
    2
      src/freedombone-app-blogstatic
  2. 4
    0
      src/freedombone-image-mesh
  3. 8
    10
      src/freedombone-mesh-blog

+ 2
- 2
src/freedombone-app-blogstatic View File

190
         mkdir -p $rootdir$STATIC_BLOG_PATH
190
         mkdir -p $rootdir$STATIC_BLOG_PATH
191
     fi
191
     fi
192
 
192
 
193
-    if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR/content ]; then
194
-        mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR/content
193
+    if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR/content/images ]; then
194
+        mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR/content/images
195
     fi
195
     fi
196
 
196
 
197
     create_pelican_conf $rootdir$STATIC_BLOG_INSTALL_DIR/pelicanconf.py
197
     create_pelican_conf $rootdir$STATIC_BLOG_INSTALL_DIR/pelicanconf.py

+ 4
- 0
src/freedombone-image-mesh View File

765
         rm -rf /home/$MY_USERNAME/Public
765
         rm -rf /home/$MY_USERNAME/Public
766
     fi
766
     fi
767
 
767
 
768
+    if [ -d /home/$MY_USERNAME/CreateBlog/content/images ]; then
769
+        shred -zu /home/$MY_USERNAME/CreateBlog/content/images/*
770
+    fi
771
+
768
     if [ -d /home/$MY_USERNAME/CreateBlog/content ]; then
772
     if [ -d /home/$MY_USERNAME/CreateBlog/content ]; then
769
         shred -zu /home/$MY_USERNAME/CreateBlog/content/*
773
         shred -zu /home/$MY_USERNAME/CreateBlog/content/*
770
         if grep -q "THEME=" /home/$MY_USERNAME/CreateBlog/pelicanconf.py; then
774
         if grep -q "THEME=" /home/$MY_USERNAME/CreateBlog/pelicanconf.py; then

+ 8
- 10
src/freedombone-mesh-blog View File

84
 function new_blog {
84
 function new_blog {
85
     DATESTR=$(date "+%Y-%m-%d %H:%M:%S")
85
     DATESTR=$(date "+%Y-%m-%d %H:%M:%S")
86
 
86
 
87
-    echo $'Blog Post Title' > ~/.new-blog-entry
88
-    echo $'###############' >> ~/.new-blog-entry
89
-    echo  '' >> ~/.new-blog-entry
90
-    echo $":date: ${DATESTR}" >> ~/.new-blog-entry
91
-    echo $":author: $(toxid --showuser)" >> ~/.new-blog-entry
92
-    echo $':category: default' >> ~/.new-blog-entry
93
-    echo $':tags: blog, tag' >> ~/.new-blog-entry
87
+    echo $'Title: Blog Post Title' > ~/.new-blog-entry
88
+    echo $"Date: ${DATESTR}" >> ~/.new-blog-entry
89
+    echo $"Author: $(toxid --showuser)" >> ~/.new-blog-entry
90
+    echo $'Category: default' >> ~/.new-blog-entry
91
+    echo $'Tags: blog, tag' >> ~/.new-blog-entry
94
     echo  '' >> ~/.new-blog-entry
92
     echo  '' >> ~/.new-blog-entry
95
     echo $'Add your text here' >> ~/.new-blog-entry
93
     echo $'Add your text here' >> ~/.new-blog-entry
96
     echo  '' >> ~/.new-blog-entry
94
     echo  '' >> ~/.new-blog-entry
109
 
107
 
110
     # move to the content directory
108
     # move to the content directory
111
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
109
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
112
-    mv ~/.new-blog-entry $BLOG_CONTENT_PATH/${CURRENT_INDEX}_post.rst
110
+    mv ~/.new-blog-entry $BLOG_CONTENT_PATH/${CURRENT_INDEX}_post.md
113
 
111
 
114
     # increment the index
112
     # increment the index
115
     CURRENT_INDEX=$((CURRENT_INDEX + 1))
113
     CURRENT_INDEX=$((CURRENT_INDEX + 1))
124
     fi
122
     fi
125
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
123
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
126
     PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
124
     PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
127
-    LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.rst
125
+    LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.md
128
     if [ ! -f $LAST_BLOG_ENTRY ]; then
126
     if [ ! -f $LAST_BLOG_ENTRY ]; then
129
         return
127
         return
130
     fi
128
     fi
138
     fi
136
     fi
139
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
137
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
140
     PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
138
     PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
141
-    LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.rst
139
+    LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.md
142
     if [ ! -f $LAST_BLOG_ENTRY ]; then
140
     if [ ! -f $LAST_BLOG_ENTRY ]; then
143
         return
141
         return
144
     fi
142
     fi