<!doctype html>
[#escape x as (x)!?html]
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>搜索 - ${site.title}</title>
  <meta name="keywords" content="${site.seoKeywords}">
  <meta name="description" content="${site.seoDescription}">
  [#include 'includes_meta.html'/]
  [#include 'includes_css.html'/]
  [#include 'includes_js.html'/]
</head>
<body>
[#assign headerShadow=true/]
[#include 'includes_header.html'/]
<div class="container">
  <div class="collapse d-xl-block mt-3">
    <form action="${dy}/search">
      <div class="input-group">
        <input type="text" class="form-control" id="q" name="q" value="${Params.q}" placeholder="搜索" aria-label="搜索">
        <div class="input-group-append">
          <button class="btn btn-outline-secondary" type="submit">
            <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-search" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
              <path fill-rule="evenodd" d="M10.442 10.442a1 1 0 0 1 1.415 0l3.85 3.85a1 1 0 0 1-1.414 1.415l-3.85-3.85a1 1 0 0 1 0-1.415z"></path>
              <path fill-rule="evenodd" d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zM13 6.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0z"></path>
            </svg>
          </button>
        </div>
      </div>
    </form>
  </div>
  [#if Params.q!?trim != '']
  [@EsArticlePage q=Params.q! isOperatorAnd='true'; pagedList]
    <h3 class="mt-3">搜索结果</h3>
    <p class="small text-muted">为您找到相关结果 ${pagedList.totalElements} 篇</p>
    <ul class="list-unstyled">
      [#list pagedList.content as bean]
        <li class="mt-3 media border-bottom position-relative pb-3">
          [#if bean.image??][@A bean=bean class="mr-3"]<img src="${bean.image}" class="rounded-sm cm-media-img" alt="${bean.title}">[/@A][/#if]
          <div class="media-body es-highlight">
            <p class="mt-0 mb-1">[@A bean=bean class="cm-link text-decoration-none"][#noescape]${bean.highlightTitle!bean.title!}[/#noescape][/@A]</p>
            <p class="text-muted d-none d-sm-block mb-2">
              [@A bean=bean class="text-reset text-sm text-decoration-none"][#noescape]${bean.highlightBody!substring(bean.body,100,'...')!}[/#noescape][/@A]
            </p>
            <div class="small text-muted mt-3 clearfix">
              <div class="float-left">
                <span>[#list bean.channel.paths as c][@A bean=c/][#if c_has_next] > [/#if][/#list]</span>
              </div>
              <div class="float-right"><i class="ml-2 far fa-clock"></i> ${bean.publishDate.format('yyyy-MM-dd')}</div>
            </div>
          </div>
        </li>
      [/#list]
    </ul>
    [#include 'includes_page.html'/]
  [/@EsArticlePage]
  [/#if]
</div>
[#include 'includes_footer.html'/]
</body>
</html>
[/#escape]
