Skip to content

Commit

Permalink
Merge pull request #7844 from fjordllc/fix/add-blog-title-on-x-sharing
Browse files Browse the repository at this point in the history
ブログのX共有時にタイトルが表示されるように修正
  • Loading branch information
komagata authored Jun 24, 2024
2 parents 6b53180 + 98b4819 commit c296f83
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/views/articles/_share_button_facebook.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +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">
<div class="fb-share-button" data-href="https://bootcamp.fjord.jp/articles/<%= article_id %>" 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 %>&amp;src=sdkpreparse"
href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fbootcamp.fjord.jp%2Farticles%2F<%= article_id %>&amp;src=sdkpreparse"
rel="noopener noreferrer"
target="_blank">シェアする</a>
</div>
2 changes: 1 addition & 1 deletion app/views/articles/_share_button_hatena.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a class="hatena-bookmark-button"
href="https://b.hatena.ne.jp/entry/s/bootcamp.fjord.jp/articles/<%= article %>"
href="https://b.hatena.ne.jp/entry/s/bootcamp.fjord.jp/articles/<%= article_id %>"
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;" />
Expand Down
2 changes: 1 addition & 1 deletion app/views/articles/_share_button_x.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a class="x-share-button"
href="https://twitter.com/intent/tweet?url=https://bootcamp.fjord.jp/articles/<%= article %>&hashtags=fjordbootcamp"
href="https://twitter.com/intent/tweet?url=https://bootcamp.fjord.jp/articles/<%= article.id %>&hashtags=fjordbootcamp&text=<%= truncate(article.title, length: 100) %>%0a"
data-size="large"
rel="noopener noreferrer"
target="_blank">
Expand Down
4 changes: 2 additions & 2 deletions app/views/articles/_share_buttons.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
li.share-buttons__item.is-x
= render 'share_button_x', article: article
li.share-buttons__item
= render 'share_button_facebook', article: article
= render 'share_button_facebook', article_id: article.id
li.share-buttons__item
= render 'share_button_hatena', article: article
= render 'share_button_hatena', article_id: article.id
4 changes: 2 additions & 2 deletions app/views/articles/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ruby:
= l(@article.created_at)
- else
= l(@article.published_at)
= render 'share_buttons', article: @article.id
= render 'share_buttons', article: @article
- if @article.display_thumbnail_in_body?
- if @article.prepared_thumbnail?
= image_tag @article.prepared_thumbnail_url, class: 'article__image'
Expand All @@ -55,7 +55,7 @@ ruby:
.article__body
.js-markdown-view.a-long-text.is-md
= @article.body
= render 'share_buttons', article: @article.id
= render 'share_buttons', article: @article
- if admin_or_mentor_login?
hr.a-border
.card-footer
Expand Down

0 comments on commit c296f83

Please sign in to comment.