hexo
This commit is contained in:
34
themes/next/layout/_macro/post-collapse.swig
Normal file
34
themes/next/layout/_macro/post-collapse.swig
Normal file
@ -0,0 +1,34 @@
|
||||
{% macro render(post) %}
|
||||
|
||||
<article class="post post-type-{{ post.type | default('normal') }}" itemscope itemtype="http://schema.org/Article">
|
||||
<header class="post-header">
|
||||
|
||||
<{% if theme.seo %}h3{% else %}h2{% endif %} class="post-title">
|
||||
{% if post.link %}{# Link posts #}
|
||||
<a class="post-title-link post-title-link-external" target="_blank" href="{{ url_for(post.link) }}" itemprop="url">
|
||||
{{ post.title or post.link }}
|
||||
<i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a class="post-title-link" href="{{ url_for(post.path) }}" itemprop="url">
|
||||
{% if post.type === 'picture' %}
|
||||
{{ post.content }}
|
||||
{% else %}
|
||||
<span itemprop="name">{{ post.title | default(__('post.untitled')) }}</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</{% if theme.seo %}h3{% else %}h2{% endif %}>
|
||||
|
||||
<div class="post-meta">
|
||||
<time class="post-time" itemprop="dateCreated"
|
||||
datetime="{{ moment(post.date).format() }}"
|
||||
content="{{ date(post.date, config.date_format) }}" >
|
||||
{{ date(post.date, 'MM-DD') }}
|
||||
</time>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
</article>
|
||||
|
||||
{% endmacro %}
|
14
themes/next/layout/_macro/post-copyright.swig
Normal file
14
themes/next/layout/_macro/post-copyright.swig
Normal file
@ -0,0 +1,14 @@
|
||||
<ul class="post-copyright">
|
||||
<li class="post-copyright-author">
|
||||
<strong>{{ __('post.copyright.author') + __('symbol.colon') }}</strong>
|
||||
{{ post.author | default(config.author) }}
|
||||
</li>
|
||||
<li class="post-copyright-link">
|
||||
<strong>{{ __('post.copyright.link') + __('symbol.colon') }}</strong>
|
||||
<a href="{{ post.url | default(post.permalink) }}" title="{{ post.title }}">{{ post.url | default(post.permalink) }}</a>
|
||||
</li>
|
||||
<li class="post-copyright-license">
|
||||
<strong>{{ __('post.copyright.license_title') + __('symbol.colon') }} </strong>
|
||||
{{ __('post.copyright.license_content', theme.post_copyright.license_url, theme.post_copyright.license) }}
|
||||
</li>
|
||||
</ul>
|
436
themes/next/layout/_macro/post.swig
Normal file
436
themes/next/layout/_macro/post.swig
Normal file
@ -0,0 +1,436 @@
|
||||
{% macro render(post, is_index, post_extra_class) %}
|
||||
|
||||
{% set headlessPost = Array.prototype.indexOf.call(['quote', 'picture'], post.type) > -1 %}
|
||||
|
||||
{% set post_class = 'post post-type-' + post.type | default('normal') %}
|
||||
{% if post_extra_class > 0 %}
|
||||
{% set post_class = post_class + ' ' + post_extra_class | default('') %}
|
||||
{% endif %}
|
||||
{% if post.sticky > 0 %}
|
||||
{% set post_class = post_class + ' ' + 'post-sticky' %}
|
||||
{% endif %}
|
||||
|
||||
<article class="{{ post_class }}" itemscope itemtype="http://schema.org/Article">
|
||||
{##################}
|
||||
{### POST BLOCK ###}
|
||||
{##################}
|
||||
<div class="post-block">
|
||||
<link itemprop="mainEntityOfPage" href="{{ config.url }}{{ url_for(post.path) }}">
|
||||
|
||||
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
|
||||
<meta itemprop="name" content="{{ theme.author }}">
|
||||
<meta itemprop="description" content="{{ theme.signature }}">
|
||||
<meta itemprop="image" content="{{ url_for( theme.avatar | default(theme.images + '/avatar.gif') ) }}">
|
||||
</span>
|
||||
|
||||
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
|
||||
<meta itemprop="name" content="{{ config.title }}">
|
||||
</span>
|
||||
|
||||
{% if not headlessPost %}
|
||||
<header class="post-header">
|
||||
|
||||
{# Not to show title for quote posts that do not have a title #}
|
||||
{% if not (is_index and post.type === 'quote' and not post.title) %}
|
||||
<{% if theme.seo %}h2{% else %}h1{% endif %} class="post-title{% if post.direction && post.direction.toLowerCase() === 'rtl' %} rtl{% endif %}" itemprop="name headline">{#
|
||||
#}{# Link posts #}{#
|
||||
#}{% if post.link %}
|
||||
{% if post.sticky > 0 %}
|
||||
{{ post.sticky }}
|
||||
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
|
||||
<i class="fa fa-thumb-tack"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
<a class="post-title-link post-title-link-external" target="_blank" href="{{ url_for(post.link) }}" itemprop="url">
|
||||
{{ post.title or post.link }}
|
||||
<i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
{% else %}{#
|
||||
#}{% if is_index %}
|
||||
{% if post.sticky > 0 %}
|
||||
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
|
||||
<i class="fa fa-thumb-tack"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
<a class="post-title-link" href="{{ url_for(post.path) }}" itemprop="url">{#
|
||||
#}{{ post.title | default(__('post.untitled'))}}{#
|
||||
#}</a>{#
|
||||
#}{% else %}{{ post.title }}{% endif %}{#
|
||||
#}{% endif %}{#
|
||||
#}</{% if theme.seo %}h2{% else %}h1{% endif %}>
|
||||
{% endif %}
|
||||
|
||||
<div class="post-meta">
|
||||
<span class="post-time">
|
||||
{% if theme.post_meta.created_at %}
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-calendar-o"></i>
|
||||
</span>
|
||||
{% if theme.post_meta.item_text %}
|
||||
<span class="post-meta-item-text">{{ __('post.posted') }}</span>
|
||||
{% endif %}
|
||||
<time title="{{ __('post.created') }}" itemprop="dateCreated datePublished" datetime="{{ moment(post.date).format() }}">
|
||||
{{ date(post.date, config.date_format) }}
|
||||
</time>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.post_meta.created_at and theme.post_meta.updated_at %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.post_meta.updated_at %}
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-calendar-check-o"></i>
|
||||
</span>
|
||||
{% if theme.post_meta.item_text %}
|
||||
<span class="post-meta-item-text">{{ __('post.modified') }}:</span>
|
||||
{% endif %}
|
||||
<time title="{{ __('post.modified') }}" itemprop="dateModified" datetime="{{ moment(post.updated).format() }}">
|
||||
{{ date(post.updated, config.date_format) }}
|
||||
</time>
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
{% if post.categories and post.categories.length and theme.post_meta.categories %}
|
||||
<span class="post-category" >
|
||||
{% if theme.post_meta.created_at or theme.post_meta.updated_at %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
{% endif %}
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-folder-o"></i>
|
||||
</span>
|
||||
{% if theme.post_meta.item_text %}
|
||||
<span class="post-meta-item-text">{{ __('post.in') }}</span>
|
||||
{% endif %}
|
||||
{% for cat in post.categories %}
|
||||
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
|
||||
<a href="{{ url_for(cat.path) }}" itemprop="url" rel="index">
|
||||
<span itemprop="name">{{ cat.name }}</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
{% set cat_length = post.categories.length %}
|
||||
{% if cat_length > 1 and loop.index !== cat_length %}
|
||||
{{ __('symbol.comma') }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if post.comments %}
|
||||
{% if (theme.duoshuo and theme.duoshuo.shortname) or theme.duoshuo_shortname %}
|
||||
<span class="post-comments-count">
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-comment-o"></i>
|
||||
</span>
|
||||
<a href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
|
||||
<span class="post-comments-count ds-thread-count" data-thread-key="{{ post.path }}" itemprop="commentCount"></span>
|
||||
</a>
|
||||
</span>
|
||||
{% elseif theme.facebook_comments_plugin.enable %}
|
||||
<span class="post-comments-count">
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-comment-o"></i>
|
||||
</span>
|
||||
<a href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
|
||||
<span class="post-comments-count fb-comments-count" data-href="{{ post.permalink }}" itemprop="commentCount">0</span> comments
|
||||
</a>
|
||||
</span>
|
||||
{% elseif theme.disqus.enable and theme.disqus.count %}
|
||||
<span class="post-comments-count">
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-comment-o"></i>
|
||||
</span>
|
||||
<a href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
|
||||
<span class="post-comments-count disqus-comment-count"
|
||||
data-disqus-identifier="{{ post.path }}" itemprop="commentCount"></span>
|
||||
</a>
|
||||
</span>
|
||||
{% elseif theme.hypercomments_id %}
|
||||
<!--noindex-->
|
||||
<span class="post-comments-count">
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-comment-o"></i>
|
||||
</span>
|
||||
<a href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
|
||||
<span class="post-comments-count hc-comment-count" data-xid="{{ post.path }}" itemprop="commentsCount"></span>
|
||||
</a>
|
||||
</span>
|
||||
<!--/noindex-->
|
||||
{% elseif theme.changyan.enable and theme.changyan.appid and theme.changyan.appkey %}
|
||||
<span class="post-comments-count">
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-comment-o"></i>
|
||||
</span>
|
||||
{% if is_post() %}
|
||||
<a href="{{ url_for(post.path) }}#SOHUCS" itemprop="discussionUrl">
|
||||
<span id="changyan_count_unit" class="post-comments-count hc-comment-count" data-xid="{{ post.path }}" itemprop="commentsCount"></span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ url_for(post.path) }}#SOHUCS" itemprop="discussionUrl">
|
||||
<span id="url::{{ post.permalink }}" class="cy_cmt_count" data-xid="{{ post.path }}" itemprop="commentsCount" ></span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% elseif is_post() and theme.gitment.enable and theme.gitment.mint and theme.gitment.count %}
|
||||
<span class="post-comments-count">
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-comment-o"></i>
|
||||
</span>
|
||||
<a href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
|
||||
<span class="post-comments-count gitment-comments-count" data-xid="{{ url_for(post.path) }}" itemprop="commentsCount"></span>
|
||||
</a>
|
||||
</span>
|
||||
{% elseif theme.valine.enable and theme.valine.appid and theme.valine.appkey %}
|
||||
<span class="post-comments-count">
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-comment-o"></i>
|
||||
</span>
|
||||
<a href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
|
||||
<span class="post-comments-count valine-comment-count" data-xid="{{ url_for(post.path) }}" itemprop="commentCount"></span>
|
||||
</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{# LeanCould PageView #}
|
||||
{% if theme.leancloud_visitors.enable %}
|
||||
<span id="{{ url_for(post.path) }}" class="leancloud_visitors" data-flag-title="{{ post.title }}">
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-eye"></i>
|
||||
</span>
|
||||
{% if theme.post_meta.item_text %}
|
||||
<span class="post-meta-item-text">{{__('post.visitors')}}:</span>
|
||||
{% endif %}
|
||||
<span class="leancloud-visitors-count"></span>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if not is_index and theme.busuanzi_count.enable and theme.busuanzi_count.page_pv %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="page-pv">{{ theme.busuanzi_count.page_pv_header }}
|
||||
<span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>{{ theme.busuanzi_count.page_pv_footer }}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.post_wordcount.wordcount or theme.post_wordcount.min2read %}
|
||||
<div class="post-wordcount">
|
||||
{% if theme.post_wordcount.wordcount %}
|
||||
{% if not theme.post_wordcount.separated_meta %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
{% endif %}
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-file-word-o"></i>
|
||||
</span>
|
||||
{% if theme.post_wordcount.item_text %}
|
||||
<span class="post-meta-item-text">{{ __('post.wordcount') }}:</span>
|
||||
{% endif %}
|
||||
<span title="{{ __('post.wordcount') }}">
|
||||
{{ wordcount(post.content) }} 字
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.post_wordcount.wordcount and theme.post_wordcount.min2read %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.post_wordcount.min2read %}
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-clock-o"></i>
|
||||
</span>
|
||||
{% if theme.post_wordcount.item_text %}
|
||||
<span class="post-meta-item-text">{{ __('post.min2read') }} ≈</span>
|
||||
{% endif %}
|
||||
<span title="{{ __('post.min2read') }}">
|
||||
{{ min2read(post.content) }} 分钟
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if post.description and (not theme.excerpt_description or not is_index) %}
|
||||
<div class="post-description">
|
||||
{{ post.description }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</header>
|
||||
{% endif %}
|
||||
|
||||
{#################}
|
||||
{### POST BODY ###}
|
||||
{#################}
|
||||
<div class="post-body{% if theme.han %} han-init-context{% endif %}{% if post.direction && post.direction.toLowerCase() === 'rtl' %} rtl{% endif %}" itemprop="articleBody">
|
||||
|
||||
{# Gallery support #}
|
||||
{% if post.photos and post.photos.length %}
|
||||
<div class="post-gallery" itemscope itemtype="http://schema.org/ImageGallery">
|
||||
{% set COLUMN_NUMBER = 3 %}
|
||||
{% for photo in post.photos %}
|
||||
{% if loop.index0 % COLUMN_NUMBER === 0 %}<div class="post-gallery-row">{% endif %}
|
||||
<a class="post-gallery-img fancybox"
|
||||
href="{{ url_for(photo) }}" rel="gallery_{{ post._id }}"
|
||||
itemscope itemtype="http://schema.org/ImageObject" itemprop="url">
|
||||
<img src="{{ url_for(photo) }}" itemprop="contentUrl"/>
|
||||
</a>
|
||||
{% if loop.index0 % COLUMN_NUMBER === 2 %}</div>{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{# Append end tag for `post-gallery-row` when (photos size mod COLUMN_NUMBER) is less than COLUMN_NUMBER #}
|
||||
{% if post.photos.length % COLUMN_NUMBER > 0 %}</div>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if is_index %}
|
||||
{% if post.description and theme.excerpt_description %}
|
||||
{{ post.description }}
|
||||
<!--noindex-->
|
||||
<div class="post-button text-center">
|
||||
<a class="btn" href="{{ url_for(post.path) }}">
|
||||
{{ __('post.read_more') }} »
|
||||
</a>
|
||||
</div>
|
||||
<!--/noindex-->
|
||||
{% elif post.excerpt %}
|
||||
{{ post.excerpt }}
|
||||
<!--noindex-->
|
||||
<div class="post-button text-center">
|
||||
<a class="btn" href="{{ url_for(post.path) }}{% if theme.scroll_to_more %}#{{ __('post.more') }}{% endif %}" rel="contents">
|
||||
{{ __('post.read_more') }} »
|
||||
</a>
|
||||
</div>
|
||||
<!--/noindex-->
|
||||
{% elif theme.auto_excerpt.enable %}
|
||||
{% set content = post.content | striptags %}
|
||||
{{ content.substring(0, theme.auto_excerpt.length) }}
|
||||
{% if content.length > theme.auto_excerpt.length %}...{% endif %}
|
||||
<!--noindex-->
|
||||
<div class="post-button text-center">
|
||||
<a class="btn" href="{{ url_for(post.path) }}{% if theme.scroll_to_more %}#{{ __('post.more') }}{% endif %}" rel="contents">
|
||||
{{ __('post.read_more') }} »
|
||||
</a>
|
||||
</div>
|
||||
<!--/noindex-->
|
||||
{% else %}
|
||||
{% if post.type === 'picture' %}
|
||||
<a href="{{ url_for(post.path) }}">{{ post.content }}</a>
|
||||
{% else %}
|
||||
{{ post.content }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ post.content }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{#####################}
|
||||
{### END POST BODY ###}
|
||||
{#####################}
|
||||
|
||||
{% if theme.wechat_subscriber.enabled and not is_index %}
|
||||
<div>
|
||||
{% include 'wechat-subscriber.swig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if (theme.alipay or theme.wechatpay or theme.bitcoin) and not is_index %}
|
||||
<div>
|
||||
{% include 'reward.swig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.post_copyright.enable and not is_index %}
|
||||
<div>
|
||||
{% include 'post-copyright.swig' with { post: post } %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<footer class="post-footer">
|
||||
{% if post.tags and post.tags.length and not is_index %}
|
||||
<div class="post-tags">
|
||||
{% for tag in post.tags %}
|
||||
<a href="{{ url_for(tag.path) }}" rel="tag"># {{ tag.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not is_index %}
|
||||
{% if theme.rating.enable or (theme.vkontakte_api.enable and theme.vkontakte_api.like) or (theme.facebook_sdk.enable and theme.facebook_sdk.like_button) or (theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable) %}
|
||||
<div class="post-widgets">
|
||||
{% if theme.rating.enable %}
|
||||
<div class="wp_rating">
|
||||
<div id="wpac-rating"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if (theme.vkontakte_api.enable and theme.vkontakte_api.like) or (theme.facebook_sdk.enable and theme.facebook_sdk.like_button) %}
|
||||
<div class="social-like">
|
||||
{% if theme.vkontakte_api.enable and theme.vkontakte_api.like %}
|
||||
<div class="vk_like">
|
||||
<span id="vk_like"></span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.facebook_sdk.enable and theme.facebook_sdk.like_button %}
|
||||
<div class="fb_like">
|
||||
<div class="fb-like" data-layout="button_count" data-share="true"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable %}
|
||||
{% if (theme.vkontakte_api.enable and theme.vkontakte_api.like) or (theme.facebook_sdk.enable and theme.facebook_sdk.like_button) %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
{% endif %}
|
||||
<div id="needsharebutton-postbottom">
|
||||
<span class="btn">
|
||||
<i class="fa fa-share-alt" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if not is_index and (post.prev or post.next) %}
|
||||
<div class="post-nav">
|
||||
<div class="post-nav-next post-nav-item">
|
||||
{% if post.next %}
|
||||
<a href="{{ url_for(post.next.path) }}" rel="next" title="{{ post.next.title }}">
|
||||
<i class="fa fa-chevron-left"></i> {{ post.next.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<span class="post-nav-divider"></span>
|
||||
|
||||
<div class="post-nav-prev post-nav-item">
|
||||
{% if post.prev %}
|
||||
<a href="{{ url_for(post.prev.path) }}" rel="prev" title="{{ post.prev.title }}">
|
||||
{{ post.prev.title }} <i class="fa fa-chevron-right"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set isLast = loop.index % page.per_page === 0 %}
|
||||
{% if is_index and not isLast %}
|
||||
<div class="post-eof"></div>
|
||||
{% endif %}
|
||||
</footer>
|
||||
</div>
|
||||
{######################}
|
||||
{### END POST BLOCK ###}
|
||||
{######################}
|
||||
</article>
|
||||
|
||||
{% endmacro %}
|
30
themes/next/layout/_macro/reward.swig
Normal file
30
themes/next/layout/_macro/reward.swig
Normal file
@ -0,0 +1,30 @@
|
||||
<div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
|
||||
<div>{{ theme.reward_comment }}</div>
|
||||
<button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
|
||||
<span>{{ __('reward.donate') }}</span>
|
||||
</button>
|
||||
<div id="QR" style="display: none;">
|
||||
|
||||
{% if theme.wechatpay %}
|
||||
<div id="wechat" style="display: inline-block">
|
||||
<img id="wechat_qr" src="{{ theme.wechatpay }}" alt="{{ theme.author }} {{ __('reward.wechatpay') }}"/>
|
||||
<p>{{ __('reward.wechatpay') }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.alipay %}
|
||||
<div id="alipay" style="display: inline-block">
|
||||
<img id="alipay_qr" src="{{ theme.alipay }}" alt="{{ theme.author }} {{ __('reward.alipay') }}"/>
|
||||
<p>{{ __('reward.alipay') }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.bitcoin %}
|
||||
<div id="bitcoin" style="display: inline-block">
|
||||
<img id="bitcoin_qr" src="{{ theme.bitcoin }}" alt="{{ theme.author }} {{ __('reward.bitcoin') }}"/>
|
||||
<p>{{ __('reward.bitcoin') }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
175
themes/next/layout/_macro/sidebar.swig
Normal file
175
themes/next/layout/_macro/sidebar.swig
Normal file
@ -0,0 +1,175 @@
|
||||
{% macro render(is_post) %}
|
||||
<div class="sidebar-toggle">
|
||||
<div class="sidebar-toggle-line-wrap">
|
||||
<span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
|
||||
<span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
|
||||
<span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<aside id="sidebar" class="sidebar">
|
||||
{% if theme.sidebar.onmobile %}
|
||||
<div id="sidebar-dimmer"></div>
|
||||
{% endif %}
|
||||
<div class="sidebar-inner">
|
||||
|
||||
{% set display_toc = is_post and theme.toc.enable or is_page and theme.toc.enable %}
|
||||
|
||||
{% if display_toc and toc(page.content).length > 1 %}
|
||||
<ul class="sidebar-nav motion-element">
|
||||
<li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
|
||||
{{ __('sidebar.toc') }}
|
||||
</li>
|
||||
<li class="sidebar-nav-overview" data-target="site-overview-wrap">
|
||||
{{ __('sidebar.overview') }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<section class="site-overview-wrap sidebar-panel{% if not display_toc or toc(page.content).length <= 1 %} sidebar-panel-active{% endif %}">
|
||||
<div class="site-overview">
|
||||
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
|
||||
{% if theme.avatar %}
|
||||
<img class="site-author-image" itemprop="image"
|
||||
src="{{ url_for( theme.avatar | default(theme.images + '/avatar.gif') ) }}"
|
||||
alt="{{ theme.author }}" />
|
||||
{% endif %}
|
||||
<p class="site-author-name" itemprop="name">{{ theme.author }}</p>
|
||||
<p class="site-description motion-element" itemprop="description">{#
|
||||
#}{% if theme.seo %}{#
|
||||
#}{{ theme.signature }}{#
|
||||
#}{% else %}{#
|
||||
#}{{ theme.description }}{#
|
||||
#}{% endif %}{#
|
||||
#}</p>
|
||||
</div>
|
||||
|
||||
<nav class="site-state motion-element">
|
||||
|
||||
{% if config.archive_dir != '/' and site.posts.length > 0 %}
|
||||
<div class="site-state-item site-state-posts">
|
||||
{% if theme.menu.archives %}
|
||||
<a href="{{ url_for(theme.menu.archives).split('||')[0] | trim }}">
|
||||
{% else %}
|
||||
<a href="{{ url_for(config.archive_dir) }}">
|
||||
{% endif %}
|
||||
<span class="site-state-item-count">{{ site.posts.length }}</span>
|
||||
<span class="site-state-item-name">{{ __('state.posts') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if site.categories.length > 0 %}
|
||||
{% set categoriesPageQuery = site.pages.find({type: 'categories'}, {lean: true}) %}
|
||||
{% set hasCategoriesPage = categoriesPageQuery.length > 0 %}
|
||||
<div class="site-state-item site-state-categories">
|
||||
{% if hasCategoriesPage %}<a href="{{ url_for(categoriesPageQuery[0].path) }}">{% endif %}
|
||||
<span class="site-state-item-count">{{ site.categories.length }}</span>
|
||||
<span class="site-state-item-name">{{ __('state.categories') }}</span>
|
||||
{% if hasCategoriesPage %}</a>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if site.tags.length > 0 %}
|
||||
{% set tagsPageQuery = site.pages.find({type: 'tags'}, {lean: true}) %}
|
||||
{% set hasTagsPage = tagsPageQuery.length > 0 %}
|
||||
<div class="site-state-item site-state-tags">
|
||||
{% if hasTagsPage %}<a href="{{ url_for(tagsPageQuery[0].path) }}">{% endif %}
|
||||
<span class="site-state-item-count">{{ site.tags.length }}</span>
|
||||
<span class="site-state-item-name">{{ __('state.tags') }}</span>
|
||||
{% if hasTagsPage %}</a>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</nav>
|
||||
|
||||
{% if theme.rss %}
|
||||
<div class="feed-link motion-element">
|
||||
<a href="{{ url_for(theme.rss) }}" rel="alternate">
|
||||
<i class="fa fa-rss"></i>
|
||||
RSS
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.social %}
|
||||
<div class="links-of-author motion-element">
|
||||
{% for name, link in theme.social %}
|
||||
<span class="links-of-author-item">
|
||||
<a href="{{ link.split('||')[0] | trim }}" target="_blank" title="{{ name }}">
|
||||
{% if theme.social_icons.enable %}
|
||||
<i class="fa fa-fw fa-{{ link.split('||')[1] | trim | default('globe') }}"></i>{#
|
||||
#}{% endif %}{#
|
||||
#}{% if not theme.social_icons.icons_only %}{#
|
||||
#}{{ name }}{#
|
||||
#}{% endif %}{#
|
||||
#}</a>
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set cc = {'by': 1, 'by-nc': 1, 'by-nc-nd': 1, 'by-nc-sa': 1, 'by-nd': 1, 'by-sa': 1, 'zero': 1} %}
|
||||
{% if theme.creative_commons in cc %}
|
||||
<div class="cc-license motion-element" itemprop="license">
|
||||
<a href="https://creativecommons.org/{% if theme.creative_commons === 'zero' %}publicdomain/zero/1.0{% else %}licenses/{{ theme.creative_commons }}/4.0{% endif %}/" class="cc-opacity" target="_blank">
|
||||
<img src="{{ url_for(theme.images) }}/cc-{{ theme.creative_commons }}.svg" alt="Creative Commons" />
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Blogroll #}
|
||||
{% if theme.links %}
|
||||
<div class="links-of-blogroll motion-element {{ "links-of-blogroll-" + theme.links_layout | default('inline') }}">
|
||||
<div class="links-of-blogroll-title">
|
||||
<i class="fa fa-fw fa-{{ theme.links_icon | default('globe') | lower }}"></i>
|
||||
{{ theme.links_title }}
|
||||
</div>
|
||||
<ul class="links-of-blogroll-list">
|
||||
{% for name, link in theme.links %}
|
||||
<li class="links-of-blogroll-item">
|
||||
<a href="{{ link }}" title="{{ name }}" target="_blank">{{ name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include '../_custom/sidebar.swig' %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% if display_toc and toc(page.content).length > 1 %}
|
||||
<!--noindex-->
|
||||
<section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
|
||||
<div class="post-toc">
|
||||
|
||||
{% if page.toc_number === undefined %}
|
||||
{% set toc = toc(page.content, { "class": "nav", list_number: theme.toc.number }) %}
|
||||
{% else %}
|
||||
{% set toc = toc(page.content, { "class": "nav", list_number: page.toc_number }) %}
|
||||
{% endif %}
|
||||
|
||||
{% if toc.length <= 1 %}
|
||||
<p class="post-toc-empty">{{ __('post.toc_empty') }}</p>
|
||||
{% else %}
|
||||
<div class="post-toc-content">{{ toc }}</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</section>
|
||||
<!--/noindex-->
|
||||
{% endif %}
|
||||
|
||||
{% if theme.sidebar.b2t %}
|
||||
<div class="back-to-top">
|
||||
<i class="fa fa-arrow-up"></i>
|
||||
{% if theme.sidebar.scrollpercent %}
|
||||
<span id="scrollpercent"><span>0</span>%</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</aside>
|
||||
{% endmacro %}
|
4
themes/next/layout/_macro/wechat-subscriber.swig
Normal file
4
themes/next/layout/_macro/wechat-subscriber.swig
Normal file
@ -0,0 +1,4 @@
|
||||
<div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
|
||||
<img id="wechat_subscriber_qcode" src="{{ theme.wechat_subscriber.qcode }}" alt="{{ theme.author }} wechat" style="width: 200px; max-width: 100%;"/>
|
||||
<div>{{ theme.wechat_subscriber.description }}</div>
|
||||
</div>
|
Reference in New Issue
Block a user