Stack / Portal feature request
andershagbard opened this issue · comments
Anders Søgaard commented
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.