Sha256: e9916f689d43dab6c40a577dc22be2b3598967e634db09f9a9f5213f5365f262

Contents?: true

Size: 947 Bytes

Versions: 1

Compression:

Stored size: 947 Bytes

Contents

---
sort: 3
---

# Fragments

The following are not complete markup; they're building blocks that you can use
to make things outside the scope of JPT.

- `direct_url` Generates an image and returns only its url. Uses
  `fallback_width` and `fallback_format`.

  ```yml
  # _data/picture.yml

  markup_presets:
    direct:
      markup: direct_url
      fallback_width: 800
      fallback_format: webp
  ```

  ```
  {% raw %}
  {% picture direct myimage.jpg %} --> /generated/myimage-800-abcd12345.webp
  {% endraw %}
  ```

- `naked_srcset`: Builds a srcset and nothing else (not even the surrounding quotes).

  ```yml
  # _data/picture.yml

  markup_presets:
    only_srcset:
      markup: naked_srcset
      widths: [800, 1200, 1600]
      formats: webp
  ```

  ```
  {% raw %}
  {% picture only_srcset myimage.jpg %} --> 
  /generated/myimage-800-abcd12345.webp 800w, /generated/myimage-1200-abcd12345.webp 1200w, (...)
  {% endraw %}
  ```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll_picture_tag-2.0.4 docs/users/presets/markup_formats/fragments.md