From 69ab712c40e7b451ad36b9a14e283246a0dd3add Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 25 Aug 2022 20:27:05 +0000 Subject: [PATCH] ch-ch-ch-changes --- blog/_posts/2022-08-25-composer-test.md | 9 ++++++ blog1964868.md | 8 ++++++ blog1964879.md | 8 ++++++ compose.sh | 38 +++++++++++++++++++++++++ dev/_posts/2022-08-25-composer-test.md | 7 +++++ pbx/_posts/2022-08-25-composer-test.md | 7 +++++ 6 files changed, 77 insertions(+) create mode 100644 blog/_posts/2022-08-25-composer-test.md create mode 100644 blog1964868.md create mode 100644 blog1964879.md create mode 100755 compose.sh create mode 100644 dev/_posts/2022-08-25-composer-test.md create mode 100644 pbx/_posts/2022-08-25-composer-test.md diff --git a/blog/_posts/2022-08-25-composer-test.md b/blog/_posts/2022-08-25-composer-test.md new file mode 100644 index 0000000..bfd2104 --- /dev/null +++ b/blog/_posts/2022-08-25-composer-test.md @@ -0,0 +1,9 @@ +--- +title: Composer Test +layout: post +date: 2022-08-25 20:30:23 +excerpt_separator: +--- + +I wrote a "composer" for my blog...a script that generates a file with front matter and handles moving it to the proper directory. I found I needed to add a time-stamp to all my posts so they'd +display in the right order. So in the process, I made it do a bunch of other stuff. I'll do a proper write-up on it later. I've got stuff I want to do. diff --git a/blog1964868.md b/blog1964868.md new file mode 100644 index 0000000..5d11a24 --- /dev/null +++ b/blog1964868.md @@ -0,0 +1,8 @@ +--- +title: Composer Test for /pbx +layout: post +date: 2022-08-25 20:16:12 +excerpt_separator: +--- + +This is a test article for /pbx. I will delete it in a future push. diff --git a/blog1964879.md b/blog1964879.md new file mode 100644 index 0000000..db6095f --- /dev/null +++ b/blog1964879.md @@ -0,0 +1,8 @@ +--- +title: Composer Test for /dev +layout: post +date: 2022-08-25 20:16:50 +excerpt_separator: +--- + +This is a test post for /dev. I'll delete it when I do a full write up. diff --git a/compose.sh b/compose.sh new file mode 100755 index 0000000..c46b460 --- /dev/null +++ b/compose.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# pickmy.org post composer +# by: Jay/nq4t/@music_onhold + +# usage: ./compose.sh [category] [title] +# example: /compose.sh blog MY AWESOME BLOG TITLE NO YOU DON'T NEED TO ENCLOSE IT! +# run in the root of your site files/repository +# assumes categories are directories in root + +# Arguments and Variables +category=$1 +pd=$(date +'%Y-%m-%d') +pt=$(date +'%T') +file=blog$$.md +title=$2 +# I'm lazy. I want every indvidual word after +# the first one to be the title. No special +# characters. Just cycle through them. +shift 2 +for word in "$@" +do +title="$title $1"; +shift 1; +done + +# Let's write the front matter to our file. + +printf -- "---\ntitle: $title\nlayout: post\ndate: $pd $pt\nexcerpt_separator: \n---\n" >> $file + +# Write the post in nano. + +nano + $file + +# Rename the file and copy the post to the right directory. + +t=${title,,} +mv $file $category/_posts/$pd-${t// /-}.md +printf "\nPost $title created in $category: $category/_posts/$pd-${t// /-}.md\n\n" diff --git a/dev/_posts/2022-08-25-composer-test.md b/dev/_posts/2022-08-25-composer-test.md new file mode 100644 index 0000000..a42c880 --- /dev/null +++ b/dev/_posts/2022-08-25-composer-test.md @@ -0,0 +1,7 @@ +--- +title: Composer Test +layout: post +date: 2022-08-25 20:25:37 +excerpt_separator: +--- +This is a composer test. I will delete it later. diff --git a/pbx/_posts/2022-08-25-composer-test.md b/pbx/_posts/2022-08-25-composer-test.md new file mode 100644 index 0000000..bcf0eb5 --- /dev/null +++ b/pbx/_posts/2022-08-25-composer-test.md @@ -0,0 +1,7 @@ +--- +title: Composer Test +layout: post +date: 2022-08-25 20:26:15 +excerpt_separator: +--- +This is a composer test. I will delete it later.