www.eamoncaddigan.net

Content and configuration for https://www.eamoncaddigan.net
git clone https://git.eamoncaddigan.net/www.eamoncaddigan.net.git
Log | Files | Refs | Submodules | README

commit 166dbaa8564f614ecc613c12a587ef602d0b190e
parent 043519a0c4fc9df2a4d186c8c1258004e0cf419f
Author: Eamon Caddigan <eamon.caddigan@gmail.com>
Date:   Mon,  2 Dec 2024 20:45:36 -0800

Update December Adventure log for day 2

Diffstat:
Acontent/december-adventure/2024-02/index.md | 20++++++++++++++++++++
1 file changed, 20 insertions(+), 0 deletions(-)

diff --git a/content/december-adventure/2024-02/index.md b/content/december-adventure/2024-02/index.md @@ -0,0 +1,20 @@ +--- +title: "2024, Day 2: Git pre-push hook for Hugo, part 1" +description: "I need to stop pushing drafts, and this is how I hope to do that" +date: 2024-12-02T20:29:39-08:00 +draft: false +--- + +I build this site with Hugo, and I kludged together a tortuous system that +allows me to publish posts using `git push` (I may streamline this during my +December Adventure). I pushed yesterday’s post with the `draft` parameter +set to `true`---not for the first time---which is obnoxious because I need +to make a new commit and push _that_, leaving an untidy commit history. + +For today’s project I started looking into writing a [pre-push +hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) that would +prevent me from pushing draft posts to my webserver. I thought the sample +hooks would provide more guidance than they do, so I’m finding that this is +a bigger job than I expected. I need to learn a couple [Git plumbing +commands](https://git-scm.com/book/en/v2/Appendix-C%3A-Git-Commands-Plumbing-Commands) +to do this right, so I’m not going to finish today.