Skip to content

Commit 0ae01e3

Browse files
authored
feat: Bluesky share btn (#55)
* feat: Add bluesky share button. Also modify X share button Signed-off-by: koooge <koooooge@gmail.com> * feat: Adjust page layout Signed-off-by: koooge <koooooge@gmail.com> --------- Signed-off-by: koooge <koooooge@gmail.com>
1 parent b46d6b1 commit 0ae01e3

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

layouts/partials/share.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{{ if .Site.Params.sharebutton }}
2+
{{ $url := printf "%s" .Permalink | absLangURL }}
23
<div id="share-buttons">
34
<ul>
45
{{ if .Site.Params.sharebutton.x_twitter | default .Site.Params.sharebutton.twitter }}
6+
{{ $user := .Site.Author.x_twitter | default .Site.Author.twitter }}
57
<li>
6-
<a href="https://twitter.com/share" class="twitter-share-button"{{ with .Site.Author.twitter }} data-via="{{ . }}"{{ end }}>Tweet</a>
7-
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
8+
<a href="https://twitter.com/intent/tweet?text={{ .Title }}&url={{ $url }}&via={{ $user }}" target="_blank" aria-label="Share on X">
9+
{{ partial "fontawesome.html" "square-x-twitter-brands-solid" }}
10+
</a>
811
</li>
912
{{ end }}
1013
{{ if .Site.Params.sharebutton.facebook }}
@@ -36,6 +39,15 @@
3639
<script>!function(d,s,id){var js,ajs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://assets.tumblr.com/share-button.js";ajs.parentNode.insertBefore(js,ajs);}}(document, "script", "tumblr-js");</script>
3740
</li>
3841
{{ end }}
42+
{{ if .Site.Params.sharebutton.bluesky }}
43+
{{ $text := printf "%s %s" .Title .Permalink }}
44+
{{ with .Site.Author.bluesky }}{{ $text = printf "%s by @%s" $text . }}{{ end }}
45+
<li>
46+
<a href="https://bsky.app/intent/compose?text={{ $text | urlquery }}" target="_blank" aria-label="Share on Bluesky">
47+
{{ partial "fontawesome.html" "square-bluesky-brands-solid" }}
48+
</a>
49+
</li>
50+
{{ end }}
3951
</ul>
4052
</div>
4153
{{ end }}

static/css/style.css

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ a:hover {
3737
}
3838

3939
.container {
40-
width: 1000px;
40+
width: 1200px;
4141
margin-right: auto;
4242
margin-left: auto;
4343
padding-bottom: 50px;
@@ -82,7 +82,7 @@ a:hover {
8282
* articles
8383
*/
8484
.article {
85-
width: 590px;
85+
width: 650px;
8686
padding: 0 20px 20px;
8787
clear: left;
8888
overflow: hidden;
@@ -130,27 +130,18 @@ a:hover {
130130
font-size: 14px;
131131
}
132132

133-
.article .content a:hover :not(.heading) {
134-
font-size: 14px;
135-
}
136-
137133
.article .tags a {
138134
font-size: 10px;
139135
}
140136

141-
.article .tags a:hover {
142-
font-size: 10px;
143-
}
144-
145137
/**
146138
* sidebar
147139
*/
148140
.sidebar {
149141
width: 310px;
150142
float: right;
151143
min-height: 200px;
152-
height: 200px;
153-
height: auto !important;
144+
height: auto;
154145
overflow: hidden;
155146
}
156147

0 commit comments

Comments
 (0)