<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Get Info: #git</title>
    <description>Posts tagged “git” — Blog of independent game and app developer Matt Sephton. Featuring vintage Macintosh, game development, digital artwork, Japanese esoterica, video game reviews, hacks and tips, and much more.</description>
    <link>https://blog.gingerbeardman.com/tag/git/</link>
    <atom:link href="https://blog.gingerbeardman.com/tag/git/index.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 01 Jul 2026 16:09:47 +0000</pubDate>
    <lastBuildDate>Wed, 01 Jul 2026 16:09:47 +0000</lastBuildDate>
    <generator>Jekyll v4.4.1</generator>

    
      
        <item>
          <title>Automating the most annoying aspects of blogging</title>
          <description>&lt;p&gt;Back in 2021 I had a look around and decided to base this incarnation of my blog on an open-source &lt;a href=&quot;https://jekyllrb.com&quot;&gt;Jekyll&lt;/a&gt; theme called “&lt;a href=&quot;https://github.com/ahmadajmi/type&quot;&gt;Type&lt;/a&gt;”, though I’ve changed and added so much it’s quite some distance from the original as it stands today. As I added blog posts the performance became much worse. Initially I blamed Jekyll for this, until I took a closer look. What I learned was that the blog theme did some things in sub-optimal ways, so over the course of 2024 I have corrected as many of them as I can. Build time dropped from ~12 seconds to ~1 second.&lt;/p&gt;

&lt;p&gt;My fixes and optimisations included:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Optimised SASS to compile once in plugin rather than header of every page (23 Feb)&lt;/li&gt;
  &lt;li&gt;Optimised all includes and templates to reduce build time (19 Aug)&lt;/li&gt;
  &lt;li&gt;Improved “noun” replacement, which are automatically-emphasised words (3 Sep)&lt;/li&gt;
  &lt;li&gt;Better YouTube embeds using lite-yt-embed (11 Sep)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And my additions along the way:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Multi-carousel support (14 Jul)&lt;/li&gt;
  &lt;li&gt;Automatic transformation of local images urls to CDN urls (19 Aug)&lt;/li&gt;
  &lt;li&gt;Automatic smart quotes in post titles (19 Aug)&lt;/li&gt;
  &lt;li&gt;Added OpenSearch to allow searching blog from address bar (15 Sep)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You might ask… what’s left to do? Not much I reckon. So I took a closer look at what is involved in me creating a blog post and made a list of the most repetitive, awkward or error prone tasks:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Entering links, partcularly links to other blog posts&lt;/li&gt;
  &lt;li&gt;Entering tags, going from memory or using search across project&lt;/li&gt;
  &lt;li&gt;Getting images onto my CDN server, currently copy by SFTP&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s solve all these annoyances!&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;entering-links-and-tags&quot;&gt;Entering links and tags&lt;/h2&gt;

&lt;p&gt;You can read about these two in previous blog posts:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Created &lt;a href=&quot;/2024/10/08/markdown-file-linker/&quot;&gt;Markdown File Linker&lt;/a&gt; to make linking easier (8 Oct)&lt;/li&gt;
  &lt;li&gt;Created &lt;a href=&quot;/2024/10/08/yaml-tag-picker/&quot;&gt;YAML Tag Picker&lt;/a&gt; to make tagging easier (8 Oct)&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;getting-images-onto-my-cdn-server&quot;&gt;Getting images onto my CDN server&lt;/h2&gt;

&lt;p&gt;I was still having to copy my images to my CDN server manually, which was a pain. But the software stack on the server was intimidating. I kept putting it off for a rainy day, but I knew I would eventually get around to automating it.&lt;/p&gt;

&lt;p&gt;The idea was to not upload the images at all, but rather download them to the server directly. I’d use a GitHub Webhook to trigger a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git pull&lt;/code&gt; of the latest files onto my server. It took a few hours and a few attempts, but I finally arrived at a fairly elegant system I’m happy with:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;GitHub Webhook that runs on push event&lt;/li&gt;
  &lt;li&gt;PHP script in web server docker container receives, validates, and creates a trigger file&lt;/li&gt;
  &lt;li&gt;Service on server outside of docker looks for trigger file and does &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git pull&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note: in January 2025, since this post was originally written, I have simplified the following files after migrating away from web servers in Docker containers to &lt;a href=&quot;https://caddyserver.com&quot;&gt;Caddy server&lt;/a&gt;. Highly recommended!&lt;/p&gt;

&lt;h3 id=&quot;github-webhook&quot;&gt;GitHub Webhook&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Payload URL: https://www.example.com/webhook.php&lt;/li&gt;
  &lt;li&gt;Content type: application/json&lt;/li&gt;
  &lt;li&gt;SSL verification: enabled&lt;/li&gt;
  &lt;li&gt;Which events would you like to trigger this webhook: Just the push event&lt;/li&gt;
  &lt;li&gt;Active: on&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;webhook-receiver-php-script&quot;&gt;Webhook receiver (PHP script)&lt;/h3&gt;

&lt;noscript&gt;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/gingerbeardman/63e4dc0bce459ad6609c2701963eb61f&quot;&gt;View the source code as a Gist&lt;/a&gt;&lt;/p&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/gingerbeardman/63e4dc0bce459ad6609c2701963eb61f.js&quot;&gt;&lt;/script&gt;

&lt;h3 id=&quot;webhook-git-pull-watcher-shell-script&quot;&gt;Webhook git pull watcher (Shell script)&lt;/h3&gt;

&lt;noscript&gt;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/gingerbeardman/e1c513c69b9e9d41aa91155893ae7334&quot;&gt;View the source code as a Gist&lt;/a&gt;&lt;/p&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/gingerbeardman/e1c513c69b9e9d41aa91155893ae7334.js&quot;&gt;&lt;/script&gt;

&lt;h3 id=&quot;trigger-system-service&quot;&gt;Trigger (System service)&lt;/h3&gt;

&lt;noscript&gt;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/gingerbeardman/1ff95ce64a6a255919b8262dd4a21bc7&quot;&gt;View the source code as a Gist&lt;/a&gt;&lt;/p&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/gingerbeardman/1ff95ce64a6a255919b8262dd4a21bc7.js&quot;&gt;&lt;/script&gt;

&lt;h3 id=&quot;access-control&quot;&gt;Access control&lt;/h3&gt;

&lt;noscript&gt;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/gingerbeardman/23e0da9949a8d41ebd190d60b0bd033b&quot;&gt;View the source code as a Gist&lt;/a&gt;&lt;/p&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/gingerbeardman/23e0da9949a8d41ebd190d60b0bd033b.js&quot;&gt;&lt;/script&gt;

&lt;h3 id=&quot;setup&quot;&gt;Setup&lt;/h3&gt;

&lt;p&gt;You can set up the service using:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo systemctl daemon-reload&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo systemctl start git-pull-watcher&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo systemctl enable git-pull-watcher&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other commands&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo systemctl restart git-pull-watcher&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo systemctl status git-pull-watcher&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
          <author>by Matt Sephton</author>
          <pubDate>Fri, 11 Oct 2024 16:42:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2024/10/11/automating-the-most-annoying-aspects-of-blogging/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2024/10/11/automating-the-most-annoying-aspects-of-blogging/</guid>
        </item>
      
    

  </channel>
</rss>
