I've got a custom variable that I'm passing into my include file which is strangely being treated as the filename. I'm not sure what I'm doing wrong:
I'm including my component with:
{% include_relative includes/form/components/modal.html for="purpose" %}
And the contents of the includes/form/components/modal.html is:
<div class="modal-custom modal-custom-white" data-modal-custom="{% include.for %}" data-modal-requires-update-button>
<div class="modal-custom-background bg-white"></div>
<div class="modal-custom-content p-3">
{% if include.title %}
<h5 class="font-weight-normal text-dark mb-3">{% include.title %}</h5>
{% else %}
<h5 class="font-weight-normal text-dark mb-3"><strong>Tap</strong> to choose:</h5>
{% endif %}
<!-- Modal content here -->
{% if include.content %}
{% include.content %}
{% endif %}
</div>
<button type="button" class="modal-custom-close is-large bg-light" onclick="toggleModal('purpose', 'close-retain');diposeExpandedToggler('purpose', true)"></button>
</div>
I'm running the latest version of Jekyll, version 4.2.0 and if I remove the for then everything works just fine. I've tried:
- renaming the variable
- cleaning the cache
- formatting the variable in different ways such as:
for=purposeandfor="purpose"
I've created something similar in another component and everything works fine there, but the error I'm getting here is:
Liquid Exception: Could not locate the included file '.for' in any of ["/Users/USER/Sites/MY-PROJECT/src/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source. in icicle.html
Which is strange. What am I missing?