category页面


默认情况下,category的内容都在同一个category里面,当然,你也可以在后台定制不同分类的模板

<!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">相关内容</div>
                <!-- List group -->
                <ul class="list-group">
                    {{range .all}}
                    {{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>
                {{if gt .page .pageCount}}
                当前没有查询到数据
                {{end}}   
                {{if le .page .pageCount}}
                <div class="panel-footer">
                    <nav aria-label="...">
                        <ul class="pager">
                            {{if eq 1 .page}}
                            <li class="disabled">首页</li>
                            <li class="disabled">上一页</li>
                            {{else}}
                            <li>首页</li>
                            <li>上一页</li>
                            {{end}}

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

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

   

    

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

</html>