In typical fashion, I over-engineered a solution in my head, went through all the hardship of setting it up and then wasn't overly happy with the results so went and did what I wanted properly.
I had this idea of having two different repos, and two different hugo pipelines. I could have the photoblog linked off the main site off the navbar, set up another cloudfront distribution, SSL fronted and a new repo. This new repo I could push to independantly of the main site and it would all just work.
I had to go back to an earlier commit from the repo before I changed theme and refactored, copy the data into a brand new repo folder, strip it down until I just had the portfolio/photo section and then go from there.
That was all fairly easy and I got all the AWS side of things set up. With the build pipeline using a buildspec.yml it was easy to point to a different S3 bucket and a different cloudfront distro too.
First of all, I wasn't happy with the jarring way that the themes didn't really match up. So I started trying to use the css and page templates from one theme to get the other one to look the same. It went sort of a shade of grey, but didn't match up (no idea why). I got everything to a stage I was sort of happy with and got it uploaded.
Then I decided to try and fix it properly and it was fairly easy (after spending 3 hours dicking about with the files), to know which pieces I needed to add into the new theme to get photos working.
I got to the point where I could see the list of photos, it was working but when you clicked on the photo, it just made it big and there was no way to navigate back cleanly.
After playing with the code for a bit, I googled the plug in, found the section of code responsible for what I wanted it to do and I noticed that it was already in place on the page, but it was inside a defined block. For whatever reason, this defined block wasn't triggering, so I took the code out of the block, placed it on the portfolio page directly and bingo.
When I commit and push this post here, the photoblog will be back up and running in all it's glory - and I need to make sure I cleared down all my AWS resources.
Ah well, at least I learned something.
And, when I eventually come to taking a photo of something again, I can stick it up here with hardly any hassle.
I've also added an RSS feed for good measure.
And I've added the share buttons back. I've even put them on the images. We'll see how that goes.
Commenting is now live too, which is fun.
After all that, I've also rejigged the menu and renamed it to Photography Portfolio, because why not.
Think I'm done tinkering for tonight.