title: Display START and END range of objects with Liquid in jekyll static site
body: <p>I have a list of 'products'
  they are structured like this:<br />
  They have a product that act as a parent: <strong>&quot;product 1&quot;</strong><br />
  and then they have multiple variations of that parent <strong>&quot;product 1-small&quot;</strong>, &quot;<strong>product 1-medium&quot;</strong>, <strong>&quot;product 1-large&quot;</strong> etc.<br />
  but the number of their variations vary, one product may have 2 variations, the other may have 5.</p>
  <p>I want to display them like this:</p>
  <p><strong>Product 1</strong><br />
  <em>small - large</em></p>
  <p><strong>product 2</strong><br />
  <em>small - xlarge</em></p>
  <p>how should I do this in liquid on a jekyll static site?</p>
  <p>you can view my website and the page I'm referring here:<br />
  <a href="https://kostasgogas.com/shop/art/prints/new-media-vector/abstract/" rel="nofollow noreferrer">https://kostasgogas.com/shop/art/prints/new-media-vector/abstract/</a></p>
  <p>where the problem is apparent on the price, and size of each product.</p>
  <p>this is an example of my data.yml:</p>
  <pre><code>- id: 'first-art'
    type: variable
  
  - id: 'first-art-small'
    type: variation
    position: 1
    price: '10'
    parent: 'first-art'
  - id: 'first-art-medium'
    type: variation
    position: 2
    price: '20'
    parent: 'first-art'
  - id: 'first-art-large'
    type: variation
    position: 3
    price: '30'
    parent: 'first-art'
  
  
  - id: 'second-art'
    type: variable
  
  - id: 'second-art-small'
    type: variation
    position: 1
    price: '10'
    parent: 'second-art'
  - id: 'second-art-medium'
    type: variation
    position: 2
    price: '20'
    parent: 'second-art'
  - id: 'second-art-large'
    type: variation
    position: 3
    price: '30'
    parent: 'second-art'
  - id: 'second-art-x-large'
    type: variation
    position: 4
    price: '40'
    parent: 'second-art'
  </code></pre>
  <p>The liquid is as follows (currently counting up to 3 variations because I don't know how to do it):</p>
  <pre><code>
  {%- assign printartworks = site.data.products-prints -%}
  {%- for printart in printartworks -%}
  {%- if printart.type == &quot;variable&quot; -%}
  
    &lt;h3&gt;
    {{ printart.id }}
    &lt;/h3&gt;
    &lt;div&gt;
      {%- for variation in site.data.products-prints -%}
        {%- if variation.parent == printart.id -%}
          {%- if variation.position == &quot;1&quot; -%}
            €{{ variation.price }}
          {%- endif -%}
        {%- endif -%}
      {%- endfor -%}
      —
      {%- for variation in site.data.products-prints -%}
        {%- if variation.parent == printart.id -%}
          {%- if variation.position == &quot;3&quot; -%}
            €{{ variation.price }}
          {%- endif -%}
        {%- endif -%}
      {%- endfor -%}
    &lt;/div&gt;
  
  {%- endif -%}
  {%- endfor -%}
  
  </code></pre>