-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7153 from fjordllc/feature/add-share-buttons-on-b…
…log-page-for-external プラグインを利用して、X、Facebook、はてなブックマークのシェアボタンを実装
- Loading branch information
Showing
8 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/javascript/stylesheets/welcome/articles/_share-buttons.sass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.share-buttons | ||
margin-top: .75rem | ||
|
||
.share-buttons__items | ||
display: flex | ||
gap: .5rem | ||
@media (max-width: 20em) | ||
gap: .25rem | ||
|
||
.share-buttons__item | ||
@media (max-width: 20em) | ||
&.is-x | ||
flex: 1 | ||
|
||
|
||
.x-share-button | ||
width: 5.5rem | ||
height: 2.5rem | ||
background-color: white | ||
+flex-link | ||
flex-direction: column | ||
border-radius: .25rem | ||
align-items: center | ||
justify-content: center | ||
+text-block(.6875rem 1, 700) | ||
color: var(--reversal-text) | ||
border: solid 1px black | ||
overflow: hidden | ||
i | ||
font-size: .875rem | ||
color: black | ||
flex: 1 | ||
width: 100% | ||
display: flex | ||
align-items: center | ||
justify-content: center | ||
transition: all .2s ease-out | ||
span | ||
background-color: var(--default-text) | ||
display: flex | ||
width: 100% | ||
height: 1.25rem | ||
align-items: center | ||
justify-content: center | ||
transition: all .2s ease-out | ||
padding-top: 1px | ||
&:hover | ||
i | ||
background-color: var(--background-tint) | ||
span | ||
background-color: black | ||
@media (max-width: 20em) | ||
width: 100% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div id="fb-root"></div> | ||
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v18.0" nonce="eqECzFUd"></script> | ||
<div class="fb-share-button" data-href="https://bootcamp.fjord.jp/articles/<%= article %>" data-layout="box_count" data-size="small"> | ||
<a class="fb-xfbml-parse-ignore" | ||
href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fbootcamp.fjord.jp%2Farticles%2F<%= article %>&src=sdkpreparse" | ||
rel="noopener noreferrer" | ||
target="_blank">シェアする</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<a class="hatena-bookmark-button" | ||
href="https://b.hatena.ne.jp/entry/s/bootcamp.fjord.jp/articles/<%= article %>" | ||
data-hatena-bookmark-layout="vertical-normal" | ||
data-hatena-bookmark-lang="ja" title="このエントリーをはてなブックマークに追加"> | ||
<img src="https://b.st-hatena.com/images/v4/public/entry-button/[email protected]" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /> | ||
</a> | ||
<script type="text/javascript" src="https://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<a class="x-share-button" | ||
href="https://twitter.com/intent/tweet?url=https://bootcamp.fjord.jp/articles/<%= article %>&hashtags=fjordbootcamp" | ||
data-size="large" | ||
rel="noopener noreferrer" | ||
target="_blank"> | ||
<i class="fa-brands fa-x-twitter"></i> | ||
<span>Postする</span> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.share-buttons | ||
ul.share-buttons__items | ||
li.share-buttons__item.is-x | ||
= render 'share_button_x', article: article | ||
li.share-buttons__item | ||
= render 'share_button_facebook', article: article | ||
li.share-buttons__item | ||
= render 'share_button_hatena', article: article |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters