Skip to content
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

请问如何 enable fb-like #727

Closed
mcknote opened this issue Mar 16, 2016 · 5 comments
Closed

请问如何 enable fb-like #727

mcknote opened this issue Mar 16, 2016 · 5 comments

Comments

@mcknote
Copy link

mcknote commented Mar 16, 2016

我想在 post 中加 fb-like button,翻了一下代码发现这段

{% if not is_index and theme.facebook_sdk.enable and theme.facebook_sdk.like_button %} &nbsp; | &nbsp; <div class="fb-like" data-layout="button_count" data-share="true"></div> {% endif %}

请问要怎么启用?谢谢。

@iissnan
Copy link
Owner

iissnan commented Mar 16, 2016

我没有使用过。你可以参考下这个 Pull Request 以及 Facebook JavaScript SDK

@mcknote
Copy link
Author

mcknote commented Mar 16, 2016

了解,谢谢
另外如果有人要加 Facebook Badge,直接把两段代码添加在 _macro 里的 sidebar.swig 就行。

@iissnan
Copy link
Owner

iissnan commented Mar 16, 2016

不太清楚 Facebook Badge 是什么,不过你可以将你的方案发 pr 给我,最好描述下使用方式,方便有需要的用户。谢谢

@mcknote
Copy link
Author

mcknote commented Mar 16, 2016

好的,Facebook Badge 是用来宣传 Facebook Page 的小工具,如果想加到 Sidebar,需要按照以下步骤:

  1. https://developers.facebook.com/docs/plugins/page-plugin 为专页申请 Badge
  2. 我的参数是 Tabs timeline; Width 250; Height 420
  3. 点 Get Code 以后会出现两段代码,一段 Include the JavaScript SDK on your page once,一段 Place the code for your plugin wherever you want
  4. 把第一段贴在 sidebar.swig 开头({% macro render(is_post) %} 后),第二段贴在 /section 前即可

@iissnan
Copy link
Owner

iissnan commented Mar 17, 2016

@mcknote 多谢

@iissnan iissnan closed this as completed Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants