Member-only story
Hexo — local configuration
Exploring how to use merged config files for setting up a “local” vs “prod” workflow in Hexo.
Dave (from https://davefollett.io/) and I were talking a bit about thumbnails, feature images, and our local vs deployed dev process in the coding blocks slack channel today. I discovered that a bit of research was needed on how to avoid changing config files when switching between a local dev and deployed situation.
The answer lies in numerous config files that can get merged together for local development…
My url
from _config.yml
was pointing to my actual domain of blog.kritner.com. This caused issues when writing a new post because of images I had intended to use like “hexo-logo.png” would have its full URL built out as [url]/[myPost]/hexo-logo.png
, which in my case would be https://blog.kritner.com/...
. The “URL” portion of my config file was being injected in, but since these images did not exist out on the internet yet, I was unable to confirm the image actually “worked”.
This led me to update my url
to “localhost:4000”. Now my images were showing up (when I spelled the image name right) but I now had to deal with another problem. I needed to remember to change my url
back to my actual domain of “blog.kritner.com”.
Poking around the hexo documentation I happened across: Using an Alternate Config…