Skip to content

Commit c6ed631

Browse files
authored
feat: follow me through various channels (#1360)
1 parent 0289e50 commit c6ed631

File tree

9 files changed

+88
-2
lines changed

9 files changed

+88
-2
lines changed

_config.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ social:
191191
#YouTube: https://youtube.com/yourname || youtube
192192
#Instagram: https://instagram.com/yourname || instagram
193193
#Skype: skype:yourname?call|chat || skype
194-
#RSS: /atom.xml || rss
195194

196195
social_icons:
197196
enable: true
@@ -277,6 +276,14 @@ reward:
277276
#alipay: /images/alipay.png
278277
#bitcoin: /images/bitcoin.png
279278

279+
# Subscribe through Telegram Channel, Twitter, etc.
280+
# Usage: `Key: permalink || icon (Font Awesome)
281+
follow_me:
282+
#Twitter: https://twitter.com/username || twitter
283+
#Telegram: https://t.me/channel_name || telegram
284+
#Wechat: /images/wechat_channel.jpg || wechat
285+
#RSS: /atom.xml || rss
286+
280287
# Related popular posts
281288
# Dependencies: https://github.com/tea3/hexo-related-popular-posts
282289
related_posts:
@@ -669,7 +676,6 @@ rating:
669676
# Go to https://www.addthis.com/dashboard to customize your tools.
670677
add_this_id:
671678

672-
673679
# ---------------------------------------------------------------
674680
# Statistics and Analytics
675681
# See: https://theme-next.org/docs/third-party-services/statistics-and-analytics

languages/en.yml

+3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ reward:
8989
alipay: Alipay
9090
bitcoin: Bitcoin
9191

92+
follow_me:
93+
welcome: Welcome to my other publishing channels
94+
9295
accessibility:
9396
nav_toggle: Toggle navigation bar
9497
prev_page: Previous page

languages/zh-CN.yml

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ reward:
7676
wechatpay: 微信支付
7777
alipay: 支付宝
7878
bitcoin: 比特币
79+
follow_me:
80+
welcome: 欢迎关注我的其它发布渠道
7981
accessibility:
8082
nav_toggle: 切换导航栏
8183
prev_page: 上一页

languages/zh-HK.yml

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ reward:
7676
wechatpay: 微信支付
7777
alipay: 支付寶
7878
bitcoin: 比特幣
79+
follow_me:
80+
welcome: 歡迎關注我的其它發布渠道
7981
accessibility:
8082
nav_toggle: 切換導航欄
8183
prev_page: 上一頁

languages/zh-TW.yml

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ reward:
7676
wechatpay: 微信支付
7777
alipay: 支付寶
7878
bitcoin: 比特幣
79+
follow_me:
80+
welcome: 歡迎關注我的其它發布渠道
7981
accessibility:
8082
nav_toggle: 切換導航欄
8183
prev_page: 上一頁

layout/_macro/post.swig

+4
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@
228228
{{ partial('_partials/post/post-copyright.swig') }}
229229
{%- endif %}
230230

231+
{%- if theme.follow_me %}
232+
{{ partial('_partials/post/post-followme.swig', {}, {cache: theme.cache.enable}) }}
233+
{%- endif %}
234+
231235
<footer class="post-footer">
232236
{%- if post.tags and post.tags.length %}
233237
{%- if theme.tag_icon %}
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{%- if theme.follow_me %}
2+
3+
<div class="followme">
4+
<p>{{ __('follow_me.welcome') }}</p>
5+
6+
<div class="social-list">
7+
{%- for name, value in theme.follow_me %}
8+
{%- set link = value.split('||')[0] | trim %}
9+
{%- set icon = value.split('||')[1] | trim %}
10+
11+
<div class="social-item">
12+
<a target="_blank" class="social-link" href="{{ link }}">
13+
<span class="icon">
14+
<i class="fa fa-{{ icon }}"></i>
15+
</span>
16+
17+
<span class="label">{{ name }}</span>
18+
</a>
19+
</div>
20+
{%- endfor %}
21+
</div>
22+
</div>
23+
{%- endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.followme {
2+
align-items: center;
3+
background: $whitesmoke;
4+
border-left: 3px solid $red;
5+
color: $grey;
6+
display: flex;
7+
flex-direction: column;
8+
margin: 2em 0 1em 0;
9+
padding: 1em 1.5em;
10+
11+
.social-list {
12+
align-items: center;
13+
display: flex;
14+
flex-wrap: wrap;
15+
16+
.social-item {
17+
margin: 0.5em 2em;
18+
}
19+
+tablet-mobile() {
20+
.social-item {
21+
margin: 0.5em 0.75em;
22+
}
23+
}
24+
25+
.social-link {
26+
border: none;
27+
display:inline-block;
28+
text-align: center;
29+
30+
.icon {
31+
font-size: 1.75em;
32+
height: 1.75em;
33+
width: 1.75em;
34+
}
35+
36+
.label {
37+
display: block;
38+
font-size: 14px;
39+
}
40+
}
41+
}
42+
}

source/css/_common/components/post/post.styl

+2
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@
6969
@import 'post-reward';
7070

7171
@import 'post-copyright' if (hexo-config('creative_commons.post'));
72+
73+
@import 'post-followme' if (hexo-config('follow_me'));

0 commit comments

Comments
 (0)