{%- comment -%} Ang component na ito ay maaaring makabuo ng `img` tag o isang `div style="background-..."`.
{%- endcomment -%} {%- assign is_global_asset = is_global_asset | default: false -%} {%- if bg -%} {%- comment -%} Background image {%- endcomment -%} {%- assign tag_name = tag_name | default: 'div' -%} {%- assign self_closing = self_closing | default: false -%} {%- comment -%} Nag-render kami ng attrs sa aming sarili at sinasala ang `style`. {%- endcomment -%} {%- assign attr_list = attrs | to_attrs: list: true -%} {%- capture additional_attrs -%} {%- comment -%} Isama ang mga attribute mula sa konteksto. {%- endcomment -%} {%- para sa attr sa attr_list -%} {%- maliban kung attr[0] == 'style' -%} {{- ' ' -}} {{- attr[0] -} } {%- if attr[1].size > 0 -%} ="{{- attr[1] -}}" {%- endif -%} {%- endunless -%} {%- endfor -%} {{- ' ' -}} style=" {%- comment -%} Mag-render ng mga bg style. Gumamit ng src kung hindi kami nakakuha ng imahe. {%- endcomment -%} {%- assign has_bg_image = false -%} {%- assign has_bg_size = false -%} {%- assign has_bg_position_x = false -%} {%- assign has_bg_position_y = false -%} {%- assign has_bg_repeat = false -%} {%- para sa prop sa bg -%} {%- case prop[0] -%} {%- kapag 'image' -%} {%- assign has_bg_image = true -%} {% - kapag 'size' -%} {%- assign has_bg_size = true -%} {%- kapag 'position' -%} {%- assign has_bg_position_x = true -%} {%- assign has_bg_position_y = true -%} {% - kapag 'position-x' -%} {%- assign has_bg_position_x = true -%} {%- kapag 'position-y' -%} {%- assign has_bg_position_y = true -%} {%- kapag 'repeat' - %} {%- assign has_bg_repeat = true -%} {%- endcase -%} background-{{- prop[0] -}}: {{- prop[1] -}}; {%- endfor -%} {%- unless has_bg_image -%} background-image: url('{{- src | asset_url: global: is_global_asset -}}'); {%- endunless -%} {%- unless has_bg_size -%} background-size: cover; {%- endunless -%} {%- unless has_bg_position_x -%} background-position-x: center; {%- endunless -%} {%- unless has_bg_position_y -%} background-position-y: center; {%- endunless -%} {%- unless has_bg_repeat -%} background-repeat: no-repeat; {%- endunless -%} {%- comment -%} Magdagdag ng anumang mga estilo mula sa attribute ng style. {%- endcomment -%} {{- attrs.style -}} " {%- endcapture -%} {%- comment -%} Alisin ang mga attr upang hindi namin i-render ang mga ito nang dalawang beses. {%- comment -%} Alisin ang nangunguna at sumusunod na whitespace mula sa `tag_name`. {%- endcomment -%} {%- assign tag_name = tag_name | strip -%} {%- comment -%} Pangasiwaan ang `tag_name: ''` case. {%- endcomment -%} {%- if tag_name at tag_name.size < 1 -%} {%- assign tag_name = false -%} {%- endif -%} {%- if tag_name -%} <{{ tag_name }} {{- attrs | to_attrs -}} {{- additional_attrs -}} {%- if self_closing == true -%} {{- ' /' -}} {%- endif -%} > {%- endif -%} {%- maliban kung self_closing == true -%} {%- ifslot -%} {%- slot -%} {%- else -%} {{- inner_html -}} {%- endifslot -%} {%- if tag_name -%} {%- endif -%} {%- endunless -%}
{%- capture id_attr -%} {{- item.id -}} {%- endcapture -%} {%- if id_attr.size > 0 -%} {%- capture id_attr -%} id="{{ item .id }}" {%- endcapture -%} {%- endif -%} {%- assign attrs = item.attrs | merge_props: class: 'card card--post' -%} {%- kung link == false o item.link == nil o item.link.size < 1 o item.link_text == nil o item.link_text.size < 1 -%} {% else %} {% endif %} {%- unless img == false o item.img == nil -%} {%- assign _img = item.img -%} {%- assign img_attrs = _img.attrs | merge_props: class: 'card__image' -%} {%- isama ang 'atom/img', alt: _img.alt, src: _img.src, srcset: _img.srcset, sizes: _img.sizes, attrs: img_attrs, bg: _img.bg -%} {%- endunless -%} {{ item.title }} {%- unless author == false or item.author == nil or item.author.size < 3 -%} {{ item.author }} {%- endunless -%} {%- unless date == false o item .date == nil o item.date.size < 3 -%} {{ item.date }} {%- endunless -%} {%- maliban kung buod == false o item.summary == nil o item.summary.size < 1 -%} {{ item.summary }} {%- endunless -%} {%- unless link == false or item.link == nil or item.link.size < 1 or item.link_text == nil or item.link_text.size < 1 -%} {{ item.link_text }} {%- walang katapusan -%} {%- kung link == false o item.link == nil o item.link.size < 1 o item.link_text == nil o item.link_text.size < 1 -%} {% else %} {% endif %}
* Lahat ng impormasyon ay maaaring magbago. Maaaring naglalaman ang mga larawan ng mga modelo. Ang mga indibidwal na resulta ay hindi ginagarantiyahan at maaaring mag-iba.