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

fix: Use of undefined variables #2

Open
wants to merge 4 commits into
base: source
Choose a base branch
from
Open

fix: Use of undefined variables #2

wants to merge 4 commits into from

Conversation

epage
Copy link

@epage epage commented Jan 4, 2018

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).

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