#include("./layout.html")
#@layout()


#define content()
<div class="col-md-9 cl-left">

    <div class="recommend-index">

        #if(option('calmlog_slides'))
        <div class="recommend-top">
            <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
                <ol class="carousel-indicators">
                    #for(slide : linesOption('calmlog_slides'))
                    <li data-target="#carouselExampleIndicators" data-slide-to="0" class="#(for.index == 0 ? 'active' : '')"></li>
                    #end
                </ol>
                <div class="carousel-inner">
                    #for(slide : linesOption('calmlog_slides','\|'))
                    <div class="carousel-item #(for.index == 0 ? 'active' : '')">
                        <a href="#(slide[1])"><img class="d-block w-100" src="#(slide[0])"></a>
                        <p class="cl-inner-footer">#(slide[2])</p>
                    </div>
                    #end
                </div>
                <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">上一个</span>
                </a>
                <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">下一个</span>
                </a>
            </div>
        </div>
        #end


        #articles(hasThumbnail=true,count=2)
        <div class="recommend-bottom">
            #for(article : articles)
            <div class="recommend-item">
                <a href="#(article.url)">
                    <img src="#(article.showImage ?? 'img/default-img.jpg')" class="img-fluid" alt="">
                </a>
                <p class="recommend-item-bottom">#(article.title)</p>
            </div>
            #end
        </div>
        #end

    </div>

    #articlePage()
    #for(article : articlePage.list)
    <div class="cl-card">
        <a class="card-link" href="#(article.url)">
        <div class="row">

                <div class="col-lg-3 col-md-4 col-sm-12 cl-card-image">
                    <img src="#(article.thumbnail ?? 'img/default-img.jpg')" class="img-fluid" alt="">
                </div>

                <div class="col-lg-9 col-md-8 col-sm-12 cl-card-main">
                    <h3 class="cl-card-main-title">
                        #(article.title)
                    </h3>
                    <p class="cl-card-main-info">#maxLength(article.text,100)</p>
                    <p class="cl-card-more">阅读更多...</p>
                </div>

        </div>
        </a>

    </div>
    #end

    #articlePaginate()
    <nav aria-label="Page navigation example">
        <ul class="pagination justify-content-center">
            #for(page : pages)
            <li class="page-item #(page.style)"><a class="page-link" href="#(page.url ??)">#(page.text)</a></li>
            #end
        </ul>
    </nav>
    #end

    #end

</div>
<div class="col-md-3 cl-right">

    #include("./_rightbar.html")

</div>
#end
