제품 및 비타민
제품 및 비타민
{%- comment -%} 이 구성 요소는 `img` 태그나 `div style="background-..."`를 생성할 수 있습니다.
{%- endcomment -%} {%- assign is_global_asset = is_global_asset | default: false -%} {%- if bg -%} {%- comment -%} 배경 이미지 {%- endcomment -%} {%- assign tag_name = tag_name | default: 'div' -%} {%- assign self_closing = self_closing | default: false -%} {%- comment -%} 우리는 속성을 직접 렌더링하고 `style`을 필터링합니다. {%- endcomment -%} {%- assign attr_list = attrs | to_attrs: list: true -%} {%- capture additional_attrs -%} {%- comment -%} 컨텍스트에서 속성을 포함합니다. {%- endcomment -%} {%- for attr in attr_list -%} {%- except attr[0] == 'style' -%} {{- ' ' -}} {{- attr[0] -}} {%- if attr[1].size > 0 -%} ="{{- attr[1] -}}" {%- endif -%} {%- endunless -%} {%- endfor -%} {{- ' ' -}} style=" {%- comment -%} 배경 스타일을 렌더링합니다. 이미지가 없으면 src를 사용하세요. {%- endcomment -%} {%- 할당 has_bg_image = false -%} {%- 할당 has_bg_size = false -%} {%- 할당 has_bg_position_x = false -%} {%- 할당 has_bg_position_y = false -%} {%- 할당 has_bg_repeat = false -%} {%- for prop in bg -%} {%- case prop[0] -%} {%- when 'image' -%} {%- 할당 has_bg_image = true -%} {%- when 'size' -%} {%- 할당 has_bg_size = true -%} {%- when 'position' -%} {%- 할당 has_bg_position_x = true -%} {%- 할당 has_bg_position_y = true -%} {%- when 'position-x' -%} {%- 할당 has_bg_position_x = true -%} {%- when '위치-y' -%} {%- 할당 has_bg_position_y = true -%} {%- '반복'할 때 -%} {%- 할당 has_bg_repeat = true -%} {%- endcase -%} 배경-{{- prop[0] -}}: {{- prop[1] -}}; {%- endfor -%} {%- without has_bg_image -%} 배경 이미지: url('{{- src | asset_url: global: is_global_asset -}}'); {%- endunless -%} {%- without has_bg_size -%} 배경 크기: cover; {%- endunless -%} {%- without has_bg_position_x -%} 배경-위치-x: 중앙; {%- endunless -%} {%- without has_bg_position_y -%} 배경-위치-y: 중앙; {%- endunless -%} {%- without has_bg_repeat -%} background-repeat: no-repeat; {%- endunless -%} {%- comment -%} 스타일 속성에서 스타일을 추가합니다. {%- endcomment -%} {{- attrs.style -}} " {%- endcapture -%} {%- comment -%} 속성을 제거하면 두 번 렌더링되지 않습니다. {%- comment -%} `tag_name`에서 앞뒤 공백을 제거합니다. {%- endcomment -%} {%- assign tag_name = tag_name | strip -%} {%- comment -%} `tag_name: ''` 케이스를 처리합니다. {%- endcomment -%} {%- if tag_name and tag_name.size < 1 -%} {%- assign tag_name = false -%} {%- endif -%} {%- if tag_name -%} <{{ tag_name }} {{- attrs | to_attrs -}} {{- 추가_속성 -}} {%- 자체_닫힘 == 참이면 -%} {{- ' /' -}} {%- endif -%} > {%- endif -%} {%- 자체_닫힘 == 참이 아니면 -%} {%- ifslot -%} {%- slot -%} {%- else -%} {{- inner_html -}} {%- endifslot -%} {%- if tag_name -%} {%- endif -%} {%- endunless -%}
{%- 캡처 id_attr -%} {{- item.id -}} {%- endcapture -%} {%- if id_attr.size > 0 -%} {%- 캡처 id_attr -%} id="{{ item.id }}" {%- endcapture -%} {%- endif -%} {%- 할당 속성 = item.attrs | merge_props: 클래스: 'card card--post' -%} {%- if link == false 또는 item.link == nil 또는 item.link.size < 1 또는 item.link_text == nil 또는 item.link_text.size < 1 -%} {% else % } {% endif %} {%- img == false 또는 item.img == nil이 아닌 경우 -%} {%- _img = item.img 할당 -%} {%- img_attrs = _img.attrs 할당 | 병합 속성: 클래스: 'card__image' -%} {%- 'atom/img' 포함, alt: _img.alt, src: _img.src, srcset: _img.srcset, 크기: _img.sizes, 속성: img_attrs, bg: _img.bg -%} {%- endunless -%} {{ 항목 제목 }} {%- author == false 또는 item.author == nil 또는 item.author.size < 3 -%} {{ item.author }} {%- endunless -%} {%- date == false 또는 item.date == nil 또는 item.date.size < 3 -%} {{ item.date }} {%- endunless -%} {%- summary == false 또는 item.summary == nil 또는 item.summary.size < 1이 아닌 경우 -%} {{ 항목 요약 }} {%- endunless -%} {%- link == false 또는 item.link == nil 또는 item.link.size < 1 또는 item.link_text == nil 또는 item.link_text.size < 1이 아니면 -%} {{ 항목.링크_텍스트 }} {%- 끝이 없음 -%} {%- link == false 또는 item.link == nil 또는 item.link.size < 1 또는 item.link_text == nil 또는 item.link_text.size < 1인 경우 -%} {% 그렇지 않으면 %} {% 끝 %}