pretzel icon indicating copy to clipboard operation
pretzel copied to clipboard

Is there a way to specify a different _config.yml when baking?

Open ghost opened this issue 11 years ago • 4 comments

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

ghost avatar May 31 '13 06:05 ghost

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:

laedit avatar Dec 14 '15 07:12 laedit

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.

happycollision avatar Dec 14 '16 19:12 happycollision

Thanks a lot for your interest in Pretzel! 😄 I will gladly review your PR.

laedit avatar Dec 15 '16 03:12 laedit

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%

dalenicholls avatar Feb 01 '18 12:02 dalenicholls