まとめ記事にもシェアボタン追加

posted in: web技術, YukiWiki | 0

ブログに「シェア」ボタンをつけたら、今度はまとめ記事にも同じように「シェア」ボタンをつけたくなって、勢いで追加しました。

YukiWikiにおいては、下記コードを追記します。

私はコメント欄の直後に「シェア」ボタンが入るよう、wiki.cgiの1230行あたり、sub embedded_to_htmlの form action=”$url_cgi” method=”post”…/formの直後に追記しました。私にとってはコメント欄の有無に連動するのが都合が良かったのですが、全てのページに入れたい方はwiki.cgiの480行あたり、sub print_footerの/divの直前あたりがいいかも知れませんね。

wiki.cgi

<!--Facebook Shere-->
	<iframe src="https://www.facebook.com/plugins/share_button.php?href=$modifier_rss_link?$form{mypage}&layout=button&size=small&width=69&height=20&appId" width="69" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>
<!--Line Shere-->
	<div class="line-it-button" data-lang="ja" data-type="like" data-url="$modifier_rss_link?$form{mypage}" data-share="true" style="display: none;"></div>
<script src="https://d.line-scdn.net/r/web/social-plugin/js/thirdparty/loader.min.js" async="async" defer="defer"></script>
<!--Twitter Shere-->
	<a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-url="$modifier_rss_link?$form{mypage}" data-lang="ja" data-show-count="false">Tweet</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

コメントを残す

メールアドレスが公開されることはありません。