浏览代码

Change to markdown blog posts

Bob Mottram 8 年前
父节点
当前提交
d095710eb0
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 14 次插入12 次删除
  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 查看文件

@@ -190,8 +190,8 @@ function mesh_install_blogstatic {
190 190
         mkdir -p $rootdir$STATIC_BLOG_PATH
191 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 195
     fi
196 196
 
197 197
     create_pelican_conf $rootdir$STATIC_BLOG_INSTALL_DIR/pelicanconf.py

+ 4
- 0
src/freedombone-image-mesh 查看文件

@@ -765,6 +765,10 @@ function setup_ipfs {
765 765
         rm -rf /home/$MY_USERNAME/Public
766 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 772
     if [ -d /home/$MY_USERNAME/CreateBlog/content ]; then
769 773
         shred -zu /home/$MY_USERNAME/CreateBlog/content/*
770 774
         if grep -q "THEME=" /home/$MY_USERNAME/CreateBlog/pelicanconf.py; then

+ 8
- 10
src/freedombone-mesh-blog 查看文件

@@ -84,13 +84,11 @@ function view_blog {
84 84
 function new_blog {
85 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 92
     echo  '' >> ~/.new-blog-entry
95 93
     echo $'Add your text here' >> ~/.new-blog-entry
96 94
     echo  '' >> ~/.new-blog-entry
@@ -109,7 +107,7 @@ function new_blog {
109 107
 
110 108
     # move to the content directory
111 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 112
     # increment the index
115 113
     CURRENT_INDEX=$((CURRENT_INDEX + 1))
@@ -124,7 +122,7 @@ function edit_blog {
124 122
     fi
125 123
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
126 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 126
     if [ ! -f $LAST_BLOG_ENTRY ]; then
129 127
         return
130 128
     fi
@@ -138,7 +136,7 @@ function delete_blog {
138 136
     fi
139 137
     CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
140 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 140
     if [ ! -f $LAST_BLOG_ENTRY ]; then
143 141
         return
144 142
     fi