Change to markdown blog posts
This commit is contained in:
parent
04c63f163e
commit
d095710eb0
|
@ -190,8 +190,8 @@ function mesh_install_blogstatic {
|
||||||
mkdir -p $rootdir$STATIC_BLOG_PATH
|
mkdir -p $rootdir$STATIC_BLOG_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR/content ]; then
|
if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR/content/images ]; then
|
||||||
mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR/content
|
mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR/content/images
|
||||||
fi
|
fi
|
||||||
|
|
||||||
create_pelican_conf $rootdir$STATIC_BLOG_INSTALL_DIR/pelicanconf.py
|
create_pelican_conf $rootdir$STATIC_BLOG_INSTALL_DIR/pelicanconf.py
|
||||||
|
|
|
@ -765,6 +765,10 @@ function setup_ipfs {
|
||||||
rm -rf /home/$MY_USERNAME/Public
|
rm -rf /home/$MY_USERNAME/Public
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d /home/$MY_USERNAME/CreateBlog/content/images ]; then
|
||||||
|
shred -zu /home/$MY_USERNAME/CreateBlog/content/images/*
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d /home/$MY_USERNAME/CreateBlog/content ]; then
|
if [ -d /home/$MY_USERNAME/CreateBlog/content ]; then
|
||||||
shred -zu /home/$MY_USERNAME/CreateBlog/content/*
|
shred -zu /home/$MY_USERNAME/CreateBlog/content/*
|
||||||
if grep -q "THEME=" /home/$MY_USERNAME/CreateBlog/pelicanconf.py; then
|
if grep -q "THEME=" /home/$MY_USERNAME/CreateBlog/pelicanconf.py; then
|
||||||
|
|
|
@ -84,13 +84,11 @@ function view_blog {
|
||||||
function new_blog {
|
function new_blog {
|
||||||
DATESTR=$(date "+%Y-%m-%d %H:%M:%S")
|
DATESTR=$(date "+%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
echo $'Blog Post Title' > ~/.new-blog-entry
|
echo $'Title: Blog Post Title' > ~/.new-blog-entry
|
||||||
echo $'###############' >> ~/.new-blog-entry
|
echo $"Date: ${DATESTR}" >> ~/.new-blog-entry
|
||||||
echo '' >> ~/.new-blog-entry
|
echo $"Author: $(toxid --showuser)" >> ~/.new-blog-entry
|
||||||
echo $":date: ${DATESTR}" >> ~/.new-blog-entry
|
echo $'Category: default' >> ~/.new-blog-entry
|
||||||
echo $":author: $(toxid --showuser)" >> ~/.new-blog-entry
|
echo $'Tags: blog, tag' >> ~/.new-blog-entry
|
||||||
echo $':category: default' >> ~/.new-blog-entry
|
|
||||||
echo $':tags: blog, tag' >> ~/.new-blog-entry
|
|
||||||
echo '' >> ~/.new-blog-entry
|
echo '' >> ~/.new-blog-entry
|
||||||
echo $'Add your text here' >> ~/.new-blog-entry
|
echo $'Add your text here' >> ~/.new-blog-entry
|
||||||
echo '' >> ~/.new-blog-entry
|
echo '' >> ~/.new-blog-entry
|
||||||
|
@ -109,7 +107,7 @@ function new_blog {
|
||||||
|
|
||||||
# move to the content directory
|
# move to the content directory
|
||||||
CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
|
CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
|
||||||
mv ~/.new-blog-entry $BLOG_CONTENT_PATH/${CURRENT_INDEX}_post.rst
|
mv ~/.new-blog-entry $BLOG_CONTENT_PATH/${CURRENT_INDEX}_post.md
|
||||||
|
|
||||||
# increment the index
|
# increment the index
|
||||||
CURRENT_INDEX=$((CURRENT_INDEX + 1))
|
CURRENT_INDEX=$((CURRENT_INDEX + 1))
|
||||||
|
@ -124,7 +122,7 @@ function edit_blog {
|
||||||
fi
|
fi
|
||||||
CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
|
CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
|
||||||
PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
|
PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
|
||||||
LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.rst
|
LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.md
|
||||||
if [ ! -f $LAST_BLOG_ENTRY ]; then
|
if [ ! -f $LAST_BLOG_ENTRY ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
@ -138,7 +136,7 @@ function delete_blog {
|
||||||
fi
|
fi
|
||||||
CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
|
CURRENT_INDEX=$(cat $CURRENT_BLOG_INDEX)
|
||||||
PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
|
PREVIOUS_INDEX=$((CURRENT_INDEX - 1))
|
||||||
LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.rst
|
LAST_BLOG_ENTRY=$BLOG_CONTENT_PATH/${PREVIOUS_INDEX}_post.md
|
||||||
if [ ! -f $LAST_BLOG_ENTRY ]; then
|
if [ ! -f $LAST_BLOG_ENTRY ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue