Permalink
Browse files

Add Hatena Bookmark button

  • Loading branch information...
shimoju committed Sep 24, 2017
1 parent 3fd4468 commit c0f628c627c06bef0586720183edb020525b10de
Showing with 7 additions and 1 deletion.
  1. +1 −1 layout/_partial/after-footer.ejs
  2. +6 −0 layout/_partial/article.ejs
@@ -24,7 +24,7 @@
<%- js('js/script') %>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<script async src="https://b.st-hatena.com/js/bookmark_button.js" charset="utf-8"></script>
<script src="https://s.hatena.ne.jp/js/HatenaStar.js"></script>
<script>
Hatena.Star.SiteConfig = {
@@ -32,6 +32,12 @@
<div class="hatena-star"></div>
<div class="share-buttons">
<a href="https://twitter.com/share" class="twitter-share-button" data-url="<%- config.url %><%- config.root %><%- post.path %>" data-text="<%= post.title %> - <%= config.title %>">Tweet</a>
<%
var siteUrl = config.url.split('://');
var hatebuDomain = /^https/.test(siteUrl[0]) ? 's/' + siteUrl[1] : siteUrl[1];
var hatebuUrl = hatebuDomain + config.root + post.path;
%>
<a href="http://b.hatena.ne.jp/entry/<%- hatebuUrl %>" class="hatena-bookmark-button" data-hatena-bookmark-layout="basic-label-counter" data-hatena-bookmark-lang="ja" title="このエントリーをはてなブックマークに追加"><img src="https://b.st-hatena.com/images/entry-button/button-only@2x.png" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a>
</div>
<div class="entry-meta-footer">
<span class="category">

0 comments on commit c0f628c

Please sign in to comment.