style: adjust the liquid syntax of some code

This commit is contained in:
jeffreytse 2021-06-25 14:19:46 +08:00
parent 404a26e6a9
commit 3340bcd1b7

View file

@ -15,19 +15,19 @@
{%- include functions.html func='get_banner' -%} {%- include functions.html func='get_banner' -%}
{% if banner_image %} {%- if banner_image -%}
{% if banner_background %} {%- if banner_background -%}
<style> <style>
html .page-banner { html .page-banner {
background: {{ banner_background }}; background: {{ banner_background }};
} }
</style> </style>
{% endif %} {%- endif -%}
{% if banner_height %} {%- if banner_height -%}
<style> <style>
{% assign num = banner_height | times: 1 %} {%- assign num = banner_height | times: 1 -%}
{% assign unit = banner_height | replace_first: num %} {%- assign unit = banner_height | replace_first: num -%}
{% assign banner_min_height = banner_min_height | default: banner_height %} {%- assign banner_min_height = banner_min_height | default: banner_height -%}
html .page-banner { html .page-banner {
height: {{ banner_height | times: 0.368 | append: unit }}; height: {{ banner_height | times: 0.368 | append: unit }};
min-height: {{ banner_min_height }}; min-height: {{ banner_min_height }};
@ -36,9 +36,9 @@
height: {{ banner_height }}; height: {{ banner_height }};
} }
</style> </style>
{% endif %} {%- endif -%}
{% if banner_opacity %} {%- if banner_opacity -%}
<style> <style>
html .page-banner .page-banner-img > *:first-child { html .page-banner .page-banner-img > *:first-child {
opacity: {{ banner_opacity }}; opacity: {{ banner_opacity }};
@ -48,7 +48,7 @@
opacity: {{ banner_opacity | times: 0.718 }}; opacity: {{ banner_opacity | times: 0.718 }};
} }
</style> </style>
{% endif %} {%- endif -%}
{%- if banner_heading_style -%} {%- if banner_heading_style -%}
<style> <style>
html .page-banner .page-banner-inner > *:first-child > *:nth-child(1) { html .page-banner .page-banner-inner > *:first-child > *:nth-child(1) {