Liquid Warning with bracket square notation


#1

I’m using the expression below to manage a site in both french and english

{% assign data-input = site.data.[page.lang] %}

It works perfectly but when I launch Jekyll’s server, I get the following message :

Liquid Warning: Liquid syntax error (line 16): Expected id but found open_square in "{{site.data.[page.lang] }}" in index.html

Do you have any idea on how to avoid such an error message ? Thanks a lot


#2

I don’t think you need the period before the open bracket:

site.data[page.lang]