Skip to content

Instantly share code, notes, and snippets.

@nativerez
Last active November 27, 2020 13:06
Show Gist options
  • Save nativerez/0b54eae37b6fd558c9376a1bde2d6f67 to your computer and use it in GitHub Desktop.
Save nativerez/0b54eae37b6fd558c9376a1bde2d6f67 to your computer and use it in GitHub Desktop.
Jekyll section loop
<section id="section-{{ section.title | slugify }}" class="">
<div class="carousel gallery01-main">
{% assign gallery_images = section.images %}
{% for item in gallery_images %}
<div class="carousel-cell w-full h-large">
<img class="w-full h-full object-cover" data-flickity-lazyload="{{ item }}" src="{{ item }}" alt="">
</div>
{% endfor %}
</div>
<div class="carousel gallery01-nav">
{% assign gallery_nav = section.images %}
{% for item in gallery_nav %}
<div class="carousel-cell w-32 h-32">
<img class="w-full h-full object-cover" data-flickity-lazyload="{{ item }}" src="{{ item }}" alt="">
</div>
{% endfor %}
</div>
</section>

sections:

<section id="section-{{ section.title | slugify }}" class="py-24">
<div class="container px-12 mx-auto xl:flex space-y-8 lg:space-y-0 xl:space-x-12 justify-end">
{% if section.title %}
<div class="xl:w-1/3">
<h1 class="mb-6 text-3xl lg:text-4xl font-weight-light leading-tight font-serif">{{ section.title }}</h1>
</div>
{% endif %}
<div class="xl:w-2/3 space-y-8 text-lg">
{{ section.description | markdownify }}
</div>
</div>
</section>
{% assign sections = page.sections | sort: 'order' %}
{% for section in sections %}
{% if section.include != null %}
{% include {{ section.include }} %}
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment