Shopify / liquid

Liquid markup language. Safe, customer facing template language for flexible web apps.

Home Page:https://shopify.github.io/liquid/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stack / Portal feature request

andershagbard opened this issue · comments

Imagine you have a section where you want to preload an image. You can't do this within the section, so you kinda have to duplicate some of the code into the theme.liquid file. (At least, this is the case for Shopify development)

Stack / Portal feature could potentially make this way easier:

layouts/theme.liquid

<head>
  {%- stack preloads -%}
</head>

<body>
  {%- section 'my-section' -%}
</body>

sections/my-section.liquid

<img src="my_image.png">

{%- push preloads -%}
  <link rel="preload" as="image" href="my_image.png">
{%- endpush -%}

The naming convention is taken from Laravel Blade.