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
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).