More interactive tail work and move blog index backwards by 1
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
# build the blog files
|
# build the blog files
|
||||||
cd ../blog
|
cd ../blog
|
||||||
CONTENTNUM=$(ls content-* | wc -l )
|
CONTENTNUM=$(ls content-* | wc -l )
|
||||||
for ((i=0;i<$CONTENTNUM;i++))
|
for ((i=-1;i<$CONTENTNUM;i++))
|
||||||
do
|
do
|
||||||
padint="$(printf %03d $i)"
|
padint="$(printf %03d $i)"
|
||||||
contentname="content-$padint"
|
contentname="content-$padint"
|
||||||
@ -14,19 +14,17 @@ do
|
|||||||
blogname="blog-$padint"
|
blogname="blog-$padint"
|
||||||
|
|
||||||
# interactive tail
|
# interactive tail
|
||||||
|
if [[ $i >= 0 ]];then
|
||||||
cp filetail "$tailname"
|
cp filetail "$tailname"
|
||||||
if [[ $i > 0 ]];then
|
|
||||||
padintprev="$(printf %03d $(($i - 1)) )"
|
padintprev="$(printf %03d $(($i - 1)) )"
|
||||||
else
|
|
||||||
padintprev="$(printf %03d 0 )"
|
|
||||||
fi
|
|
||||||
if [[ $(($i+1)) == $CONTENTNUM ]];then
|
if [[ $(($i+1)) == $CONTENTNUM ]];then
|
||||||
padintnext="$(printf %03d 0 )"
|
padintnext="$(printf %03d -1 )"
|
||||||
else
|
else
|
||||||
padintnext="$(printf %03d $(($i + 1)) )"
|
padintnext="$(printf %03d $(($i + 1)) )"
|
||||||
fi
|
fi
|
||||||
sed -i "s/PREVPADINT/$padintprev/g" "$tailname"
|
sed -i "s/PREVPADINT/$padintprev/g" "$tailname"
|
||||||
sed -i "s/NEXTPADINT/$padintnext/g" "$tailname"
|
sed -i "s/NEXTPADINT/$padintnext/g" "$tailname"
|
||||||
|
fi
|
||||||
|
|
||||||
# cat together
|
# cat together
|
||||||
cat filehead "$contentname" "$tailname" "$quotename" > "$blogname"
|
cat filehead "$contentname" "$tailname" "$quotename" > "$blogname"
|
||||||
@ -34,8 +32,8 @@ done
|
|||||||
|
|
||||||
# clean up non prod files
|
# clean up non prod files
|
||||||
cd ../blog
|
cd ../blog
|
||||||
rm filehead filetail content* quote* .blog.* tail*
|
#rm filehead filetail content* quote* .blog.* tail*
|
||||||
cd ../
|
cd ../
|
||||||
rm -rf .git scripts .index.html.* README.md
|
#rm -rf .git scripts .index.html.* README.md
|
||||||
find . -type f | xargs chmod 600
|
find . -type f | xargs chmod 600
|
||||||
find . -type d | xargs chmod 700
|
find . -type d | xargs chmod 700
|
||||||
|
Reference in New Issue
Block a user