Skip to content
This repository was archived by the owner on Sep 10, 2020. It is now read-only.

fix: Use of undefined variables - #2

Open
epage wants to merge 4 commits into
mre:sourcefrom
epage:fix
Open

fix: Use of undefined variables#2
epage wants to merge 4 commits into
mre:sourcefrom
epage:fix

Conversation

@epage

@epage epage commented Jan 4, 2018

Copy link
Copy Markdown

For now, cobalt is becoming stricter on the user of undefined variables to help catch problems when migrating sites through cobalt-org/cobalt.rs#346. It'd make sense to loosen these restriction some (like allow {% if variable %} for existence tests) after the migration is complete (terrible to modify every page when adding a new variable) but I think some of the strictness will remain.

With this PR, your site correctly builds against 346 after running cobalt migrate. Hopefully my guesses for how to change your site are close enough :).

I will follow up with a PR that migrates your site once 346 is dev complete. Feel free to start playing with it and providing feedback (particularly around cobalt-org/cobalt.rs#323).

epage added 4 commits January 3, 2018 09:31
Cobalt's liquid has been changed to fail on missing variables.  This
could be made less strict in the future.

This means that every page reusing a layout needs the variables defined,
even if it is to `Nil`.

So added
- comments
- humandate
- social_img
- subtitle
- translations
- css
The version of liquid used has a logic bug with testing nil variables,
so making the check explicit so it builds correctly.  cobalt.rs#346
includes the fix for this.
@epage epage mentioned this pull request Jan 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant