I'm trying to set a background-img
in my css.liquid
file, and I need to get YAML variables in the page. How can I do that? This is what I have so far:
background-image: url({{ page.locales[page.default_locale][page.first_name] }});
I also had this:
background-image: url('{{ page.first_name }}{{ page.last_name }}.jpg');
Just use these styles 'inline' and not in your css.liquid file. That is by far the easiest (and least ugly) solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With