Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Liquid template flag available for app/dist (dev/production) build? #148

Open
oller opened this issue Jun 15, 2015 · 1 comment
Open

Liquid template flag available for app/dist (dev/production) build? #148

oller opened this issue Jun 15, 2015 · 1 comment

Comments

@oller
Copy link

oller commented Jun 15, 2015

Hi there,

I'm doing a bit of work integrating the lazySizes responsive image plugin into my jekyll site initially setup with this great generator.

To do this, I need to do a bit of string manipulation on image paths, to add in a {width} variable into the path. This works great on build, when viewing the production site from the /dist dir. However this breaks the paths when just using grunt serve which still references assets from the app dir. I'd rather not build all these images constantly just for dev, so the ability to toggle this via a flag would be ideal.

Is there a way I can get a flag into a liquid template, so jekyll would be aware of its environment, building a production build or not, and I can use this to alter the path to the image accordingly? or should I be looking to try and solve this in grunt?

Any suggestions appreciated, cheers!

@oller oller changed the title Flag for app/dist available in template? Liquid template flag available for app/dist (dev/production) build? Jun 15, 2015
@oller
Copy link
Author

oller commented Jun 15, 2015

Aha, I've added the following values and it seems to work. The build yml file overriding the regular config yml file when I do a full grunt build

config.yml

production: false

config.build.yml

production: true

These can be accessed globally with, and seem to reflect the environment correctly.

{{ site.production }}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant