I'm constructing a Jekyll site on Github pages. I have a Github action that delivers fresh daily data to my _data/ file, with today's timestamp:
_data/
somedata_YYYYMMDD.json
I can construct a variable in a few ways to capture the filename for today's data file:
{% assign today_data = 'now' | date: "%Y%m%d" | prepend: 'site.data.somedata_' %}
or
{% capture today_data %}
site.data.somedata_{{ 'now' | date: "%Y%m%d" }}
{% endcapture %}
In both of these cases, if I try to put the today_data variable to use, Liquid interprets it as an inert string, rather than as a pointer to a liquid object. So, if I try {{today_data}}
, I get the string "site.data.somedata_20200902", but I'd like it to return the contents of the json file.
I consulted a few other questions, but they don't seem to apply correctly to this situation:
using Liquid variables inside of a liquid tag call - This person uses a variable as a string in a tag. I need the variable to be interpreted as a path to a data object.
Using filters in Liquid tags - This person also creates a variable to be used as a string in a tag.
Use js variable with Shopify liquid tag - Same, I think: using a variable as a string in a tag.
Use Liquid filter with Liquid Tag - This person is filtering the output of a tag.