liblog v2.0功能更新(2016/9/14)
发布于 作者 livi 489 次浏览 来自 liblog

添加文章内容调用标签,通过标签配置即可实现内容的读取

如:获取置顶的6条文章列表

{% article data = "topList",limit= "6",flag="totop"%}

然后再循环出来

{% article data = "topList",limit= "6",flag="totop"%}
      {% for item in topList %}
      <div class="blogs">
         <figure>
         <a href="/page/{{item.aid}}.html" target="_blank"><img src="{{_web.url}}{{'static/common/images/common/default.jpg' if item.picurl=='' else item.picurl }}" title="{{item.title}}"></a>
          </figure>
          <ul class="articleul">
          <h3><a href="/page/{{item.aid}}.html" target="_blank">{{item.title}}</a></h3>
           <p>{{item.abstract}}</p>
          <div class="author">
           <span class="lm f_l">
             <a href="javascript:void(0);">{{item.tagname}}</a>
            </span>
            <span class="dtime f_l">{{think.datetime(item.createtime,"YYYY-MM-DD")}}</span>
           </div>
                       <div class="author">
                          <span class="viewnum f_r">
             浏览({{item.view}})</span>
            <span class="pingl f_r">
             评论(<span id="sourceId::{{item.aid}}" class="cy_cmt_count" style="margin: 0px;padding: 0px"></span></span>
                       </div>
          </ul>
        </div>
 {% endfor %}

其他标签如:

站长推荐

{% article data = "torecomList",limit= "6",flag="torecom"%}

图文推荐

{% article data = "picrecomList",limit= "6",flag="topicrecom"%}

liblog2.0将于9月底更新到github 并开源,

欢迎关注!