mirror of
https://github.com/Damillora/Yuika
synced 2024-11-05 02:17:32 +00:00
19 lines
859 B
Handlebars
19 lines
859 B
Handlebars
{{!--
|
|
Wow what the hell is going on in here even?
|
|
|
|
Ok so, several templates use this big header with a giant BG image. Nice idea, but big images
|
|
have a heavy impact on performance, so it's a good idea to make them responsive. Because we
|
|
can only get the image dynamically using Handlebars, and we can only set the image to properly
|
|
be a background image using CSS, we end up with a handful of inline styles.
|
|
|
|
If the template in question has a background image, then we render responsive image styles
|
|
for it, and apply those styles to the <header> tag. Else, we just output a <header> tag
|
|
with a `no-image` class so we can style it accordingly.
|
|
--}}
|
|
<div class="post-image-box">
|
|
{{#if feature_image}}
|
|
<img class="post-image" src="{{img_url feature_image size='m'}}">
|
|
{{else}}
|
|
<img class="post-image" src="{{img_url @site.cover_image size='m'}}">
|
|
{{/if}}
|
|
</div> |