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

add wechat subscriber #788

Merged
merged 1 commit into from
Apr 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ auto_excerpt:
# Use Lato font
use_font_lato: true


# Wechat Subscriber
#wechat_subscriber:
#enabled: true
#qcode: /path/to/your/wechatqcode ex. /uploads/wechat-qcode.jpg
#description: ex. subscribe to my blog by scanning my public wechat account

# ---------------------------------------------------------------
# Third Party Services Settings
Expand Down
6 changes: 6 additions & 0 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@
{{ post.content }}
{% endif %}
</div>

<div>
{% if ! is_index %}
{% include 'wechat-subscriber.swig' %}
{% endif %}
</div>

<div>
{% if ! is_index %}
Expand Down
6 changes: 6 additions & 0 deletions layout/_macro/wechat-subscriber.swig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% if theme.wechat_subscriber.enabled %}
<div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
<img id="wechat_subscriber_qcode" src="{{ theme.wechat_subscriber.qcode }}" alt="{{ theme.author }} wechat" style="width: 200px; max-width: 100%;"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方使用 url_for 会比较好点。

src="{{ theme.wechat_subscriber.qcode }} -> src="{{ url_for(theme.wechat_subscriber.qcode) }}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next6.0版本的配置和官网上的已经不一样了,两种版本的加入方式我都试过了,都不成功,会是哪里出了问题?

<div>{{ theme.wechat_subscriber.description }}</div>
</div>
{% endif %}