Code du thème Base

Le thème de référence, version 1.1.0. Tout télécharger (.zip)

templates/index.html

{% if show.hero %}
<section class="hero{% if settings.hero_image %} with-image{% endif %}"{% if settings.hero_image %} style="--hero: url('{{ settings.hero_image | replace: "'", "" }}')"{% endif %}>
  <div class="wrap hero-inner">
    <h1>{{ settings.hero_title | default: shop.name }}</h1>
    {% if settings.hero_text %}<p class="lead">{{ settings.hero_text }}</p>{% endif %}
    {% if modules.catalog and menu %}<a class="btn" href="{{ menu.first.url }}">Découvrir {{ menu.first.name }}</a>
    {% elsif modules.booking %}<a class="btn" href="{{ shop.booking_url }}">Prendre rendez-vous</a>
    {% elsif modules.contact %}<a class="btn" href="{{ shop.contact_url }}">Nous contacter</a>{% endif %}
  </div>
</section>
{% endif %}

<div class="wrap">
  {% if show.home_categories and menu %}
  <section class="block">
    <div class="block-head"><h2>Nos rayons</h2></div>
    <div class="tiles">
      {% for c in menu %}
      <a class="tile" href="{{ c.url }}">
        {% if c.image %}<img src="{{ c.image }}" alt="" loading="lazy">{% else %}<span class="tile-letter">{{ c.name | truncate: 1, "" }}</span>{% endif %}
        <span class="tile-name">{{ c.name }}</span>
        <small>{{ c.product_count }} {{ c.product_count | pluralize: "produit", "produits" }}</small>
      </a>
      {% endfor %}
    </div>
  </section>
  {% endif %}

  {% if modules.catalog and show.home_featured and featured %}
  <section class="block">
    <div class="block-head"><h2>Notre sélection</h2></div>
    {% include "product-grid" with products: featured %}
  </section>
  {% endif %}

  {% if modules.catalog and show.home_newest and newest.size > 4 %}
  <section class="block">
    <div class="block-head"><h2>Nouveautés</h2></div>
    {% include "product-grid" with products: newest %}
  </section>
  {% endif %}

  {% if show.home_text and home_text %}<section class="block prose">{{ home_text }}</section>{% endif %}

  {% if not modules.catalog and pages %}
  <section class="block">
    <div class="tiles pages-tiles">
      {% for p in pages | limit: 6 %}<a class="tile page-tile" href="{{ p.url }}"><span class="tile-name">{{ p.title }}</span><small>Découvrir →</small></a>{% endfor %}
    </div>
  </section>
  {% endif %}

  {% if modules.catalog and not featured %}
  <div class="empty">
    <p class="empty-title">La boutique ouvre bientôt</p>
    <p>Les premiers produits arrivent.</p>
  </div>
  {% endif %}
  <div class="block-end"></div>
</div>