pyratelog

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

commit e84b8e48c4df2a2da1ad93ba9e14b6cbcb4384b2
parent 2d8805f90782cbb4cdc51fae46da1a44bd5d37b2
Author: pyratebeard <root@pyratebeard.net>
Date:   Thu, 17 Nov 2022 23:26:52 +0000

as_a_matter_of_course

Diffstat:
Mentry/as_a_matter_of_course.md | 26++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/entry/as_a_matter_of_course.md b/entry/as_a_matter_of_course.md @@ -1,6 +1,6 @@ -This web log as been through a number of iterations. First I used [Jekyll](https://jekyllrb.com/){target="_blank" rel="noreferrer"} on [Github Pages](https://pages.github.com/){target="_blank" rel="noreferrer"}, then I switched to [Hugo](https://gohugo.io/){target="_blank" rel="noreferrer"} using a docker container and [Gitlab's CI/CD](https://docs.gitlab.com/ee/ci/){target="_blank" rel="noreferrer"} pipeline, and finally the current setup. +This web log as been through a few iterations. First I used [Jekyll](https://jekyllrb.com/){target="_blank" rel="noreferrer"} on [Github Pages](https://pages.github.com/){target="_blank" rel="noreferrer"}, then I switched to [Hugo](https://gohugo.io/){target="_blank" rel="noreferrer"} using a docker container and [Gitlab's CI/CD](https://docs.gitlab.com/ee/ci/){target="_blank" rel="noreferrer"} pipeline, then finally the current setup. -I moved away from the docker container as the build started failing and I hit too many issues trying to get it working. In an effort to simplify everything I thought, why couldn't I write my entries in markdown then use [pandoc](https://pandoc.org/){target="_blank" rel="noreferrer"} to convert them to HTML? +I moved away from the docker container as the build started failing then I was hitting too many issues trying to get it working. In an effort to simplify everything I thought, why couldn't I write my entries in markdown then use [pandoc](https://pandoc.org/){target="_blank" rel="noreferrer"} to convert them to HTML? ``` pandoc -f markdown -t html -o new_entry.html new_entry.md ``` @@ -19,7 +19,7 @@ pandoc -s \ entry/${input}.md ``` -The `pyratelog.sh` script also sets the link on the main page and adds the entry to my _rss.xml_ file. +The `pyratelog.sh` script also sets the link on the main page as well as adding the entry to my _rss.xml_ file. In order for the script to know when a new entry has been published I use `inotifywait` to watch for files in the _entry/_ directory ``` @@ -52,7 +52,7 @@ vim "${ENTRY}" Now I let my creative juices flow to produce more enjoyable content for you. -Once I have finished and close `vim`, the `draft` script continues by adding and committing the changes to `git` +Once I have finished and close `vim`, the `draft` script continues by adding then committing the changes to `git` ``` # when vim closes add and commit the changes # if there are any @@ -62,9 +62,9 @@ git commit -S -m "${TITLE}" ``` ### advanced screening -The `preview` script was written as sometimes I like to see what the entry looks like in the browser, especially when I put pictures in. It is useful to read through in the browser as well, I have caught a number of spelling mistakes and poorly worded sentences that way. +The `preview` script was written as sometimes I like to see what the entry looks like in the browser, especially when I put pictures in. It is useful to read through in the browser as well, I have caught a number of spelling mistakes along with poorly worded sentences that way. -To do this the script creates a temporary directory and copies in the entry in question, the template file for `pandoc`, and my custom CSS +To do this the script creates a temporary directory, copies the entry in question, the template file for `pandoc`, and my custom CSS ``` # use arg as title and set entry file path TITLE=$1 @@ -112,8 +112,10 @@ kill ${busypid} rm -rf demo/ ``` +Unfortunately this script didn't work on my phone while using [Termux](https://f-droid.org/en/packages/com.termux/){target="_blank" rel="noreferrer"} because `pandoc` is not available to install. As a workaround I started using [AnLinux](https://github.com/EXALAB/AnLinux-App){target="_blank" rel="noreferrer"} to give me a full Linux distro to work in. + ### it's a wrap -Finally I can run the `publish` script to send my entry out into the world. This is the simplest of the three scripts. It will rename the entry to prefix the date then merge the branch into the main branch and push to my git server +Finally I can run the `publish` script to send my entry out into the world. This is the simplest of the three scripts. It will rename the entry to prefix the date then merge the branch into the main branch before pushing to my git server ``` # use arg as title and set entry file path # set published file path with date @@ -151,7 +153,7 @@ The only thing I have to do after hitting publish is [toot about it](https://har ### behind the scenes Now because I [seem to like](20220124-make_believe.html){target="_blank" rel="noreferrer"} using Makefiles for running things I had a go at one for the `draft`, `preview`, and `publish` scripts. -It got a bit a bit complicated with the arguments, but I was able to make it work, even setting it so that if I am already on the correct branch I don't have to pass any arguments +It got a bit complicated with the arguments, but I was able to make it work, even setting it so that if I am already on the correct branch I don't have to pass any arguments ``` #TITLE := $(shell git branch --show-current) RND := "" @@ -204,7 +206,7 @@ As an example, to start a new entry I incant make draft as_a_matter_of_course ``` -An empty buffer is opened in `vim` and I can start writing. After some time I decide I need a break so I save and exit `vim`. When I come back I know I am already on the *as_a_matter_of_course* branch so I can incant +An empty buffer is opened in `vim` so I can start writing. After some time I decide I need a break so I save and exit `vim`. When I come back I know I am already on the *as_a_matter_of_course* branch so I can incant ``` make draft ``` @@ -219,8 +221,8 @@ After reviewing the finished piece I can incant make publish ``` -These three scripts have sped up my writing process and have made it even easier to switch between drafts if I have more than one entry in the works at a time. +These three scripts have sped up my writing process as well as making it even easier to switch between drafts if I have more than one entry in the works at a time. -One issue that I have had to overcome, and it's a big one, is that I need to think of the title before I start the draft. A few of my previous entries have had working titles right up until the moment they are published. I have thought about adding in a step to the publish script to change the title before it goes out, but for now I will force myself to think harder about the titles. +One issue that I have had to overcome, it's a big one, is that I need to think of the title before I start the draft. A few of my previous entries have had working titles right up until the moment they are published. I have thought about adding in a step to the publish script to change the title before it goes out, but for now I will force myself to think harder about the titles. -There are still some tweaks and improvements I want to look into but I have been happy with this process since I created it, and adding in the additional scripts has helped a lot. It has certainly sped up my workflow and I haven't had any issues with the automated publishing, long may it last. +There are still some tweaks and improvements I want to look into but I have been happy with this process since I created it, adding in the additional scripts has helped a lot. It has certainly sped up my workflow and I haven't had any issues with the automated publishing, long may it last.