<commit_before>{% comment %}
The search.liquid template is not a required template.
That search.liquid template is included in the current theme to make it easier for you 
to customize your /search page.
Whether you are using your own template for the search page or not,
the {{ content_for_header }} tag in theme.liquid will always output the following on the /search page:
<link rel="stylesheet" href="/global/search.css" type="text/css" />
So the /search page is always styled by a globally-hosted stylesheet called search.css.
You may override and complement that CSS in your theme's stylesheet.
We are using a div#searchresults below so that the styles defined in search.css get
applied to the elements on this page; the 'searchresults' id is used in the CSS
selectors inside search.css.
{% endcomment %}

<div id="searchresults">
  
  <form action="/search" method="get" class="search-form" role="search">
    <p>
      <input type="text" name="q" value="{{ search.terms | escape }}" />
      <input type="submit" value="Search store..." />
    </p>
  </form>
  
  {% comment %}
  search.performed is false when accessing the /search page without a 'q' parameter set
  in the URL. A shop-owner can link to the /search page from one of his link lists.
  It is important to show a search form on that page if search.performed is false.
  {% endcomment %}
  
  {% if search.performed %}
    
    {% paginate search.results by 10 %}
    
    {% comment %}
    Common pitfall to avoid: search.results should never be accessed before the opening 
    paginate tag. Move the opening and closing paginate tags to the very top and bottom of your
    search.liquid template if you need to.
    If you fail to do the above, the pagination of search results will be broken.
    search.results_count is fine to access in or out of the paginate block.
    {% endcomment %}
  
    {% if search.results_count == 0 %}  
      <p>Your search for "{{ search.terms }}" did not yield any results.</p>              
    {% else %}  

        <ol>
        {% for item in search.results %}      
        <li class="clearfix">
          <h3>{{ item.title | link_to: item.url }}</h3>
          {% if item.featured_image %}
          <div class="result-image">
            <a href="{{ item.url }}" title="{{ item.title | escape }}">
              {{ item.featured_image.src | product_img_url: 'small' | img_tag: item.featured_image.alt }}
            </a>
          </div>
          {% endif %}
          <span>{{ item.content | strip_html | truncatewords: 40 | highlight: search.terms }}</span>        
        </li>
        {% endfor %}
        </ol>      

    {% endif %}    
    
    <p>{{ paginate | default_pagination }}</p>
    
    {% endpaginate %}    
    
  {% endif %}  

</div><commit_msg>Fixed formatting and added consistency to pagination markup.<commit_after>{% comment %}
The search.liquid template is not a required template.
That search.liquid template is included in the current theme to make it easier for you 
to customize your /search page.
Whether you are using your own template for the search page or not,
the {{ content_for_header }} tag in theme.liquid will always output the following on the /search page:
<link rel="stylesheet" href="/global/search.css" type="text/css" />
So the /search page is always styled by a globally-hosted stylesheet called search.css.
You may override and complement that CSS in your theme's stylesheet.
We are using a div#searchresults below so that the styles defined in search.css get
applied to the elements on this page; the 'searchresults' id is used in the CSS
selectors inside search.css.
{% endcomment %}

<div id="searchresults">
  
  <form action="/search" method="get" class="search-form" role="search">
    <p>
      <input type="text" name="q" value="{{ search.terms | escape }}" />
      <input type="submit" value="Search store..." />
    </p>
  </form>
  
  {% comment %}
  search.performed is false when accessing the /search page without a 'q' parameter set
  in the URL. A shop-owner can link to the /search page from one of his link lists.
  It is important to show a search form on that page if search.performed is false.
  {% endcomment %}
  
  {% if search.performed %}
    
    {% paginate search.results by 10 %}
    
    {% comment %}
    Common pitfall to avoid: search.results should never be accessed before the opening 
    paginate tag. Move the opening and closing paginate tags to the very top and bottom of your
    search.liquid template if you need to.
    If you fail to do the above, the pagination of search results will be broken.
    search.results_count is fine to access in or out of the paginate block.
    {% endcomment %}
  
    {% if search.results_count == 0 %}  
    <p>Your search for "{{ search.terms }}" did not yield any results.</p>              
    {% else %}
    <ol>
      {% for item in search.results %}      
      <li class="clearfix">
        <h3>{{ item.title | link_to: item.url }}</h3>
        {% if item.featured_image %}
        <div class="result-image">
          <a href="{{ item.url }}" title="{{ item.title | escape }}">
            {{ item.featured_image.src | product_img_url: 'small' | img_tag: item.featured_image.alt }}
          </a>
        </div>
        {% endif %}
        <span>{{ item.content | strip_html | truncatewords: 40 | highlight: search.terms }}</span>        
      </li>
      {% endfor %}
    </ol>
    {% endif %}    
    
    {% if paginate.pages > 1 %}
    <div id="pagination">
      {{ paginate | default_pagination }}
    </div>
    {% endif %}
    
    {% endpaginate %}    
    
  {% endif %}  

</div>
{'fraction_non_alphanumeric': 0.11266607617360495, 'fraction_numerical': 0.002657218777679362, 'mean_word_length': 2.652005174644243, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 54, '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': '1646384', 'n_tokens_mistral': 1702, 'n_tokens_neox': 1568, 'n_words': 645}