{% comment %} Self-styled post card that follows the site's light/dark mode. Useful for showing a static snapshot of a social-media post (or any quoted source) that can't be themed via its own embed. Not a live widget. Parameters: author - author / page / profile name author_url - link to the author (optional; defaults to href) avatar - avatar image URL (optional; falls back to the author's initial) date - human-readable date string (optional) image - a single post image URL (optional) images - a comma-separated list of image URLs (optional; use instead of `image`) href - link to the original post / source link_text - footer link label (optional; default 'Zobacz oryginaƂ') width - max width in px (optional; default 500) text - post body; capture it first, then pass as text= {% endcomment %}
{% if include.avatar %} {{ include.author }} {% else %} {% endif %}
{{ include.author }} {% if include.date %}{{ include.date }}{% endif %}
{% if include.text %}
{{ include.text | markdownify }}
{% endif %} {% assign _raw_images = include.images | default: include.image %} {% assign _clean_images = '' %} {% if _raw_images %} {% assign _split_images = _raw_images | split: ',' %} {% for _img in _split_images %} {% assign _img_url = _img | strip %} {% if _img_url != '' %} {% if _clean_images == '' %} {% assign _clean_images = _img_url %} {% else %} {% assign _clean_images = _clean_images | append: '|||' | append: _img_url %} {% endif %} {% endif %} {% endfor %} {% endif %} {% assign card_images = _clean_images | split: '|||' %} {% if card_images.size > 0 %}
{%- for img_url in card_images -%} {{ include.author }} {%- endfor -%}
{% endif %} {% if include.href %} {{ include.link_text | default: 'Zobacz oryginaƂ' }} {% endif %}