Skip to content

Commit 791ca5b

Browse files
committed
文章分享组件居中
1 parent 3618730 commit 791ca5b

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

_layouts/post.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ <h2 class="post-subtitle">{{ page.subtitle }}</h2>
9999
</div>
100100
<script src="{{ site.baseurl }}assets/js/social-share.min.js"></script>
101101
<script>
102-
socialShare('.social-share', {sites: [{% for i in site.social-share-items %}'{{ i }}',{% endfor %}]});
102+
socialShare('.social-share', {
103+
sites: [{% for i in site.social-share-items %}'{{ i }}',{% endfor %}],
104+
wechatQrcodeTitle: "分享到微信朋友圈",
105+
wechatQrcodeHelper: '<p>扫码后点击右上角</p><p>将网页分享至朋友圈</p>'
106+
});
103107
</script>
104108
<script>
105109
/**

assets/css/app.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/sass/app.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,12 @@ a {
543543
margin-bottom: 0; }
544544

545545
.social-share-wrapper {
546-
width: 720px; }
546+
float: left;
547+
position: relative;
548+
left: 50%; }
549+
.social-share-wrapper .social-share {
550+
position: relative;
551+
left: -50%; }
547552

548553
.post-footer-item {
549554
margin: 0 auto;

dev/sass/common.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,13 @@
463463
}
464464

465465
.social-share-wrapper {
466-
width: $post-content-w;
466+
float: left;
467+
position: relative;
468+
left: 50%;
469+
.social-share {
470+
position: relative;
471+
left: -50%;
472+
}
467473
}
468474

469475
.post-footer-item {

0 commit comments

Comments
 (0)