I’ve been working on what will be a large consumer site for a year or so. We’re a couple of months away from going live. Up to this point, I’ve been using “hugo server”. There’s a repository so I can just commit and push the changes to BitBucket, which is connected to the Netlify account. Every single thing has worked as expected.
Yesterday, I needed to be able to grab the Permalink version of the current Page in order to construct shareable URLs for Facebook icons. I was running into issues with that and strongly suspected that a context was not being passed but I didn’t know why. Thankfully, J Mooring solved my problem almost instantly by asking if I was using . to pass the context. Duh! I didn’t know about that but it solved the problem. On my local site, I was able to get the Permalink and easily construct the URLs that I needed.
This morning, I exported the changes to Netlify and was surprised to see the domain portion of the Permalink missing. Essentially, Permalink was returning the same thing as RelPermalink. Since the test site is password-protected, I thought maybe that was causing a problem. (Not really, but it was easy to test. ) Temporarily removing the password made no difference.
I started searching for why that might be happening and found a question here that basically told someone that they needed to use “Hugo” instead of “Hugo Server” to get a correct production deploy. I didn’t know that existed, either. It’s amazing how much you can get done with Hugo and still be missing some critical concepts.
I used “Hugo” to build the site and uploaded that to Bitbucket and thence to Netlify. Expecting to have solved my own problem, I eagerly tested it and saw that there was no change.
I searched farther and saw references to making certain that config.toml has baseURL correctly defined. It does.
I strongly suspect that I’m missing some simple concept but, for the life of me, I don’t know what it is.
I recognize the possibility that this is a problem on the Netlify end and will pursue this with them if it gets to that. I’m just thinking it’s more likely to be my error.
Any suggestions are gratefully accepted.