diff --git a/copy-posts/Dockerfile b/copy-posts/Dockerfile new file mode 100644 index 0000000..726a16e --- /dev/null +++ b/copy-posts/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3 +COPY copy-posts.sh /bin/copy-posts + diff --git a/copy-posts/copy-posts.sh b/copy-posts/copy-posts.sh new file mode 100755 index 0000000..92e0065 --- /dev/null +++ b/copy-posts/copy-posts.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +# NOTES=$(find Resources/blog/ type/ f -not -path "*drafts/*" -name "*.md" | basename {}|cut -d"." -f1| xargs -n1 mkdir -p "cicd_blog/contents/posts/{}") +NOTES=$(find Resources/blog/ -type f -not -path "*drafts/*" -name "*.md" ) + +for n in $NOTES; do + BASE=$(basename $n|cut -d'.' -f1) + mkdir -vp cicd_blog/content/posts/$BASE + echo cp -v $n cicd_blog/content/posts/$BASE/index.md +done