Merge pull request #96 from liuboaibc/update/add-share-button

add share button
This commit is contained in:
pengfei 2020-06-30 14:11:21 +08:00 committed by GitHub
commit 2684d25195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 121 additions and 0 deletions

View File

@ -211,3 +211,17 @@ section {
background-position: center;
background-repeat: no-repeat;
}
.share {
a {
margin-right: 10px;
img {
opacity: 0.8;
&:hover {
opacity: 1;
}
}
}
}

View File

@ -61,6 +61,14 @@
}
}
.share-1 {
margin-bottom: 20px;
}
.share-2 {
margin-top: 20px;
}
.content {
.md-body {

View File

@ -20,11 +20,17 @@
<div class='author'>{{ .Params.author }}</div>
<div class='date'>{{ i18n "introduction3" }}{{ string .Params.createTime }}</div>
<h1>{{ .Title }}</h1>
<div class="share-1">
{{- partial "share.html" . -}}
</div>
<div class='content'>
<div class='md-body'>
{{ .Content }}
</div>
</div>
<div class="share-2">
{{- partial "share.html" . -}}
</div>
</div>
<div class='aside aside-fixed'>
<div class='title'>Table of Contents</div>

View File

@ -20,11 +20,17 @@
<div class='author'>{{ .Params.author }}</div>
<div class='date'>{{ i18n "introduction3" }}{{ string .Params.createTime }}</div>
<h1>{{ .Title }}</h1>
<div class="share-1">
{{- partial "share.html" . -}}
</div>
<div class='content'>
<div class='md-body'>
{{ .Content }}
</div>
</div>
<div class="share-2">
{{- partial "share.html" . -}}
</div>
</div>
<div class='aside aside-fixed'>
<div class='title'>Table of Contents</div>

View File

@ -0,0 +1,17 @@
<div class="share">
<a href="http://twitter.com/share?url={{ .Permalink }}&text={{ .Title }}" target="_blank" rel="noopener noreferrer">
<img src="/images/share/Twitter.svg" alt="twitter icon">
</a>
<a href="http://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank" rel="noopener noreferrer">
<img src="/images/share/Reddit.svg" alt="reddit icon">
</a>
<a href="http://www.facebook.com/sharer.php?u={{ .Permalink }}" target="_blank" rel="noopener noreferrer">
<img src="/images/share/Facebook.svg" alt="facebook icon">
</a>
<a href="http://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink }}" target="_blank" rel="noopener noreferrer">
<img src="/images/share/Linkedin.svg" alt="linkedin icon">
</a>
<a href="https://news.ycombinator.com/submitlink?u={{ .Permalink }}&t={{ .Title }}" target="_blank" rel="noopener noreferrer">
<img src="/images/share/HackerNews.svg" alt="hackernews icon">
</a>
</div>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<!-- Generator: Sketch 3.4.2 (15855) - http://www.bohemiancoding.com/sketch -->
<title>Facebook</title>
<desc>Created with Sketch.</desc>
<defs/>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Facebook" sketch:type="MSArtboardGroup" fill="#3B5998">
<path d="M19.3614815,8 C20.4962963,8 21.3748148,8.04530769 22,8.13738462 L22,11.1510769 L20.1837037,11.1510769 C19.5185185,11.1510769 19.0725926,11.2884615 18.84,11.5632308 C18.6088889,11.8365385 18.4933333,12.2472308 18.4933333,12.7953077 L18.4933333,14.954 L21.8844444,14.954 L21.4325926,18.3330769 L18.4933333,18.3330769 L18.4933333,27 L14.9511111,27 L14.9511111,18.3330769 L12,18.3330769 L12,14.954 L14.9511111,14.954 L14.9511111,12.465 C14.9511111,11.0487692 15.3525926,9.95115385 16.1555556,9.17069231 C16.957037,8.39023077 18.0266667,8 19.3614815,8" id="Fill-1" sketch:type="MSShapeGroup"/>
<path d="M17.5,34 L17.5,34 C26.6126984,34 34,26.6126984 34,17.5 C34,8.38730163 26.6126984,1 17.5,1 C8.38730163,1 1,8.38730163 1,17.5 C1,26.6126984 8.38730163,34 17.5,34 L17.5,34 Z M17.5,35 L17.5,35 C7.83501688,35 0,27.1649831 0,17.5 C0,7.83501688 7.83501688,0 17.5,0 C27.1649831,0 35,7.83501688 35,17.5 C35,27.1649831 27.1649831,35 17.5,35 L17.5,35 Z" id="Shape" sketch:type="MSShapeGroup"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
<title>Share-HackerNews</title>
<desc>Created with Sketch.</desc>
<defs/>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Share-HackerNews" fill="#FF6600">
<path d="M17.5,34 L17.5,34 C26.6126984,34 34,26.6126984 34,17.5 C34,8.38730163 26.6126984,1 17.5,1 C8.38730163,1 1,8.38730163 1,17.5 C1,26.6126984 8.38730163,34 17.5,34 L17.5,34 Z M17.5,35 L17.5,35 C7.83501688,35 0,27.1649831 0,17.5 C0,7.83501688 7.83501688,0 17.5,0 C27.1649831,0 35,7.83501688 35,17.5 C35,27.1649831 27.1649831,35 17.5,35 L17.5,35 Z" id="Shape" fill-rule="nonzero"/>
<path d="M16.9268697,17.9635036 L12.1734032,8 L9,8 L15.6415094,20.7226277 L15.6415094,29 L18.3584906,29 L18.3584906,20.7226277 L25,8 L21.8265968,8 L17.0731303,17.9635036 L16.9268697,17.9635036 Z" id="Combined-Shape"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<!-- Generator: Sketch 3.4.2 (15855) - http://www.bohemiancoding.com/sketch -->
<title>Linkedin</title>
<desc>Created with Sketch.</desc>
<defs/>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Linkedin" sketch:type="MSArtboardGroup" fill="#007BB6">
<path d="M27,18.8087017 L27,25 L23.145,25 L23.145,19.223036 C23.145,18.4599355 22.986,17.8614526 22.6695,17.4303775 C22.353,16.9979074 21.858,16.7816723 21.1875,16.7816723 C20.6955,16.7816723 20.2815,16.9072282 19.9515,17.1569448 C19.6185,17.4080565 19.371,17.719156 19.2075,18.0888482 C19.1205,18.3078734 19.0785,18.6022321 19.0785,18.9719243 L19.0785,25 L15.222,25 C15.2385,22.09966 15.246,19.7503706 15.246,17.9479466 C15.246,16.1455227 15.2415,15.0699276 15.234,14.7211614 L15.222,14.198012 L19.0785,14.198012 L19.0785,15.7674601 L19.0545,15.7674601 C19.2105,15.5344843 19.371,15.3321998 19.5345,15.1578167 C19.6995,14.9834336 19.9185,14.7937048 20.1975,14.5914204 C20.4735,14.3877409 20.814,14.2300985 21.2175,14.1170983 C21.618,14.004098 22.0665,13.9482954 22.5585,13.9482954 C23.895,13.9482954 24.969,14.3612346 25.7805,15.184323 C26.5935,16.0088063 27,17.2169326 27,18.8087017 L27,18.8087017 Z M13.0905,25 L9.2235,25 L9.2235,14.1994071 L13.0905,14.1994071 L13.0905,25 Z M13.3365,10.8638068 C13.344,11.3939315 13.146,11.8375621 12.744,12.1933037 C12.342,12.5490453 11.8125,12.7276136 11.1555,12.7276136 L11.133,12.7276136 C10.4925,12.7276136 9.9765,12.5490453 9.5865,12.1933037 C9.195,11.8375621 9,11.3939315 9,10.8638068 C9,10.3253117 9.201,9.88168105 9.603,9.52872962 C10.005,9.17577818 10.5315,9 11.1795,9 C11.8275,9 12.3465,9.17577818 12.738,9.52872962 C13.128,9.88168105 13.3275,10.3253117 13.3365,10.8638068 L13.3365,10.8638068 Z" id="Fill-1" sketch:type="MSShapeGroup"/>
<path d="M17.5,34 L17.5,34 C26.6126984,34 34,26.6126984 34,17.5 C34,8.38730163 26.6126984,1 17.5,1 C8.38730163,1 1,8.38730163 1,17.5 C1,26.6126984 8.38730163,34 17.5,34 L17.5,34 Z M17.5,35 L17.5,35 C7.83501688,35 0,27.1649831 0,17.5 C0,7.83501688 7.83501688,0 17.5,0 C27.1649831,0 35,7.83501688 35,17.5 C35,27.1649831 27.1649831,35 17.5,35 L17.5,35 Z" id="Shape" sketch:type="MSShapeGroup"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
<title>Share-Reddit</title>
<desc>Created with Sketch.</desc>
<defs/>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Share-Reddit" fill-rule="nonzero">
<path d="M17.5,34 L17.5,34 C26.6126984,34 34,26.6126984 34,17.5 C34,8.38730163 26.6126984,1 17.5,1 C8.38730163,1 1,8.38730163 1,17.5 C1,26.6126984 8.38730163,34 17.5,34 L17.5,34 Z M17.5,35 L17.5,35 C7.83501688,35 0,27.1649831 0,17.5 C0,7.83501688 7.83501688,0 17.5,0 C27.1649831,0 35,7.83501688 35,17.5 C35,27.1649831 27.1649831,35 17.5,35 L17.5,35 Z" id="Shape" fill="#FF4500"/>
<g id="reddit-2" transform="translate(6.000000, 7.000000)">
<path d="M11.4520727,19 C5.78361902,19 1.17227971,15.9673191 1.17227971,12.2395782 C1.17227971,11.9820545 1.1941955,11.7270721 1.23716763,11.4767489 C0.468205521,11.0087426 5.00265813e-05,10.1815452 0,9.29076196 C0.00165715019,7.87378463 1.16651792,6.72543935 2.6041111,6.72357216 C3.245685,6.72357216 3.85717842,6.95483526 4.33030157,7.36822863 C6.11321526,6.24029159 8.51148985,5.53040706 11.1572839,5.48127424 L12.8942174,0.256253065 L13.2732316,0.344353293 L13.2822558,0.346471087 L17.3306601,1.28592447 C17.6682704,0.506844109 18.4444427,0.00103714518 19.3039404,0 C20.4877883,0.00140078337 21.4470657,0.94711098 21.4482497,2.1139819 C21.446829,3.28068741 20.4876207,4.22613991 19.3039404,4.22754024 C18.1211667,4.22637608 17.1622352,3.28233282 17.1596311,2.11652325 L13.4657467,1.25924027 L12.0592689,5.49059254 C14.6088054,5.58843462 16.9112522,6.30043693 18.6301374,7.40380757 C19.1103192,6.96554459 19.7410037,6.72266919 20.3954325,6.72399572 C21.8331935,6.72562958 22.9983157,7.87404306 22.9999733,9.29118552 C23.004238,10.21842 22.4974004,11.0748242 21.6764317,11.5275759 C21.7138174,11.7618039 21.7331549,11.9989968 21.7331549,12.2395782 C21.7322955,15.9673191 17.1205264,19 11.4520727,19 L11.4520727,19 Z M2.11766658,11.438205 C2.06053223,11.7016111 2.031725,11.9702194 2.03172232,12.2395782 C2.03172232,15.5005573 6.25760161,18.1528824 11.4520727,18.1528824 C16.6465438,18.1528824 20.8724231,15.5001338 20.8724231,12.2395782 C20.8724231,11.9803602 20.8457804,11.7249543 20.7937841,11.4742075 C20.7657501,11.4167182 20.7512097,11.3537446 20.7512417,11.2899594 C20.4637582,10.1772705 19.6795168,9.16708279 18.5467714,8.35300281 C18.4746897,8.32720742 18.4110023,8.28272419 18.362421,8.22424094 C16.6405277,7.05733648 14.1803733,6.32585046 11.4520727,6.32585046 C8.75127433,6.32585046 6.31217622,7.04293549 4.59286129,8.18993268 C4.54595813,8.24247441 4.48682966,8.2830237 4.42054304,8.30810558 C3.26330357,9.12260912 2.4588653,10.1395738 2.16020899,11.2620045 C2.15930408,11.3180505 2.14703098,11.3733516 2.1241124,11.4246511 C2.12196379,11.4293103 2.12024491,11.4339694 2.11766658,11.438205 Z M19.3482017,7.91461947 C20.3447254,8.70032101 21.076111,9.63596237 21.4499686,10.6626689 C21.886565,10.3382127 22.1422111,9.82969987 22.1396712,9.29076196 C22.1387237,8.34117942 21.3579714,7.57162367 20.394573,7.57068973 C20.0171248,7.57016754 19.6497864,7.69090728 19.3482017,7.91461947 L19.3482017,7.91461947 Z M2.6041111,7.57068973 C1.64088054,7.57185707 0.860389707,8.34134457 0.859442606,9.29076196 C0.859442606,9.80453877 1.09149211,10.2818895 1.4765224,10.6037942 C1.86284185,9.58513532 2.60153277,8.65711802 3.60192396,7.87904053 C3.3090554,7.67826437 2.96085273,7.57066046 2.6041111,7.57068973 L2.6041111,7.57068973 Z M19.3035106,0.846694012 C18.5953299,0.846694012 18.018644,1.4151099 18.018644,2.11355834 C18.018644,2.81200678 18.5953299,3.37999911 19.3035106,3.37999911 C20.0116914,3.37999911 20.5883773,2.81200678 20.5883773,2.11355834 C20.5883773,1.4151099 20.0121211,0.846694012 19.3035106,0.846694012 L19.3035106,0.846694012 Z M11.4989123,16.5891034 C9.77787853,16.5891034 8.56520501,16.2184895 7.79213639,15.4560836 C7.62434513,15.2905817 7.62444133,15.0223448 7.79235125,14.8569597 C7.96026118,14.6915747 8.23240076,14.6916695 8.40019203,14.8571715 C9.00395046,15.4522716 10.0172333,15.7419858 11.4989123,15.7419858 C12.9801617,15.7419858 13.994304,15.4522716 14.5989218,14.8571715 C14.7074637,14.7502618 14.8656261,14.7085492 15.0138306,14.7477464 C15.1620352,14.7869436 15.2777661,14.9010956 15.3174287,15.0472025 C15.3570913,15.1933093 15.3146599,15.349174 15.206118,15.4560836 C14.43219,16.2184895 13.2199462,16.5891034 11.4989123,16.5891034 L11.4989123,16.5891034 Z" id="Shape" fill="#000000"/>
<path d="M14.436692,9 C13.5728032,9 12.8475266,9.68895466 12.8475266,10.5115028 C12.8475266,11.3336472 13.5728032,12 14.436692,12 C15.3005807,12 16,11.3336472 16,10.5115028 C16,9.68895466 15.3001568,9 14.436692,9 L14.436692,9 Z M7.5874698,9 C6.72442881,9 6,9.68976187 6,10.5115028 C6,11.3332436 6.72400492,12 7.5874698,12 C8.45093468,12 9.15077784,11.3332436 9.15077784,10.5115028 C9.15077784,9.68976187 8.45051079,9 7.5874698,9 L7.5874698,9 Z" id="Shape" fill="#FF4500"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<!-- Generator: Sketch 3.4.2 (15855) - http://www.bohemiancoding.com/sketch -->
<title>Twitter</title>
<desc>Created with Sketch.</desc>
<defs/>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Twitter" sketch:type="MSArtboardGroup" fill="#55ACEE">
<g id="Fill-1-+-Shape" sketch:type="MSLayerGroup">
<path d="M24.875731,13.2092 C25.5833333,13.1364 26.2923977,12.953 27,12.6618 C26.4897661,13.3772 25.872807,13.9862 25.1505848,14.4888 C25.1564327,14.591 25.1608187,14.745 25.1608187,14.948 C25.1608187,15.8958 25.0160819,16.8422 24.7266082,17.7872 C24.4371345,18.7308 23.997076,19.6366 23.4078947,20.5046 C22.8172515,21.3726 22.1140351,22.1398 21.3011696,22.8062 C20.4853801,23.474 19.502924,24.006 18.3538012,24.4036 C17.2032164,24.8012 15.9736842,25 14.6652047,25 C12.6008772,25 10.7119883,24.4708 9,23.4138 C9.26608187,23.4432 9.5628655,23.4572 9.89035088,23.4572 C11.6038012,23.4572 13.130117,22.9546 14.4707602,21.948 C13.6710526,21.9326 12.9546784,21.6974 12.3230994,21.2424 C11.6900585,20.7874 11.2573099,20.205 11.0204678,19.498 C11.2719298,19.5358 11.504386,19.5526 11.7178363,19.5526 C12.0453216,19.5526 12.3684211,19.5134 12.6885965,19.4322 C11.8362573,19.2642 11.130117,18.8582 10.5701754,18.2128 C10.0102339,17.5674 9.73099415,16.8184 9.73099415,15.9658 L9.73099415,15.9224 C10.248538,16.1996 10.8040936,16.348 11.3976608,16.3704 C10.8947368,16.0484 10.495614,15.6298 10.1988304,15.1118 C9.90204678,14.5938 9.75292398,14.0338 9.75292398,13.4276 C9.75292398,12.7864 9.92105263,12.1914 10.255848,11.6454 C11.1769006,12.7318 12.2982456,13.6012 13.619883,14.2536 C14.9400585,14.906 16.3552632,15.27 17.8625731,15.3414 C17.8011696,15.0642 17.7719298,14.7954 17.7719298,14.5322 C17.7719298,13.555 18.1315789,12.722 18.8508772,12.0332 C19.5701754,11.3444 20.4400585,11 21.4605263,11 C22.5263158,11 23.4254386,11.371 24.1564327,12.1158 C24.9853801,11.9618 25.7660819,11.6776 26.497076,11.2618 C26.2149123,12.1004 25.6754386,12.75 24.875731,13.2092" id="Fill-1" sketch:type="MSShapeGroup"/>
<path d="M17.5,34 L17.5,34 C26.6126984,34 34,26.6126984 34,17.5 C34,8.38730163 26.6126984,1 17.5,1 C8.38730163,1 1,8.38730163 1,17.5 C1,26.6126984 8.38730163,34 17.5,34 L17.5,34 Z M17.5,35 L17.5,35 C7.83501688,35 0,27.1649831 0,17.5 C0,7.83501688 7.83501688,0 17.5,0 C27.1649831,0 35,7.83501688 35,17.5 C35,27.1649831 27.1649831,35 17.5,35 L17.5,35 Z" id="Shape" sketch:type="MSShapeGroup"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB