Skip to content

Commit

Permalink
Merge pull request #1697 from ivan-nginx/master
Browse files Browse the repository at this point in the history
Fixes and enhancements. [12]
  • Loading branch information
ivan-nginx authored Aug 1, 2017
2 parents 261c066 + 9e822c7 commit f2b4498
Show file tree
Hide file tree
Showing 39 changed files with 1,177 additions and 248 deletions.
1 change: 1 addition & 0 deletions .javascript_ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ source/vendors/*
source/lib/*
source/js/src/affix.js
source/js/src/scrollspy.js
source/js/src/js.cookie.js
55 changes: 51 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ menu_icons:
scheme: Muse
#scheme: Mist
#scheme: Pisces
#scheme: Gemini


# ---------------------------------------------------------------
Expand All @@ -99,10 +100,20 @@ scheme: Muse
# When an globe mask icon presenting up means that the item has no mapping icon.
social_icons:
enable: true
icons_only: false
transition: false
# Icon Mappings.
# KeyMapsToSocialItemKey: NameOfTheIconFromFontAwesome
GitHub: github
E-Mail: envelope
Google: google
Twitter: twitter
FB Page: facebook
VK Group: vk
Skype: skype
YouTube: youtube
Instagram: instagram
StackOverflow: stack-overflow
Weibo: weibo

# Blog rolls
Expand Down Expand Up @@ -202,6 +213,12 @@ post_wordcount:
#qcode: /path/to/your/wechatqcode ex. /uploads/wechat-qcode.jpg
#description: ex. subscribe to my blog by scanning my public wechat account

# Reward
#reward_comment: Donate comment here
#wechatpay: /images/wechatpay.jpg
#alipay: /images/alipay.jpg
#bitcoin: /images/bitcoin.png

# Declare license on posts
post_copyright:
enable: false
Expand All @@ -213,6 +230,12 @@ post_copyright:
# Misc Theme Settings
# ---------------------------------------------------------------

# Reduce padding / margin indents on devices with narrow width.
mobile_layout_economy: false

# Android Chrome header panel color ($black-deep).
android_chrome_color: "#222"

# Custom Logo.
# !!Only available for Default Scheme currently.
# Options:
Expand All @@ -222,7 +245,6 @@ custom_logo:
enabled: false
image:


# Code Highlight theme
# Available value:
# normal | night | night eighties | night blue | night bright
Expand Down Expand Up @@ -463,7 +485,6 @@ algolia_search:
hits_empty: "We didn't find any results for the search: ${query}"
hits_stats: "${hits} results found in ${time} ms"


# Local search
# Dependencies: https://github.com/flashlab/hexo-generator-search
local_search:
Expand All @@ -478,11 +499,37 @@ local_search:
# ---------------------------------------------------------------
# Tags Settings
# ---------------------------------------------------------------
# External URL with BASE64 encrypt & decrypt

# External URL with BASE64 encrypt & decrypt.
# Usage: {% exturl text url "title" %}
# Alias: {% extlink text url "title" %}
exturl: false

# Note tag (bs-callout).
note:
# Note tag style values:
# - simple bs-callout old alert style. Default.
# - modern bs-callout new (v2-v3) alert style.
# - flat flat callout style with background, like on Mozilla or StackOverflow.
# - disabled disable all CSS styles import of note tag.
style: simple
icons: false
border_radius: 3
# Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6).
# Offset also applied to label tag variables. This option can work with disabled note tag.
light_bg_offset: 0

# Label tag.
label: true

# Tabs tag.
tabs:
enable: true
transition:
tabs: false
labels: true
border_radius: 0


#! ---------------------------------------------------------------
#! DO NOT EDIT THE FOLLOWING SETTINGS
Expand Down Expand Up @@ -620,4 +667,4 @@ js: js
images: images

# Theme version
version: 5.1.1
version: 5.1.2
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isn-next",
"version": "5.1.0",
"version": "5.1.2",
"homepage": "https://github.com/iissnan/hexo-theme-next",
"authors": [
"iissnan <iissnan@gmail.com>"
Expand Down
30 changes: 14 additions & 16 deletions layout/_macro/post-copyright.swig
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{% if theme.post_copyright.enable %}
<ul class="post-copyright">
<li class="post-copyright-author">
<strong>{{ __('post.copyright.author') + __('symbol.colon') }}</strong>
{{ config.author }}
</li>
<li class="post-copyright-link">
<strong>{{ __('post.copyright.link') + __('symbol.colon') }}</strong>
<a href="{{ post.permalink }}" title="{{ post.title }}">{{ 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>
{% endif %}
<ul class="post-copyright">
<li class="post-copyright-author">
<strong>{{ __('post.copyright.author') + __('symbol.colon') }}</strong>
{{ config.author }}
</li>
<li class="post-copyright-link">
<strong>{{ __('post.copyright.link') + __('symbol.colon') }}</strong>
<a href="{{ post.permalink }}" title="{{ post.title }}">{{ 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>
46 changes: 31 additions & 15 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
{% set headlessPost = Array.prototype.indexOf.call(['quote', 'picture'], post.type) > -1 %}

{% set post_class = 'post post-type-' + post.type | default('normal') %}
{% set post_class = post_class + ' ' + post_extra_class | default('') %}
{% 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">
Expand All @@ -26,7 +32,7 @@

{# 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" itemprop="name headline">{#
<{% 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 %}
Expand Down Expand Up @@ -239,7 +245,10 @@
</header>
{% endif %}

<div class="post-body{% if theme.han %} han-init-context{% endif %}" itemprop="articleBody">
{#################}
{### 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 %}
Expand Down Expand Up @@ -301,24 +310,27 @@
{{ post.content }}
{% endif %}
</div>
{#####################}
{### END POST BODY ###}
{#####################}

<div>
{% if not is_index %}
{% if theme.wechat_subscriber.enabled and not is_index %}
<div>
{% include 'wechat-subscriber.swig' %}
{% endif %}
</div>
</div>
{% endif %}

<div>
{% if not is_index %}
{% if (theme.alipay or theme.wechatpay or theme.bitcoin) and not is_index %}
<div>
{% include 'reward.swig' %}
{% endif %}
</div>
</div>
{% endif %}

<div>
{% if not is_index %}
{% if theme.post_copyright.enable and not is_index %}
<div>
{% include 'post-copyright.swig' with { post: post } %}
{% endif %}
</div>
</div>
{% endif %}

<footer class="post-footer">
{% if post.tags and post.tags.length and not is_index %}
Expand Down Expand Up @@ -384,6 +396,10 @@
<div class="post-eof"></div>
{% endif %}
</footer>
</div>
{######################}
{### END POST BLOCK ###}
{######################}
</article>

{% endmacro %}
50 changes: 29 additions & 21 deletions layout/_macro/reward.swig
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
{% if theme.alipay or theme.wechatpay %}
<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>赏</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 }} WeChat Pay"/>
<p>微信打赏</p>
</div>
{% endif %}
{% if theme.alipay %}
<div id="alipay" style="display: inline-block">
<img id="alipay_qr" src="{{ theme.alipay }}" alt="{{ theme.author }} Alipay"/>
<p>支付宝打赏</p>
</div>
{% endif %}
</div>
<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>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 }} WeChat Pay"/>
<p>WeChat Pay</p>
</div>
{% endif %}

{% if theme.alipay %}
<div id="alipay" style="display: inline-block">
<img id="alipay_qr" src="{{ theme.alipay }}" alt="{{ theme.author }} Alipay"/>
<p>Alipay</p>
</div>
{% endif %}

{% if theme.bitcoin %}
<div id="bitcoin" style="display: inline-block">
<img id="bitcoin_qr" src="{{ theme.bitcoin }}" alt="{{ theme.author }} Bitcoin"/>
<p>Bitcoin</p>
</div>
{% endif %}

</div>
{% endif %}
</div>
4 changes: 3 additions & 1 deletion layout/_macro/sidebar.swig
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
{% if theme.social_icons.enable %}
<i class="fa fa-fw fa-{{ theme.social_icons[name] | default('globe') | lower }}"></i>
{% endif %}
{{ name }}
{% if not theme.social_icons.icons_only %}
{{ name }}
{% endif %}
</a>
</span>
{% endfor %}
Expand Down
2 changes: 0 additions & 2 deletions layout/_macro/wechat-subscriber.swig
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% if theme.wechat_subscriber.enabled %}
<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>
{% endif %}
2 changes: 2 additions & 0 deletions layout/_partials/head.swig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="{{ theme.android_chrome_color }}">


{% if theme.pace %}
Expand Down Expand Up @@ -115,6 +116,7 @@
scheme: '{{ theme.scheme }}',
sidebar: {{ theme.sidebar | json_encode }},
fancybox: {{ theme.fancybox }},
tabs: {{ theme.tabs.enable }},
motion: {{ theme.use_motion }},
duoshuo: {
userId: '{{ theme.duoshuo_info.user_id | default() }}',
Expand Down
10 changes: 10 additions & 0 deletions layout/_scripts/schemes/gemini.swig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{%
set scripts = [
'src/affix.js',
'src/schemes/pisces.js'
]
%}

{% for script in scripts %}
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ script }}?v={{ theme.version }}"></script>
{% endfor %}
Loading

0 comments on commit f2b4498

Please sign in to comment.