Pelican Config Consolidation



So in my updates to the script I also wanted to hide my config files behind a folder because it feels nice when things are clean. This caused a hiccup or two. Let me tell you what I did. OKAY!?! ugh

I put all the config files in a /config folder. Wow. The dev.sh script that launches the local server would use the files in this new folder. But something wasn't right.

My configs now have a hierarchy. The blog_conf is the root config. All others load in a config and tweak on the values it needs to.

  • blog_conf.py is the base config. Everything else stems off of it.
  • blog_conf_dev.py config loads the root config and modifies a few variables to adjust for dev environment.
  • second_conf.py loads in the root config and modifies only a few variables.
  • second_conf_dev.py loads in the second_conf.py and tweaks a few things

I won't show you blog_conf: it's huge. But I'll show how the dev confs work.

Everythign from the original blog_conf is loaded in. The other variables in this file overwrite the original conf values.

The most important part is the sys.path.append I didn't fully understand it, but because the dev.sh is loaded from the root dir and these configs live nested, I needed to help ensure Python could find the conf file I needed to import.

Shitty posts I know but I'm hot and tired. I hope they are helpful should you stumble across this shitpost.

Comments are loading... I hope ;)