Skip to content

Commit

Permalink
feat: follow me through various channels (#1360)
Browse files Browse the repository at this point in the history
  • Loading branch information
daya0576 authored Jan 31, 2020
1 parent 0289e50 commit c6ed631
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 2 deletions.
10 changes: 8 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ social:
#YouTube: https://youtube.com/yourname || youtube
#Instagram: https://instagram.com/yourname || instagram
#Skype: skype:yourname?call|chat || skype
#RSS: /atom.xml || rss

social_icons:
enable: true
Expand Down Expand Up @@ -277,6 +276,14 @@ reward:
#alipay: /images/alipay.png
#bitcoin: /images/bitcoin.png

# Subscribe through Telegram Channel, Twitter, etc.
# Usage: `Key: permalink || icon (Font Awesome)
follow_me:
#Twitter: https://twitter.com/username || twitter
#Telegram: https://t.me/channel_name || telegram
#Wechat: /images/wechat_channel.jpg || wechat
#RSS: /atom.xml || rss

# Related popular posts
# Dependencies: https://github.com/tea3/hexo-related-popular-posts
related_posts:
Expand Down Expand Up @@ -669,7 +676,6 @@ rating:
# Go to https://www.addthis.com/dashboard to customize your tools.
add_this_id:


# ---------------------------------------------------------------
# Statistics and Analytics
# See: https://theme-next.org/docs/third-party-services/statistics-and-analytics
Expand Down
3 changes: 3 additions & 0 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ reward:
alipay: Alipay
bitcoin: Bitcoin

follow_me:
welcome: Welcome to my other publishing channels

accessibility:
nav_toggle: Toggle navigation bar
prev_page: Previous page
Expand Down
2 changes: 2 additions & 0 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ reward:
wechatpay: 微信支付
alipay: 支付宝
bitcoin: 比特币
follow_me:
welcome: 欢迎关注我的其它发布渠道
accessibility:
nav_toggle: 切换导航栏
prev_page: 上一页
Expand Down
2 changes: 2 additions & 0 deletions languages/zh-HK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ reward:
wechatpay: 微信支付
alipay: 支付寶
bitcoin: 比特幣
follow_me:
welcome: 歡迎關注我的其它發布渠道
accessibility:
nav_toggle: 切換導航欄
prev_page: 上一頁
Expand Down
2 changes: 2 additions & 0 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ reward:
wechatpay: 微信支付
alipay: 支付寶
bitcoin: 比特幣
follow_me:
welcome: 歡迎關注我的其它發布渠道
accessibility:
nav_toggle: 切換導航欄
prev_page: 上一頁
Expand Down
4 changes: 4 additions & 0 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@
{{ partial('_partials/post/post-copyright.swig') }}
{%- endif %}

{%- if theme.follow_me %}
{{ partial('_partials/post/post-followme.swig', {}, {cache: theme.cache.enable}) }}
{%- endif %}

<footer class="post-footer">
{%- if post.tags and post.tags.length %}
{%- if theme.tag_icon %}
Expand Down
23 changes: 23 additions & 0 deletions layout/_partials/post/post-followme.swig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{%- if theme.follow_me %}

<div class="followme">
<p>{{ __('follow_me.welcome') }}</p>

<div class="social-list">
{%- for name, value in theme.follow_me %}
{%- set link = value.split('||')[0] | trim %}
{%- set icon = value.split('||')[1] | trim %}

<div class="social-item">
<a target="_blank" class="social-link" href="{{ link }}">
<span class="icon">
<i class="fa fa-{{ icon }}"></i>
</span>

<span class="label">{{ name }}</span>
</a>
</div>
{%- endfor %}
</div>
</div>
{%- endif %}
42 changes: 42 additions & 0 deletions source/css/_common/components/post/post-followme.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.followme {
align-items: center;
background: $whitesmoke;
border-left: 3px solid $red;
color: $grey;
display: flex;
flex-direction: column;
margin: 2em 0 1em 0;
padding: 1em 1.5em;

.social-list {
align-items: center;
display: flex;
flex-wrap: wrap;

.social-item {
margin: 0.5em 2em;
}
+tablet-mobile() {
.social-item {
margin: 0.5em 0.75em;
}
}

.social-link {
border: none;
display:inline-block;
text-align: center;

.icon {
font-size: 1.75em;
height: 1.75em;
width: 1.75em;
}

.label {
display: block;
font-size: 14px;
}
}
}
}
2 changes: 2 additions & 0 deletions source/css/_common/components/post/post.styl
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@
@import 'post-reward';

@import 'post-copyright' if (hexo-config('creative_commons.post'));

@import 'post-followme' if (hexo-config('follow_me'));

0 comments on commit c6ed631

Please sign in to comment.