pyratelog

personal blog
git clone git://git.pyratebeard.net/pyratelog.git
Log | Files | Refs | README

commit 9bf8c9b60f1d43677b02448f8d0657721ecd1cb2
parent f586fb6ac4672cbdb36a03adf3e75a611a9d96df
Author: pyratebeard <root@pyratebeard.net>
Date:   Thu, 17 Nov 2022 22:01:03 +0000

rename post to entry everywhere

Diffstat:
Rpost_template.html -> entry_template.html | 0
Mpyratelog.sh | 2+-
Mscripts/draft | 12++++++------
Mscripts/preview | 18+++++++++---------
Mscripts/publish | 14+++++++-------
5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/post_template.html b/entry_template.html diff --git a/pyratelog.sh b/pyratelog.sh @@ -47,7 +47,7 @@ for md in ${find_md} ; do # for new files we turn the markdown into html # using a template file pandoc -s \ - --template=./post_template.html \ + --template=./entry_template.html \ --metadata title="${input_title}" \ -f markdown \ -t html \ diff --git a/scripts/draft b/scripts/draft @@ -5,9 +5,9 @@ TITLE=$1 RND=$2 if [ "$RND" = "mov" ] || [ "$RND" = "lit" ] ; then - POST="entry/rnd.${RND}.rec:_${TITLE}.md" + ENTRY="entry/rnd.${RND}.rec:_${TITLE}.md" else - POST="entry/${TITLE}.md" + ENTRY="entry/${TITLE}.md" fi # checkout the correct branch @@ -21,13 +21,13 @@ else fi # if post file does not exist yet touch it -[ -f "${POST}" ] || touch "${POST}" +[ -f "${ENTRY}" ] || touch "${ENTRY}" # open post file in favourite editor -vim "${POST}" +vim "${ENTRY}" # when vim closes add and commit the changes # if there are any -git status | grep "${POST}" || exit 0 -git add "${POST}" +git status | grep "${ENTRY}" || exit 0 +git add "${ENTRY}" git commit -S -m "${TITLE}" diff --git a/scripts/preview b/scripts/preview @@ -1,23 +1,23 @@ #!/bin/bash -# use arg as title and set post file path +# use arg as title and set entry file path TITLE=$1 -POST="entry/${TITLE}.md" +ENTRY="entry/${TITLE}.md" # create a tmp dir mkdir demo -# copy post file, post_template and css +# copy entry file, entry_template and css # to temp dir -cp ${POST} demo/index.md -cp post_template.html style.css demo/ +cp ${ENTRY} demo/index.md +cp entry_template.html style.css demo/ -# small change to post_template for stylesheet -sed -i 's%\.\./%%' demo/post_template.html +# small change to entry_template for stylesheet +sed -i 's%\.\./%%' demo/entry_template.html # generate html file pandoc -s \ - --template=demo/post_template.html \ + --template=demo/entry_template.html \ --metadata title="demolog" \ -f markdown \ -t html \ @@ -28,7 +28,7 @@ pandoc -s \ busybox httpd -f -h ./demo -p 8080 & busypid=$! -# open demo post file in browser +# open demo entry file in browser xdg-open http://localhost:8080 # wait until ready to stop web server diff --git a/scripts/publish b/scripts/publish @@ -1,16 +1,16 @@ #!/bin/sh -# use arg as title and set post file path +# use arg as title and set entry file path # set published file path with date TITLE=$1 RND=$2 if [ "$RND" = "mov" ] || [ "$RND" = "lit" ] ; then - POST="entry/rnd.${RND}.rec:_${TITLE}.md" + ENTRY="entry/rnd.${RND}.rec:_${TITLE}.md" PUBLISH="entry/$(date +%Y%m%d)-rnd.${RND}.rec:_${TITLE}.md" LINK="https://log.pyratebeard.net/entry/$(date +%Y%m%d)-rnd.${RND}.rec:_${TITLE}.html" else - POST="entry/${TITLE}.md" + ENTRY="entry/${TITLE}.md" PUBLISH="entry/$(date +%Y%m%d)-${TITLE}.md" LINK="https://log.pyratebeard.net/entry/$(date +%Y%m%d)-${TITLE}.html" fi @@ -27,13 +27,13 @@ else exit 1 fi -# rename post to set date -git mv "${POST}" "${PUBLISH}" +# rename entry to set date +git mv "${ENTRY}" "${PUBLISH}" # commit the rename as published git commit -S -m "publish ${TITLE}" -# checkout main branch and merge published post +# checkout main branch and merge published entry git checkout main if [ "$RND" = "mov" ] || [ "$RND" = "lit" ] ; then git merge rnd.${RND}.rec @@ -41,7 +41,7 @@ else git merge "${TITLE}" fi -# push new post +# push new entry git push #cat <<log | $TOOT post || curl -d "log toot failed" https://pager.pyratebeard.net/logtoot