---
layout: layout
---

<!-- Image to hack wechat -->
<!-- <img src="<%= config['url'] %><%= config['root'] %>img/icon_wechat.png" width="0" height="0"> -->

<!-- Post Content -->
<article>
    <div class="container">
        <div class="row">

            <!-- Post Container -->
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                post-container">
                <div id="main">
                    <%- page.content %>
                </div>
                <hr>

                <% if(config['duoshuo_share'] && config['duoshuo_username']) { %>
                <!-- 多说 Share start -->
                </style>
                <div class="ds-share" style="text-align: right" data-thread-key="<%= page.path %>"
                    data-title="<%= page.title %>" data-url="<%= page.permalink %>"
                    data-content="<%- truncate(strip_html(page.content), {length: 50, omission: '...'}) %> | <%= config.SEOTitle %> ">
                    <div class="ds-share-inline">
                        <ul class="ds-share-icons-16">
                            <li data-toggle="ds-share-icons-more"><a class="ds-more" href="#">分享到：</a></li>
                            <li><a class="ds-wechat flat" href="javascript:void(0);" data-service="wechat">微信</a></li>
                            <li><a class="ds-weibo flat" href="javascript:void(0);" data-service="weibo">微博</a></li>
                            <li><a class="ds-douban flat" href="javascript:void(0);" data-service="douban">豆瓣</a></li>
                        </ul>
                        <div class="ds-share-icons-more">
                        </div>
                    </div>
                    <hr>
                </div>
                <!-- 多说 Share end-->
                <% } %>

                <ul class="pager">
                    <% if (page.prev){ %>
                    <li class="previous">
                        <a href="<%- config.root %><%- page.prev.path %>" title="<%- page.prev.title %>">&larr; Previous
                            Post</a>
                    </li>
                    <% } %>
                    <% if (page.next){ %>
                    <li class="next">
                        <a href="<%- config.root %><%- page.next.path %>" title="<%- page.next.title %>">Next Post
                            &rarr;</a>
                    </li>
                    <% } %>
                </ul>

                <% if(config['duoshuo_username']) { %>
                <!-- 多说评论框 start -->
                <div class="comment">
                    <div class="ds-thread" data-thread-key="<%= page.path %>" data-title="<%= page.title %>"
                        data-url="<%= page.permalink %>">
                    </div>
                </div>
                <!-- 多说评论框 end -->
                <% } %>

                <% if(config['disqus_username']) { %>
                <!-- disqus 评论框 start -->
                <div class="comment">
                    <div id="disqus_thread" class="disqus-thread"></div>
                </div>
                <!-- disqus 评论框 end -->
                <% } %>

            </div>
            <!-- Side Catalog Container -->
            <% if ((page.catalog)&&(!page.lock)) { %>
            <div class="
            col-lg-2 col-lg-offset-0
            visible-lg-block
            sidebar-container
            catalog-container">
                <div class="side-catalog">
                    <hr class="hidden-sm hidden-xs">
                    <h5>
                        <a class="catalog-toggle" href="#">CATALOG</a>
                    </h5>
                    <ul class="catalog-body"></ul>
                </div>
            </div>
            <% } %>

            <!-- Sidebar Container -->

            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                sidebar-container">

                <!-- Featured Tags -->
                <% if(config['featured-tags']) { %>
                <section>
                    <!-- no hr -->
                    <h5><a href="<%= config.root %>tags/">FEATURED TAGS</a></h5>
                    <div class="tags" style="margin-top:-5px">
                        <% page.tags.forEach(function(tag){ %>
                        <a class="tag" href="<%= config.root %>tags/#<%= tag.name %>"
                            title="<%= tag.name %>"><%= tag.name %></a>
                        <% }) %>
                    </div>
                </section>
                <% }%>

                <!-- Friends Blog -->
                <% if(config.friends) { %>
                <hr>
                <h5>FRIENDS</h5>
                <ul class="list-inline">

                    <% config.friends.forEach(function(friend){ %>
                    <li><a href="<%= friend.href %>" target="_blank" rel="noopener"><%= friend.title %></a></li>
                    <% }); %>
                </ul>
                <% }%>
            </div>

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

<% if(config['duoshuo_username']) { %>
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
    // dynamic User by Hux
    var _user = '<%= config['duoshuo_username'] %>';

    // duoshuo comment query.
    var duoshuoQuery = { short_name: _user };
    (function () {
        var ds = document.createElement('script');
        ds.type = 'text/javascript'; ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0]
            || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
</script>
<!-- 多说公共JS代码 end -->
<% } %>

<% if(config['disqus_username']) { %>
<!-- disqus 公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
    /* * * CONFIGURATION VARIABLES * * */
    var disqus_shortname = "<%= config['disqus_username'] %>";
    var disqus_identifier = "<%= page.permalink %>";
    var disqus_url = "<%= page.permalink %>";

    (function () {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
<!-- disqus 公共JS代码 end -->
<% } %>
