Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ mathjax:
cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML


# Han Support docs: https://hanzi.pro/
han: false

# Swiftype Search API Key
#swiftype_key:

Expand Down
2 changes: 1 addition & 1 deletion layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
{% endif %}


<div class="post-body" itemprop="articleBody">
<div class="post-body han-init-context" itemprop="articleBody">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Where is the switch for han-init-context?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's just a hook. When Han is not enabled, it will not have any effect.

Copy link
Copy Markdown
Collaborator

@ivan-nginx ivan-nginx Apr 20, 2017

Choose a reason for hiding this comment

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

But it's will be in default class style. It was hard to do this?

<div class="post-body{% if theme.han %} han-init-context{% endif %}" itemprop="articleBody">

Copy link
Copy Markdown
Contributor Author

@geekrainy geekrainy Apr 20, 2017

Choose a reason for hiding this comment

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

Thanks for your suggestion. :) 756c49c

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In ideal, this switches must be anywhere on any custom options.


{# Gallery support #}
{% if post.photos and post.photos.length %}
Expand Down
5 changes: 5 additions & 0 deletions layout/_partials/head.swig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


{% if theme.han %}
<link rel="stylesheet" media="all" href="//cdnjs.cloudflare.com/ajax/libs/Han/3.2.7/han.min.css">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

cloudflare的CDN在国内很慢吧?
建议不要直接引用CDN,直接将资源文件放在主题里,同时提供CDN选项,可以参考其他资源文件。

{% endif %}


{# #238, Disable Baidu tranformation #}
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
Expand Down
3 changes: 3 additions & 0 deletions source/css/_common/components/third-party/han.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.fa {
font-family: FontAwesome!important;
}
1 change: 1 addition & 0 deletions source/css/_common/components/third-party/third-party.styl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "duoshuo";
@import "gentie";
@import "jiathis";
@import "han";
@import "baidushare";
@import "localsearch";
@import "busuanzi-counter";
Expand Down