search页面


默认article目前,不管是文章搜索还是商品搜索还是链接搜索都是指向的同一个模板,通过特定的标识区分

    <!doctype html>
    <html lang="zh-cn">
    <head>
        {{template "header.html" .}}
    </head>
    <body>
    {{template "nav.html" .}}
    {{template "bread.html" .}}

    <div class="container container_clear pd-10">
        <div class="col-md-9">
            <div class="panel bg-white pd-5">
                <!-- Default panel contents -->
                <div class="panel-heading">{{if .isSearch}}搜索到与:{{.key}}相关的内容{{else}}所有内容{{end}}</div>
                <!-- List group -->
                <ul class="list-group">
                    {{range .articles}}
                    {{if ne "" .Img}}
                    <li class="list-group-item" style="overflow: hidden;">
                        
                            <img src="{{.Img}}"  title="{{.Title}}">
                        
                        <ul class="cate-right">
                            <li class="title">{{.Title}}</li>
                            <li><i
                                    class="glyphicon glyphicon-time"></i><span><time>{{.CreatedAt|Time2StrData}}</time></span>
                                <i
                                class="glyphicon glyphicon-folder-open"></i><span>{{ArticleCateName .ArticleCateID}}</span>
                            </li>
                            <li class="hidden-xs">{{StrSub .Content 0|Str2Html}}</li>
                        </ul>
                    </li>
                    {{else}}
                    <li class="list-group-item" style="overflow: hidden;">
                        <ul class="cate-right no-right">
                            <li class="title">{{.Title}}</li>
                            <li><i
                                    class="glyphicon glyphicon-time"></i><span><time>{{.CreatedAt|Time2StrData}}</time></span>
                                <i
                                class="glyphicon glyphicon-folder-open"></i><span>{{ArticleCateName .ArticleCateID}}</span>
                            </li>
                            <li class="hidden-xs">{{StrSub .Content 0|Str2Html}}</li>
                        </ul>
                    </li>

                    {{end}}
                    
                    {{end}}
                </ul>
                <div class="panel-footer">
                    <nav aria-label="...">
                        <ul class="pager">
                            {{if ge 1 .page}}
                            <li class="disabled">首页</li>
                            <li class="disabled">上一页</li>
                            {{else}}
                            <li>首页</li>
                            <li>上一页</li>
                            {{end}}

                            {{if ge .page .pageCount  }}
                            <li class="disabled">下一页</li>
                            <li class="disabled">尾页</li>
                            {{else}}
                            <li>下一页</li>
                            <li>尾页</li>
                            {{end}}
                        </ul>
                    </nav>
                </div>
            </div>
        </div>

        <div class="col-md-3">
            {{template "sidebar" .}}
        </div>
    </div>
   


     


    {{template "footer.html" .}}
    {{template "js.html" .}}
    </body>
    </html>