article页面


默认article页面就是文章详情显示页面了

对于分页可以看到,当前也是采用的函数式分页,我们让用户来选择分页方式,到底是全局取分页还是当前分类下取分页。(见api一览)

<!doctype html>
<html lang="zh-cn">

<head>
    {{template "header.html" .}}
</head>

<body>
    {{template "nav.html" .}}

    {{template "bread-article.html" .}}


    <div class="container container_clear pd-10">
        <div class="col-md-9">
            <div class="bk-white">
                <div class="pd-10">
                    
                        <header>
                            <h1 class="text-center">{{.title}}</h1>
                            <p class="text-center text-line">
                                <span>发布时间:<time>{{.one.CreatedAt|Time2Str}}</time></span><span>阅读数:{{.one.Views}}</span>
                                {{range $k,$v := .ext}}
                                    <span>{{$k}}{{$v}}</span>
                                {{end}}
                            </p>
                        </header>
                        <hr>
                        {{.one.Content|Str2Html}}
                        <hr>
                        <footer>
                            <nav aria-label="...">
                                <ul class="pager">

                                    {{$pre := ArticleCatePre .one.ArticleCateID .one.ID}}
                                    {{$next := ArticleCateNext .one.ArticleCateID .one.ID}}
                                    <li class="previous"><span aria-hidden="true">&larr;</span>
                                            上一篇:{{$pre.name}}
                                    </li>
                                    <li class="next">下一篇:{{$next.name}}<span
                                                aria-hidden="true">&rarr;</span>
                                    </li>
                                </ul>
                            </nav>
                        </footer>
                    </article>

                </div>
            </div>
        </div>

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




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

</html>