New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加shareSDK社交分享功能 #911

Closed
akkuman opened this Issue May 26, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@akkuman

akkuman commented May 26, 2016

添加shareSDK的理由:简约大方
http://sharesdk.mob.com/#/sharesdk
http://wiki.mob.com/sharesdk-for-web%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90/
看上面的wiki取得appkey
9m 5w eil8e rijx 06d 84
这就是自己的appkey

<!--MOB SHARE BEGIN-->
<div class="-mob-share-ui-button -mob-share-open">分享</div>
<div class="-mob-share-ui" style="display: none">
    <ul class="-mob-share-list">
        <li class="-mob-share-weibo"><p>新浪微博</p></li>
        <li class="-mob-share-tencentweibo"><p>腾讯微博</p></li>
        <li class="-mob-share-qzone"><p>QQ空间</p></li>
        <li class="-mob-share-qq"><p>QQ好友</p></li>
        <li class="-mob-share-renren"><p>人人网</p></li>
        <li class="-mob-share-kaixin"><p>开心网</p></li>
        <li class="-mob-share-douban"><p>豆瓣</p></li>
        <li class="-mob-share-facebook"><p>Facebook</p></li>
        <li class="-mob-share-twitter"><p>Twitter</p></li>
    </ul>
    <div class="-mob-share-close">取消</div>
</div>
<div class="-mob-share-ui-bg"></div>
<script id="-mob-share" src="http://f1.webshare.mob.com/code/mob-share.js?appkey={{ theme.shareSDKappkey }}"></script>
<!--MOB SHARE END-->

主题下layout/_partials/share新建文件sharesdk.swig,写入以上代码
打开layout/post.swig,24行后添加

{% elseif theme.sharesdk %}
        {% include '_partials/share/sharesdk.swig' %}

主题配置文件增加以下

#Share
sharesdk: true
shareSDKappkey: appkey

appkey为你自己的key

配上效果图

点击会弹开,扁平化风格,适合小清新

@akkuman akkuman closed this May 26, 2016

@akkuman

This comment has been minimized.

akkuman commented May 26, 2016

图传不上。。不好意思

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment