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

添加分享功能 #62

Merged
merged 13 commits into from
Feb 10, 2020
25 changes: 25 additions & 0 deletions assets/scss/_common/post-share.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.post-share {
font-size: 90%;
margin-top: ($fontSize * 5);
text-align: right;
color: alpha(var(--color-contrast-medium), 0.8);
overflow: auto hidden;
a {
color: alpha(var(--color-contrast-medium), 0.8);
&:hover {
color: var(--color-primary);
}
}
}

.share-text {
float: left;
}

.share-item {
float: right;
}

.twitter, .telegram, .facebook, .linkedin, .weibo {
margin-right: 1em;
}
4 changes: 4 additions & 0 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@
@import "_common/post-gitinfo.scss";
{{ end }}

{{ if .Site.Params.enablePostShare }}
@import "_common/post-share.scss";
{{ end }}

{{ if .Site.Params.enableRelatedPosts }}
@import "_common/related-posts.scss";
{{ end }}
Expand Down
14 changes: 14 additions & 0 deletions config-examples/zh-cn/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,20 @@ uglyURLs = false
editText = "Edit Me?"


######################################
# 文章分享

# 是否开启
enablePostShare = true

shareOnTwitter = true
shareOnTelegram = true
shareOnFacebook = true
shareOnLinkedIn = true
shareOnWeibo = true
shareOnQQ = true


######################################
# 相关文章

Expand Down
9 changes: 8 additions & 1 deletion data/SVG.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ edit = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="ico
arrow-up = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon"><path d="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"/></svg>'
eye = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="icon"><path d="M288 144a110.94 110.94 0 0 0-31.24 5 55.4 55.4 0 0 1 7.24 27 56 56 0 0 1-56 56 55.4 55.4 0 0 1-27-7.24A111.71 111.71 0 1 0 288 144zm284.52 97.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400c-98.65 0-189.09-55-237.93-144C98.91 167 189.34 112 288 112s189.09 55 237.93 144C477.1 345 386.66 400 288 400z"/></svg>'
user = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon"><path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/></svg>'
# Social Icons
twitter = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg>'
telegram = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" class="icon"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm121.8 169.9l-40.7 191.8c-3 13.6-11.1 16.9-22.4 10.5l-62-45.7-29.9 28.8c-3.3 3.3-6.1 6.1-12.5 6.1l4.4-63.1 114.9-103.8c5-4.4-1.1-6.9-7.7-2.5l-142 89.4-61.2-19.1c-13.3-4.2-13.6-13.3 2.8-19.7l239.1-92.2c11.1-4 20.8 2.7 17.2 19.5z"/></svg>'
facebook = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon"><path d="M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"/></svg>'
linkedin = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon"><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"/></svg>'
weibo = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon"><path d="M407 177.6c7.6-24-13.4-46.8-37.4-41.7-22 4.8-28.8-28.1-7.1-32.8 50.1-10.9 92.3 37.1 76.5 84.8-6.8 21.2-38.8 10.8-32-10.3zM214.8 446.7C108.5 446.7 0 395.3 0 310.4c0-44.3 28-95.4 76.3-143.7C176 67 279.5 65.8 249.9 161c-4 13.1 12.3 5.7 12.3 6 79.5-33.6 140.5-16.8 114 51.4-3.7 9.4 1.1 10.9 8.3 13.1 135.7 42.3 34.8 215.2-169.7 215.2zm143.7-146.3c-5.4-55.7-78.5-94-163.4-85.7-84.8 8.6-148.8 60.3-143.4 116s78.5 94 163.4 85.7c84.8-8.6 148.8-60.3 143.4-116zM347.9 35.1c-25.9 5.6-16.8 43.7 8.3 38.3 72.3-15.2 134.8 52.8 111.7 124-7.4 24.2 29.1 37 37.4 12 31.9-99.8-55.1-195.9-157.4-174.3zm-78.5 311c-17.1 38.8-66.8 60-109.1 46.3-40.8-13.1-58-53.4-40.3-89.7 17.7-35.4 63.1-55.4 103.4-45.1 42 10.8 63.1 50.2 46 88.5zm-86.3-30c-12.9-5.4-30 .3-38 12.9-8.3 12.9-4.3 28 8.6 34 13.1 6 30.8.3 39.1-12.9 8-13.1 3.7-28.3-9.7-34zm32.6-13.4c-5.1-1.7-11.4.6-14.3 5.4-2.9 5.1-1.4 10.6 3.7 12.9 5.1 2 11.7-.3 14.6-5.4 2.8-5.2 1.1-10.9-4-12.9z"/></svg>'
qq = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon"><path d="M433.754 420.445c-11.526 1.393-44.86-52.741-44.86-52.741 0 31.345-16.136 72.247-51.051 101.786 16.842 5.192 54.843 19.167 45.803 34.421-7.316 12.343-125.51 7.881-159.632 4.037-34.122 3.844-152.316 8.306-159.632-4.037-9.045-15.25 28.918-29.214 45.783-34.415-34.92-29.539-51.059-70.445-51.059-101.792 0 0-33.334 54.134-44.859 52.741-5.37-.65-12.424-29.644 9.347-99.704 10.261-33.024 21.995-60.478 40.144-105.779C60.683 98.063 108.982.006 224 0c113.737.006 163.156 96.133 160.264 214.963 18.118 45.223 29.912 72.85 40.144 105.778 21.768 70.06 14.716 99.053 9.346 99.704z"/></svg>'

# Chinese Zodiac
# Extract from https://github.com/forsigner/fexo/blob/master/source/fonts/fontello.ttf
Expand All @@ -44,4 +51,4 @@ goat = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" class="i
monkey = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" class="icon"><path d="M780 440q43-11 58-30 12-7-2-24-3-5-10-6-13-13-24-33-11-21-21-43-6-27-6-40 0-5-10-15-10-9-26-17-15-8-36-11-8-2-17-2-12 0-23 3-50 11-90 44-39 33-37 76 2 29 9 48 7 18 12 23t16 11q-99 8-297 26-1 0-3 1t-5 6-1 11q30 116 17 160-16 56-27 59-6-4-16-8-11-5-38-6-28-1-52 14-28 14-41 49-9 22-9 44 0 13 3 27 9 35 34 51 30 14 63 12 32-2 57-19 25-18 22-44-5-20-17-31t-25-16q-14-4-28-3t-21 7q0 1-2 4-1 2 6 9 6 7 19 11 15 5 19 19 5 13-7 23-11 10-33 9-2 0-7-2t-14-9-15-18q-7-12-2-32 4-21 18-47 3-2 8-5t21-9q15-5 29-5 15 0 30 10 15 9 27 28 9 16 15 40 6 25 10 47 4 23 11 48 6 26 12 43 6 18 20 32 15 14 32 16 8 2 16 2 15 0 27-5 18-6 36-20 17-14 23-17 5-1 41-3 76 0 109-71 10-22 17-47 3 0 9 2 0 1 1 3t2 9q1 4 4 11 2 6 7 15 3 4 9 14 4 6 14 11 6 3 18 8 7 4 22 2 16-1 27-5 23-7 35-18t7-23q-5-11-38-15-45-5-45-11-1-3 16-9h25q13 0 19-7 7-6 14-14t2-24q-9-44-65-80-55-37-97-20-21 9-62 28-16 7-35 20-20 14-25 29-2 3-8 6-3-12-3-27 0-14 3-37 3-24 12-43 9-20 32-43 23-24 52-41 2 0 4 2 5-2 13-4 7-2 32-1 26 1 49 7 22 6 53 24 30 19 54 47 3-2 9-8-4-35-15-139 3 1 11 3 7 2 25 3 17 1 31 0 15-1 26-14 11-14 13-31-3 1-27 5-25 4-59 3-33-1-46-13zm-32-100q8-7 11-6 5 5 9 10-9 6-14 6t-6-2q-2-2 0-8zm-50 2q24-19 51-29-8 13-23 39 15 11 60 46-7 25-28 17-4-1-7-3t-6-6q-2-4-4-6t-5-7-4-8-5-8l-7-7q-3-3-9-5t-12-5q-15-8-1-18zM283 699q27-40 52-52-10 40-7 81-15-10-45-29zm65-93q-4-1-8-3t-7-8q-3-7-4-15-1-3-1-8-1-6-1-13v-14q0-6 1-14t4-14 9-14q6-7 12-11t20-7q13-3 26-3 14 0 35 2 1 0 3 1-60 53-89 121zm342-122q-13-2-27-1-15 1-29 5t-16 8q1-1 2-5t2-5q1-2 5-7 4-6 8-7t13-6q9-6 19-7 6-1 20-3 12-2 24-3 11-1 25-4 15-3 25-4-1 22-2 67-1-1-5-2-4-4-12-7-12-4-35-14-9-3-17-5z"/></svg>'
rooster = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" class="icon"><path d="M182 522q24 25 55 0 12-11 26-12 15-1 24 2t8 3v-2q5-24 33-19 14 2 23-6t11-16q1-4 3-11 7-1 14-12t10-20q1-4 3-11-5 0-15-10l-23-23q-12-14-23-28-12-14-20-23-2-3-7-10-1-8-3-32-9-6-32-7-22-1-39-1-6 1-18 2-1 1-5 3-3 1-7 4-9 6-25 17-2 1-7 6-13-3-38-8 5 8 18 33-4 5-17 23 2 0 7-2 4-1 14-2 9-1 16 0 3 0 7 2t9 7q5 6 14 18-9-4-17-6-5-1-14-4-6-1-10-1h-7q-21 14-28 22-4 4-4 7t3 4q6 3 12 4t19 1q12 0 12 1 6 1 7 5 1 5-1 8-1 1-2 4-21 10-32 25-11 16-12 31t1 28q2 12 7 21t10 9q5-1 14-9 8-8 15-13t11-2zm62-199q-8 5-25 4-1-3 0-5t3-5 5-3 7-3q2 2 4 5 1 2 4 3t2 3v1zm51-51q5-10 21-40-8 4-34 16-5-7-18-30-5 7-22 30-8-4-30-16 3 10 11 40h72zm582 117q-156-25-200 78 0-3 1-6t2-12 5-17 7-20q3-11 14-21 10-10 17-21 7-10 25-17 17-7 30-13 14-7 40-6-7-3-18-6-12-3-42-3-31 0-55 16-23 15-47 58-23 43-28 114-59-11-177-32-14-9-54-35-8 19-32 75v14h25q1 2 1 5t4 13q3 5 8 17 5 8 13 17 8 10 16 18t23 11q14 3 29 4 16 1 37-7 22-8 45-23 3 4 9 11-2 2-9 8-6 5-25 15-20 10-41 14-22 3-56-10-33-12-67-39-1-2-2-7-1-4-3-15t1-21q-1 1-3 1h-5q-5 0-7-2t-5-8 1-15q-1-1-3-2t-8-2-11-1-14 5q-8 5-13 10-3-1-9-1t-24 4q-17 4-31 18-7-2-19-5-12-2-32-1-19 1-25 13-23 55 35 121 9 9 22 25 8 10 24 29 10 12 23 25 14 14 25 22t25 10q15 2 28-2t28-17q2 4 6 10t18 16q15 11 30 14t42-11q27-13 53-47h14q7 0 16-4t18-9q10-5 24-17 14-13 25-27 10-14 24-40t25-55l24-72q3-1 11-4 7-3 25-9 19-6 36-6t38 6q20 6 35 24 13 16 21 32t13 32q6 15 7 28 0 8 2 24 1 10-1 17-2 8-2 10 4-8 14-22 35-60 14-110-10-25-38-43-27-19-60-27t-66-5q-32 3-54 18 3-4 8-9 7-6 20-18 14-14 32-23 17-9 37-16 21-7 43-2 50 8 76 26 27 19 29 35 2-4 2-12 0-10-3-27-9-54-56-61zM451 830q-8-1-29-4-6 17-24 67-42 0-55 12-4 4 0 9 3 5 33 0 7-1 7 0t-5 6q-23 20-26 43-2 12 7 12 9-1 38-40 4-6 12-16h7q4 0 7 4t7 5 6 5q1 1 2 3-3-15 0-83h17q-4-5-6-10-3-5 1-10 0-1 1-3zm-108-6q-5-4-6-10t0-9q1-1 2-4l-28-4-24 68q-42 0-56 11-4 4-1 8 4 6 35 1 7-1 7 1t-6 7q-23 19-26 43-1 12 7 11 10 0 38-41 9-12 12-14 3-3 6 0 3 2 8 4t8 5q2 1 5 5l3 2v-84h16z"/></svg>'
dog = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" class="icon"><path d="M346 553q-4 17-17 70 38-1 66-9 13-4 27-10 16-8 34-21 31-22 91-68 32-25 53-59 22-33 31-65t12-58q3-25 3-44 0-5-1-15 10-3 20-8 9-5 15-9 4-3 11-9 3-2 10-9-24-24-47-34-22-9-37-4-14 5-26 13-12 7-18 17-1 3-5 8h-20q-24-13-63-16t-64 0q-9 1-26 3-4-25-17-35t-29-8q-15 2-30 7-14 5-25 11-4 3-10 7 2 24 43 24-8 97-58 133-8-1-24-2-13-1-18-3h-6q-4-12-9-21-5-10-11-13-4-1-12-5-5-2-8-1h-3q-17 1-26 23-10 21-11 51v5q0 27 10 55 10 31 27 54 39 45 168 45zm99-222q1-11 6-16 4-5 11-8h2l1 1q5 3 8 11t3 16v8q-3 11-19 17-13-6-12-29zm-95-12q10-7 18-2 7 5 8 31 0 15-22 23h-5q-1-3-4-14-2-7-2-15 0-9 1-14t6-9zm-33 252q-17-1-68-5-24 34-25 53 0 3-1 8-1 6 0 11 1 4-1 9t1 10 3 8 5 8q6 6 8 4 2-1 12 0 10 2 15-3 25-9 37-34 12-26 13-48 1-7 1-21zm276-74l-9 12q-6 7-26 26-19 20-43 37-23 17-58 37-35 19-74 32-61 142-77 181-8 21-12 34-4 12-9 33-5 22-3 35 2 14 11 23 18 15 61-47 43-63 68-121l15 9q-7 12-16 31-9 18-24 56-14 38-10 54 8 35 29 36 33 1 67-92 7-18 21-55 0 2 2 7 1 4 6 18 5 15 12 26t22 26q14 14 33 23 1-5 4-16 2-9 6-18 4-8 10-18t13-20q8-9 17-17t21-11q13-3 27-4t32 6q-4 0-12 1t-25 6q-18 5-31 15-13 11-25 33-11 23-9 50h-3q-2 1-8 2l-12 4q-4 1-14 4-8 2-15 5t-14 5-12 6q-4 4-9 7t-3 7q0 6 1 10 1 5 6 9t16 8q10 4 29 5 20 1 47 1 28 0 70-5t97-10q36-5 44-45 9-40-4-82-12-42-27-68-5-8-23-30-17-21-38-45-20-23-44-54-23-31-43-57-19-27-36-57-16-29-19-48zm312 184q-8 9-23 19-16 10-30 18-10 6-29 17-14 8-23 10-3 2-8 5 11 4 20 22 9 17 10 29 1 13 3 15 8 2 13 2t7-1q1-1 3-1 60-27 60-98 0-9-1-19 0-6-2-18z"/></svg>'
pig = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" class="icon"><path d="M558 775q-7 17-4 28 3 12 15 13 9 2 19-8 10-11 14-28 4-18-6-36-9 0-25 12-9 10-13 19zm358-229q-4-7-8-10-2-2-6-5-2-2-6 0t-6 2q-2 1-4 4-1 2-4 7-1 1-1 3t2 6q2 3 9-1 10-4 10 7-1 14-13 16h-3q-3-20-38-48-53-44-153-46H562q-1 2-3 4t-3 11-4 16q-3 6 2 17t8 15q19 21 35 55 16 33 15 66v71q0 11 1 32 1 20 4 29 4 10 7 12l2 2 10 5q4 1 11-1t15-8q7-7 15-25t16-43q18 1 55 3v7q0 4 1 17 1 12 5 19t10 15q6 9 17 5 15-2 18-14t0-25q-3-14 1-28 5-13 9 11 1 10 3 31 1 9 2 11 1 6 8 9t18-1q10-4 13-14 4-8 4-27 0-18 5-43 5-24 22-50 8-10 9-39 1-28-4-35l18-9q14-8 13-21 0-7-4-15zM593 688q6-30 3-55-3-24-13-44-11-19-19-31-8-13-17-19-3-2-7-7-3-36-11-63-7-28-17-43-10-16-17-24-8-8-15-11l-6-3q8-53-18-58h-3q-3 0-7 1-5 2-10 5-5 4-9 9t-9 10-7 8-7 9q-35 0-141-2-3-11-8-18t-10-6q-2-1-4-1-7-1-12 1t-8 8-4 11-1 13q0 9 1 12t1 10q0 1 1 3h1v9q0 6 3 11-10 13-16 32-6 20-9 38-3 19-4 38-1 20-6 32-4 12-9 18-2 3-19 20-10 9-29 27-11 12-19 29-8 16-8 28v3q8 51 57 80 49 45 142 60 32 5 60 5 52 0 90-17 121-36 140-128zm-163 9q-2 0-3-1t-2-1-3-2-3-1q-5-10-2-30 3-19 15-14 13 4 19 9 5 5 3 11t-5 12q-4 5-11 10t-8 7zm-7-243q10 0 16 25-5 25-19 25-7-1-12-13v-1q-1-2-2-8-2-6 0-12 1-7 5-11t12-5zm-116-3q9 3 9 30-17 50-32 7-1-17 7-29 8-11 16-8zm-51 260q-5-10-8-23-3-14 2-24t19-9q15 1 20 10t1 18l-3 9h1q-15 21-32 19z"/></svg>'
pig = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" class="icon"><path d="M558 775q-7 17-4 28 3 12 15 13 9 2 19-8 10-11 14-28 4-18-6-36-9 0-25 12-9 10-13 19zm358-229q-4-7-8-10-2-2-6-5-2-2-6 0t-6 2q-2 1-4 4-1 2-4 7-1 1-1 3t2 6q2 3 9-1 10-4 10 7-1 14-13 16h-3q-3-20-38-48-53-44-153-46H562q-1 2-3 4t-3 11-4 16q-3 6 2 17t8 15q19 21 35 55 16 33 15 66v71q0 11 1 32 1 20 4 29 4 10 7 12l2 2 10 5q4 1 11-1t15-8q7-7 15-25t16-43q18 1 55 3v7q0 4 1 17 1 12 5 19t10 15q6 9 17 5 15-2 18-14t0-25q-3-14 1-28 5-13 9 11 1 10 3 31 1 9 2 11 1 6 8 9t18-1q10-4 13-14 4-8 4-27 0-18 5-43 5-24 22-50 8-10 9-39 1-28-4-35l18-9q14-8 13-21 0-7-4-15zM593 688q6-30 3-55-3-24-13-44-11-19-19-31-8-13-17-19-3-2-7-7-3-36-11-63-7-28-17-43-10-16-17-24-8-8-15-11l-6-3q8-53-18-58h-3q-3 0-7 1-5 2-10 5-5 4-9 9t-9 10-7 8-7 9q-35 0-141-2-3-11-8-18t-10-6q-2-1-4-1-7-1-12 1t-8 8-4 11-1 13q0 9 1 12t1 10q0 1 1 3h1v9q0 6 3 11-10 13-16 32-6 20-9 38-3 19-4 38-1 20-6 32-4 12-9 18-2 3-19 20-10 9-29 27-11 12-19 29-8 16-8 28v3q8 51 57 80 49 45 142 60 32 5 60 5 52 0 90-17 121-36 140-128zm-163 9q-2 0-3-1t-2-1-3-2-3-1q-5-10-2-30 3-19 15-14 13 4 19 9 5 5 3 11t-5 12q-4 5-11 10t-8 7zm-7-243q10 0 16 25-5 25-19 25-7-1-12-13v-1q-1-2-2-8-2-6 0-12 1-7 5-11t12-5zm-116-3q9 3 9 30-17 50-32 7-1-17 7-29 8-11 16-8zm-51 260q-5-10-8-23-3-14 2-24t19-9q15 1 20 10t1 18l-3 9h1q-15 21-32 19z"/></svg>'
65 changes: 65 additions & 0 deletions layouts/partials/post-share.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{{ if .Site.Params.enablePostShare }}

<div class="post-share">

{{ if .Site.Params.shareOnQQ }}
{{ $icon := (replace .Site.Data.SVG.qq "icon" "icon qq-icon") }}
<div class="share-item qq">
<a href="http://connect.qq.com/widget/shareqq/index.html?url={{ .Permalink }}&title={{ .Title }}{{ with $.Params.description }}&desc={{ . }}{{ end }}{{ with $.Params.featured_image }}&pics={{ . }}{{ end }}" target="_blank" title="Share on QQ">
{{- printf `%s` $icon | safeHTML -}}
</a>
</div>
{{ end }}

{{ if .Site.Params.shareOnWeibo }}
{{ $icon := (replace .Site.Data.SVG.weibo "icon" "icon weibo-icon") }}
<div class="share-item weibo">
<a href="https://service.weibo.com/share/share.php?appkey=&title={{ .Title }}&url={{ .Permalink }}{{ with $.Params.featured_image }}&pic={{ . }}{{ end }}&searchPic=true&style=simple" target="_blank" title="Share on Weibo">
{{- printf `%s` $icon | safeHTML -}}
</a>
</div>
{{ end }}

{{ if .Site.Params.shareOnFacebook }}
{{ $icon := (replace .Site.Data.SVG.facebook "icon" "icon facebook-icon") }}
<div class="share-item facebook">
<a href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" title="Share on Facebook">
{{- printf `%s` $icon | safeHTML -}}
</a>
</div>
{{ end }}

{{ if .Site.Params.shareOnLinkedIn }}
{{ $icon := (replace .Site.Data.SVG.linkedin "icon" "icon linkedin-icon") }}
<div class="share-item linkedin">
<a href="http://www.linkedin.com/shareArticle?mini=true&ro=true&title={{ .Title }}&url={{ .Permalink }}{{ with $.Params.description }}&summary={{ . }}{{ end }}{{ with $.Params.featured_image }}&source={{ . }}{{ end }}&armin=armin" target="_blank" title="Share on LinkedIn">
{{- printf `%s` $icon | safeHTML -}}
</a>
</div>
{{ end }}

{{ if .Site.Params.shareOnTelegram }}
{{ $icon := (replace .Site.Data.SVG.telegram "icon" "icon telegram-icon") }}
<div class="share-item telegram">
<a href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}" target="_blank" title="Share on Telegram">
{{- printf `%s` $icon | safeHTML -}}
</a>
</div>
{{ end }}

{{ if .Site.Params.shareOnTwitter }}
{{ $icon := (replace .Site.Data.SVG.twitter "icon" "icon twitter-icon") }}
<div class="share-item twitter">
<a href="https://twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{ .Site.Params.siteTwitter }}" target="_blank" title="Share on Twitter">
{{- printf `%s` $icon | safeHTML -}}
</a>
</div>
{{ end }}

<div class="share-text">
<span>分享:</span>
</div>

</div>

{{ end }}
2 changes: 2 additions & 0 deletions layouts/partials/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ <h1 class="post-title">{{ .Title }}</h1>

{{ partial "post-gitinfo.html" . }}

{{ partial "post-share.html" . }}

{{ partial "related-posts.html" . }}

{{ partial "post-tags.html" . }}
Expand Down