strict_variables throws exception on checking if variable exists
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
I'm using a jekyll layout where I want to include content of pages, depending on whether it exists.
Apparently, it is supposed to be done like described in https://github.com/Shopify/liquid/issues/89
In my case it would look as follows:
{% assign title = page.title %}
{% if page.name %}
{% assign title = page.name %}
{% endif %}
<title> {{ title }} | {{ site.title }} </title>
But since I have strict_variables set to true, which is really useful for development, Liquid throws an exception on building (undefined variable name included).
In my opinion, strict_variables should not throw exceptions for cases where the undefined variable is checked for existance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name specific files or tests. Start by locating the strict_variables handling and the undefined-variable check described here; reproduce the Jekyll-style conditional, then verify that checking for an absent variable does not raise while genuine undefined-variable uses remain strict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100