pretzel
pretzel copied to clipboard
Is there a way to specify a different _config.yml when baking?
I need some ability to specify "environment" when baking / exporting the pages. For example I might need one that's for live (i.e. _config_live.yml) and one for local (i.e. _config_local.yml) etc. Is there a way to do that? So I would expect something like this when I am calling the bake:
For live .\Pretzel.exe -t razor -c _config_live.yml -d .\live_site For local .\Pretzel.exe -t razor -c _config_local.yml -d .\local_site
There is nothing for that right now but that's a good idea. I don't know if I'll have the time to do it, but a PR is always welcome :smiley:
Adding to this conversation, It would be great to see such a feature mimic the Jekyll way of allowing overrides. For example, pretzel taste --config=_config.yml,_config.dev.yml
would first load the regular config, then override/add any values with the second config.
This is great, for example, for locally testing a site at localhost:8080/
, but publishing at example.com/blog/
as Jekyll does by default by referenceing links like {{ site.baseurl }}/2016/10/01/a-thought-on-pretzel
. Regular config defines baseurl as "/blog"
and dev config overrides it as ""
.
If I have time to look at the code and see if it is trivial enough for a guy who is completely unfamiliar with programming for Windows, I'll submit a PR sometime.
Thanks a lot for your interest in Pretzel! 😄 I will gladly review your PR.
I've written a bat script to get round this issue and use _config_bake.yml & _config_taste.yml file
@echo off
set source=C:\src\
set dest=C:\build\
copy %source%_config_bake.yml %source%_config.yml /Y
Pretzel.exe bake %source% --cleantarget --destination=%dest%