summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodepiano <codepiano.li@gmail.com>2014-07-31 16:10:33 +0800
committercodepiano <codepiano.li@gmail.com>2014-07-31 16:31:31 +0800
commit3402746719e4557c513fa2c33e9c176623aa291e (patch)
tree6ee771461196e05720591e6dfbc95fa948056257
parent30a8414b06287f805c40600f1f2e40bbe9cdd9ec (diff)
downloadgitbook-3402746719e4557c513fa2c33e9c176623aa291e.zip
gitbook-3402746719e4557c513fa2c33e9c176623aa291e.tar.gz
gitbook-3402746719e4557c513fa2c33e9c176623aa291e.tar.bz2
add sharing to weibo.com.
google、facebook and twitter are block by GFW in China,Chinese can not visit these websites. add 'weibo' config in option links.sharing,the share link will not be used by default,users should set the value of 'weibo' to true to turn on sharing to weibo.com.
-rwxr-xr-xtheme/javascript/utils/sharing.js5
-rw-r--r--theme/templates/includes/book/header.html3
2 files changed, 7 insertions, 1 deletions
diff --git a/theme/javascript/utils/sharing.js b/theme/javascript/utils/sharing.js
index caf97fb..4889b40 100755
--- a/theme/javascript/utils/sharing.js
+++ b/theme/javascript/utils/sharing.js
@@ -13,6 +13,9 @@ define([
},
"google-plus": function($el) {
window.open("https://plus.google.com/share?url="+encodeURIComponent(url))
+ },
+ "weibo": function($el) {
+ window.open("http://service.weibo.com/share/share.php?content=utf-8&url="+encodeURIComponent(url)+"&title="+encodeURIComponent(title))
}
};
@@ -30,4 +33,4 @@ define([
return {
init: init
};
-}); \ No newline at end of file
+});
diff --git a/theme/templates/includes/book/header.html b/theme/templates/includes/book/header.html
index 5be0de3..9b36af8 100644
--- a/theme/templates/includes/book/header.html
+++ b/theme/templates/includes/book/header.html
@@ -21,6 +21,9 @@
{% if options.links.sharing.twitter !== false %}
<a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Share on Twitter"><i class="fa fa-twitter"></i></a>
{% endif %}
+ {% if options.links.sharing.weibo === true %}
+ <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="weibo" aria-label="Share on Weibo"><i class="fa fa-weibo"></i></a>
+ {% endif %}
<!-- Title -->
<h1>