<commit_before>{% extends getPartial('page-design') %}

{% set showDefaultHomepage = config("Ceres.default.homepage") %}
{% set companyLogo  = config("Ceres.header.company_logo") %}
{% set companyName  = config("Ceres.header.company_name") %}

{% block PartialHead %}
    <meta property="og:title" content="{{ companyName }}"/>
    <meta property="og:type" content="article"/>
    <meta property="og:url" content="{{ services.webstoreConfig.getWebstoreConfig().domainSsl }}"/>
    <meta property="og:image"
          content="{% if ('http' in companyLogo) or ('layout/' in companyLogo) %}{{ companyLogo }}{% else %}{{ plugin_path('Ceres') }}/{{ companyLogo }}{% endif %}"/>

    <link rel="canonical"
          href="{{ services.webstoreConfig.getWebstoreConfig().domainSsl }}{{ item.documents[0].data | itemURL }}">

    <script type="application/ld+json">
        {"@context": "http://schema.org","@type": "WebSite","url": "{{ services.webstoreConfig.getWebstoreConfig().domainSsl }}
        ","potentialAction":{"@type": "SearchAction","target": "{{ services.webstoreConfig.getWebstoreConfig().domainSsl }}
        /search?query={search_term}","query-input": "required name=search_term"}}

    </script>
{% endblock %}

{% block PageBody %}

    {% if showDefaultHomepage == "true" %}

        {% include 'Ceres::Homepage.MarketingHomepage.twig' %}

    {% else %}
        {% import "Ceres::PageDesign.Macros.LayoutContainer" as LayoutContainer %}

        {% block ThemeHomepage %}
            {% set overrideHomepageContainer = LayoutContainer.show("Ceres::Homepage") %}
            {% if overrideHomepageContainer | trim is empty %}

                {% set lang = services.sessionStorage.getLang() %}
                {% set configItemName = config("Ceres.item.name") %}

                {% set slider1 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.sliderItemId1")]}).documents[0].data,
                url: config("Ceres.homepage.sliderImageUrl1") } %}
                {% set slider2 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.sliderItemId2")]}).documents[0].data,
                url: config("Ceres.homepage.sliderImageUrl2") } %}
                {% set slider3 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.sliderItemId3")]}).documents[0].data,
                url: config("Ceres.homepage.sliderImageUrl3") } %}

                {% if slider1.url | trim is empty %}
                    {% set slider1 = slider1 | merge({url: slider1.item.images | itemImages | first}) %}
                {% endif %}
                {% if slider2.url | trim is empty %}
                    {% set slider2 = slider2 | merge({url: slider2.item.images | itemImages | first}) %}
                {% endif %}
                {% if slider3.url | trim is empty %}
                    {% set slider3 = slider3 | merge({url: slider3.item.images | itemImages | first}) %}
                {% endif %}

                {% set heroExtra1 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.heroExtraItemId1")]}).documents[0].data,
                url: config("Ceres.homepage.heroExtraImageUrl1") } %}
                {% set heroExtra2 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.heroExtraItemId2")]}).documents[0].data,
                url: config("Ceres.homepage.heroExtraImageUrl2") } %}

                {% if heroExtra1.url | trim is empty %}
                    {% set heroExtra1 = heroExtra1 | merge({url: heroExtra1.item.images | itemImages | first}) %}
                {% endif %}
                {% if heroExtra2.url | trim is empty %}
                    {% set heroExtra2 = heroExtra2 | merge({url: heroExtra2.item.images | itemImages | first}) %}
                {% endif %}

                {% set category1 = services.category.get(config("Ceres.homepage.homepageCategory1"), lang) %}
                {% set category2 = services.category.get(config("Ceres.homepage.homepageCategory2"), lang) %}
                {% set category3 = services.category.get(config("Ceres.homepage.homepageCategory3"), lang) %}
                {% set category4 = services.category.get(config("Ceres.homepage.homepageCategory4"), lang) %}
                {% set category5 = services.category.get(config("Ceres.homepage.homepageCategory5"), lang) %}
                {% set category6 = services.category.get(config("Ceres.homepage.homepageCategory6"), lang) %}

                {% set paginatedCategoryList1 =
                services.itemLoader.loadForTemplate(
                'Ceres::ItemList.ItemListView',
                itemLoaderPresets.categoryList,
                {'categoryId': category3.id, 'page':1, 'items':4, 'sorting': itemSort, 'variationShowType': config("Ceres.item.variation_show_type")}) %}

                {% set paginatedCategoryList2 =
                services.itemLoader.loadForTemplate(
                'Ceres::ItemList.ItemListView',
                itemLoaderPresets.categoryList,
                {'categoryId': category6.id, 'page':1, 'items':4, 'sorting': itemSort, 'variationShowType': config("Ceres.item.variation_show_type")}) %}

                {% set categoryList1 = paginatedCategoryList1.documents %}
                {% set categoryList2 = paginatedCategoryList2.documents %}
<commit_msg>homepage: - Slider1, Slider2, Slider3, heroExtra1 and heroExtra2 will now take the image with position 0<commit_after>{% extends getPartial('page-design') %}

{% set showDefaultHomepage = config("Ceres.default.homepage") %}
{% set companyLogo  = config("Ceres.header.company_logo") %}
{% set companyName  = config("Ceres.header.company_name") %}

{% block PartialHead %}
    <meta property="og:title" content="{{ companyName }}"/>
    <meta property="og:type" content="article"/>
    <meta property="og:url" content="{{ services.webstoreConfig.getWebstoreConfig().domainSsl }}"/>
    <meta property="og:image"
          content="{% if ('http' in companyLogo) or ('layout/' in companyLogo) %}{{ companyLogo }}{% else %}{{ plugin_path('Ceres') }}/{{ companyLogo }}{% endif %}"/>

    <link rel="canonical"
          href="{{ services.webstoreConfig.getWebstoreConfig().domainSsl }}{{ item.documents[0].data | itemURL }}">

    <script type="application/ld+json">
        {"@context": "http://schema.org","@type": "WebSite","url": "{{ services.webstoreConfig.getWebstoreConfig().domainSsl }}
        ","potentialAction":{"@type": "SearchAction","target": "{{ services.webstoreConfig.getWebstoreConfig().domainSsl }}
        /search?query={search_term}","query-input": "required name=search_term"}}

    </script>
{% endblock %}

{% block PageBody %}

    {% if showDefaultHomepage == "true" %}

        {% include 'Ceres::Homepage.MarketingHomepage.twig' %}

    {% else %}
        {% import "Ceres::PageDesign.Macros.LayoutContainer" as LayoutContainer %}

        {% block ThemeHomepage %}
            {% set overrideHomepageContainer = LayoutContainer.show("Ceres::Homepage") %}
            {% if overrideHomepageContainer | trim is empty %}

                {% set lang = services.sessionStorage.getLang() %}
                {% set configItemName = config("Ceres.item.name") %}

                {% set slider1 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.sliderItemId1")]}).documents[0].data,
                url: config("Ceres.homepage.sliderImageUrl1") } %}
                {% set slider2 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.sliderItemId2")]}).documents[0].data,
                url: config("Ceres.homepage.sliderImageUrl2") } %}
                {% set slider3 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.sliderItemId3")]}).documents[0].data,
                url: config("Ceres.homepage.sliderImageUrl3") } %}

                {% if slider1.url | trim is empty %}
                    {% set slider1Image = slider1.item.images | itemImages | orderByKey('position') | first %}
                    {% set slider1 = slider1 | merge({url: slider1Image.url}) %}
                {% endif %}
                {% if slider2.url | trim is empty %}
                    {% set slider2Image = slider2.item.images | itemImages | orderByKey('position') | first %}
                    {% set slider2 = slider2 | merge({url: slider2Image.url}) %}
                {% endif %}
                {% if slider3.url | trim is empty %}
                    {% set slider3Image = slider3.item.images | itemImages | orderByKey('position') | first %}
                    {% set slider3 = slider3 | merge({url: slider3Image.url}) %}
                {% endif %}

                {% set heroExtra1 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.heroExtraItemId1")]}).documents[0].data,
                url: config("Ceres.homepage.heroExtraImageUrl1") } %}
                {% set heroExtra2 = {
                item: services.itemLoader.loadForTemplate('Ceres::Homepage.Homepage', itemLoaderPresets.items, {variationIds: [config("Ceres.homepage.heroExtraItemId2")]}).documents[0].data,
                url: config("Ceres.homepage.heroExtraImageUrl2") } %}

                {% if heroExtra1.url | trim is empty %}
                    {% set heroExtra1Image = heroExtra1.item.images | itemImages | orderByKey('position') | first %}
                    {% set heroExtra1 = heroExtra1 | merge({url: heroExtra1Image.url}) %}
                {% endif %}
                {% if heroExtra2.url | trim is empty %}
                    {% set heroExtra2Image = heroExtra2.item.images | itemImages | orderByKey('position') | first %}
                    {% set heroExtra2 = heroExtra2 | merge({url: heroExtra2Image.url}) %}
                {% endif %}

                {% set category1 = services.category.get(config("Ceres.homepage.homepageCategory1"), lang) %}
                {% set category2 = services.category.get(config("Ceres.homepage.homepageCategory2"), lang) %}
                {% set category3 = services.category.get(config("Ceres.homepage.homepageCategory3"), lang) %}
                {% set category4 = services.category.get(config("Ceres.homepage.homepageCategory4"), lang) %}
                {% set category5 = services.category.get(config("Ceres.homepage.homepageCategory5"), lang) %}
                {% set category6 = services.category.get(config("Ceres.homepage.homepageCategory6"), lang) %}

                {% set paginatedCategoryList1 =
                services.itemLoader.loadForTemplate(
                'Ceres::ItemList.ItemListView',
                itemLoaderPresets.categoryList,
                {'categoryId': category3.id, 'page':1, 'items':4, 'sorting': itemSort, 'variationShowType': config("Ceres.item.variation_show_type")}) %}

                {% set paginatedCategoryList2 =
                services.itemLoader.loadForTemplate(
                'Ceres::ItemList.ItemListView',
                itemLoaderPresets.categoryList,
                {'categoryId': category6.id, 'page':1, 'items':4, 'sorting': itemSort, 'variationShowType': config("Ceres.item.variation_show_type")}) %}

                {% set categoryList1 = paginatedCategoryList1.documents %}
                {% set categoryList2 = paginatedCategoryList2.documents %}

{'fraction_non_alphanumeric': 0.14985830971828637, 'fraction_numerical': 0.012168694782463744, 'mean_word_length': 2.710265924551639, 'pattern_counts': {'":': 14, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6631452', 'n_tokens_mistral': 3646, 'n_tokens_neox': 3247, 'n_words': 544}