Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and enhancements. [7] #1381

Merged
merged 24 commits into from
Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c4baeea
Merge pull request #4 from iissnan/master
ivan-nginx Jan 17, 2017
7db5774
ADD: VK API support. (1)
ivan-nginx Jan 17, 2017
9e79f14
ADD: VK API support. (2)
ivan-nginx Jan 17, 2017
def4dc2
ADD: VK API support. (3)
ivan-nginx Jan 17, 2017
bb89ece
ADD: VK API support. (4)
ivan-nginx Jan 17, 2017
1b8a517
ADD: VK API support. (5)
ivan-nginx Jan 17, 2017
c82924e
ADD: VK API support. (6)
ivan-nginx Jan 17, 2017
1841998
FIX: facebook like/share alignment.
ivan-nginx Jan 17, 2017
ce361f4
FIX: move fb & vk like buttons from top to footer.
ivan-nginx Jan 17, 2017
fb1f5c2
FIX: refatcor buttons style alignment. (2)
ivan-nginx Jan 17, 2017
66fad6d
FIX: for better like buttons style. (3)
ivan-nginx Jan 17, 2017
5128978
FIX: add `fb_like` div for better alignment. (4)
ivan-nginx Jan 18, 2017
dfea208
FIX: refactor social alignment style. (5)
ivan-nginx Jan 18, 2017
1e10b2c
FIX: refactor social alignment style. (6)
ivan-nginx Jan 18, 2017
7f7b248
FIX: refactor social alignment style. (7)
ivan-nginx Jan 18, 2017
1fb1716
FIX: disable `social-like` div on index page . (8)
ivan-nginx Jan 18, 2017
c56b267
FIX: social buttons vertical align. (9)
ivan-nginx Jan 18, 2017
788e795
ADD: hexo-wordcount plugin support. (1)
ivan-nginx Jan 18, 2017
9707b07
ADD: hexo-wordcount plugin support. (2)
ivan-nginx Jan 18, 2017
1eb5ff8
ADD: hexo-wordcount plugin support. (3)
ivan-nginx Jan 18, 2017
4965910
ADD: hexo-wordcount plugin support. (4)
ivan-nginx Jan 18, 2017
614b8ea
ADD: hexo-wordcount plugin support. (5)
ivan-nginx Jan 18, 2017
39521c7
ADD: Yandex verification option. (1)
ivan-nginx Jan 31, 2017
9992dd7
ADD: Yandex verification option. (2)
ivan-nginx Jan 31, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,13 @@ post_meta:
created_at: true
updated_at: false
categories: true


# Post wordcount display settings
# Dependies: https://github.com/willin/hexo-wordcount
post_wordcount:
item_text: true
wordcount: false
min2read: false

# Wechat Subscriber
#wechat_subscriber:
Expand Down Expand Up @@ -300,10 +306,13 @@ mathjax:
# See: https://www.google.com/webmasters/
#google_site_verification:


# Google Analytics
#google_analytics:

# Yandex Webmaster tools verification setting
# See: https://webmaster.yandex.ru/
#yandex_site_verification:

# CNZZ count
#cnzz_siteid:

Expand Down Expand Up @@ -339,6 +348,15 @@ facebook_comments_plugin:
width: 100% # default width is 550px
scheme: light # default scheme is light (light or dark)

# VKontakte API Support.
# To get your AppID visit https://vk.com/editapp?act=create
vkontakte_api:
enable: false
app_id: #<app_id>
like: true
comments: true
num_of_posts: 10


# Show number of visitors to each article.
# You can visit https://leancloud.cn get AppID and AppKey.
Expand Down
4 changes: 4 additions & 0 deletions languages/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title:
archive: Archive
category: Category
tag: Tag
schedule: Schedule

author: Author

Expand All @@ -12,6 +13,7 @@ menu:
tags: Tags
about: About
search: Search
schedule: Schedule
sitemap: Sitemap

sidebar:
Expand All @@ -28,6 +30,8 @@ post:
untitled: Untitled
toc_empty: This post does not have a Table of Contents
visitors: Visitors
wordcount: Words count in article
min2read: Reading time

page:
totally: Totally
Expand Down
6 changes: 4 additions & 2 deletions languages/en.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
title:
archive: Archive
category: Category
schedule: Schedule
tag: Tag
schedule: Schedule

author: Author

menu:
home: Home
archives: Archives
categories: Categories
schedule: Schedule
tags: Tags
about: About
search: Search
schedule: Schedule
sitemap: Sitemap

sidebar:
Expand All @@ -30,6 +30,8 @@ post:
untitled: Untitled
toc_empty: This post does not have a Table of Contents
visitors: Visitors
wordcount: Words count in article
min2read: Reading time

page:
totally: Totally
Expand Down
4 changes: 4 additions & 0 deletions languages/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title:
archive: Архив
category: Категория
tag: Тэг
schedule: Календарь

author: Author

Expand All @@ -12,6 +13,7 @@ menu:
tags: Тэги
about: О сайте
search: Поиск
schedule: Календарь
sitemap: Карта сайта

sidebar:
Expand All @@ -28,6 +30,8 @@ post:
untitled: Без имени
toc_empty: Эта запись без оглавления
visitors: Просмотров
wordcount: Кол-во слов в статье
min2read: Время чтения в минутах

page:
totally: Всего
Expand Down
55 changes: 50 additions & 5 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,6 @@
{% endif %}
{% endif %}

{% if not is_index and theme.facebook_sdk.enable and theme.facebook_sdk.like_button %}
<span class="post-meta-divider">|</span>
<div class="fb-like" data-layout="button_count" data-share="true"></div>
{% endif %}

{# LeanCould PageView #}
{% if theme.leancloud_visitors.enable %}
<span id="{{ url_for(post.path) }}" class="leancloud_visitors" data-flag-title="{{ post.title }}">
Expand All @@ -198,6 +193,38 @@
</span>
{% endif %}

{% if theme.post_wordcount.wordcount or theme.post_wordcount.min2read %}
<div class="post-wordcount">
{% if theme.post_wordcount.wordcount %}
<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 }}
Expand Down Expand Up @@ -294,6 +321,24 @@
</div>
{% endif %}

{% if not is_index %}
{% 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 %}
{% endif %}

{% if not is_index and (post.prev or post.next) %}
<div class="post-nav">
<div class="post-nav-next post-nav-item">
Expand Down
2 changes: 2 additions & 0 deletions layout/_partials/comments.swig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
data-width="{{ theme.facebook_comments_plugin.width }}"
data-colorscheme="{{ theme.facebook_comments_plugin.scheme }}">
</div>
{% elseif theme.vkontakte_api.enable and theme.vkontakte_api.comments %}
<div id="vk_comments"></div>
{% elseif theme.disqus_shortname %}
<div id="disqus_thread">
<noscript>
Expand Down
5 changes: 5 additions & 0 deletions layout/_partials/head.swig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
{% endif %}


{% if theme.yandex_site_verification %}
<meta name="yandex-verification" content="{{ theme.yandex_site_verification }}" />
{% endif %}


{% if theme.baidu_site_verification %}
<meta name="baidu-site-verification" content="{{ theme.baidu_site_verification }}" />
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion layout/_scripts/third-party/analytics.swig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% include 'analytics/facebook-sdk.swig' %}
{% include 'analytics/vkontakte-api.swig' %}
{% include 'analytics/google-analytics.swig' %}
{% include 'analytics/baidu-analytics.swig' %}
{% include 'analytics/tencent-analytics.swig' %}
{% include 'analytics/cnzz-analytics.swig' %}
{% include 'analytics/application-insights.swig' %}
{% include 'analytics/application-insights.swig' %}
27 changes: 27 additions & 0 deletions layout/_scripts/third-party/analytics/vkontakte-api.swig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% if theme.vkontakte_api.enable %}

<div id="vk_api_transport"></div>
<script type="text/javascript">
window.vkAsyncInit = function() {
VK.init({
apiId: {{ theme.vkontakte_api.app_id }}
});

{% if theme.vkontakte_api.like %}
VK.Widgets.Like("vk_like", {type: "mini", height: 20});
{% endif %}

{% if page.comments and theme.vkontakte_api.comments %}
VK.Widgets.Comments("vk_comments", {limit: {{ theme.vkontakte_api.num_of_posts }}, attach: "*"});
{% endif %}
};
setTimeout(function() {
var el = document.createElement("script");
el.type = "text/javascript";
el.src = "//vk.com/js/api/openapi.js";
el.async = true;
document.getElementById("vk_api_transport").appendChild(el);
}, 0);
</script>

{% endif %}
22 changes: 22 additions & 0 deletions source/css/_common/components/post/post-meta.styl
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,25 @@
.posts-expand .post-comments-count {
+mobile() { display: none; }
}
.social-like {
font-size: 14px;
height: 20px;
text-align: center;
border-top: 1px solid #eee;
padding-top: 9px;
margin-top: 45px;
display: flex;
justify-content: center;
}

.vk_like {
width: 85px;
height: 21px;
padding-top: 7px;
align-self: center;
}

.fb_like {
height: 30px;
align-self: center;
}
2 changes: 1 addition & 1 deletion source/css/_common/components/post/post-nav.styl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.post-nav {
display: table;
margin-top: 60px;
margin-top: 15px;
width: 100%;
border-top: 1px solid $gainsboro;
}
Expand Down