Skip to content

Commit

Permalink
Merge branch 'wildfirejs-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Simpleyyt committed Nov 21, 2018
2 parents 1129350 + 53527bc commit cec072e
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
26 changes: 26 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,32 @@ disqus:
# count need to be false when hide is true
hide: false

# <wildfire>
wildfire:
enable: false
# version - It's recommended to use the following versions.
loaderVersion: 1.2.5 # https://www.npmjs.com/package/wildfire-comment
useDev: true
version: 0.5.6
# database config
databaseProvider: firebase # or wilddog
firebase: # your firebase config goes here ↓
apiKey:
authDomain:
databaseURL:
projectId:
storageBucket:
messagingSenderId:
wilddog: # your wilddog config goes here ↓
siteId:
# other configs
theme: light # or dark
locale: en # or other locales, e.g. zh-CN
defaultAvatarURL:
# Any question?
# Raise an issue here: https://github.com/cheng-kang/wildfire/issues
# </wildfire>

# Hypercomments
#hypercomments_id:

Expand Down
10 changes: 10 additions & 0 deletions _includes/_macro/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@
data-disqus-identifier="{{ post.url }}" itemprop="commentCount"></span>
</a>
</span>
{% elsif site.wildfire.enable %}
<span class="post-comments-count">
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-comment-o"></i>
</span>
<a href="{{ post.url | relative_url }}#comments" itemprop="discussionUrl">
<span class="post-comments-count wf-count-unit" wf-page-url="{{ post.url | absolute_url }}" itemprop="commentCount"></span>
</a>
</span>
{% elsif site.hypercomments_id %}
<!--noindex-->
<span class="post-comments-count">
Expand Down
2 changes: 2 additions & 0 deletions _includes/_partials/comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<div id="lv-container" data-id="city" data-uid="{{ site.livere_uid }}"></div>
{% elsif site.changyan.appid and site.changyan.appkey %}
<div id="SOHUCS"></div>
{% elsif site.wildfire.enable %}
<div class="wildfire_thread"></div>
{% endif %}
</div>
{% endif %}
1 change: 1 addition & 0 deletions _includes/_third-party/comments/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
{% include _third-party/comments/youyan.html %}
{% include _third-party/comments/livere.html %}
{% include _third-party/comments/changyan.html %}
{% include _third-party/comments/wildfire.html %}
44 changes: 44 additions & 0 deletions _includes/_third-party/comments/wildfire.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{% if site.wildfire.enable %}
<script type="text/javascript">
var wildfireConfig = () => ({
{% if site.wildfire.useDev %}
useDev: {{site.wildfire.useDev}},
{% endif %}
{% if site.wildfire.version %}
version: '{{site.wildfire.version}}',
{% endif %}
databaseProvider: '{{site.wildfire.databaseProvider}}',
databaseConfig: {
{% if site.wildfire.databaseProvider == 'firebase' %}
apiKey: '{{site.wildfire.firebase.apiKey}}',
authDomain: '{{site.wildfire.firebase.authDomain}}',
databaseURL: '{{site.wildfire.firebase.databaseURL}}',
projectId: '{{site.wildfire.firebase.projectId}}',
storageBucket: '{{site.wildfire.firebase.storageBucket}}',
messagingSenderId: '{{site.wildfire.firebase.messagingSenderId}}'
{% else %}
siteId: '{{site.wildfire.wilddog.siteId}}'
{% endif %}
},
pageURL: '{{ page.url | absolute_url }}',
pageTitle: '{{ page.title| replace: "'", "\\'" }}',
{% if site.wildfire.theme %}
theme: '{{site.wildfire.theme}}',
{% endif %}
{% if site.wildfire.locale %}
locale: '{{site.wildfire.locale}}',
{% endif %}
{% if site.wildfire.defaultAvatarURL %}
defaultAvatarURL: '{{site.wildfire.defaultAvatarURL}}'
{% endif %}
});
</script>
{% if page.comments %}
{% if site.wildfire.loaderVersion %}
<script src="https://unpkg.com/wildfire-comment@{{site.wildfire.loaderVersion}}"></script>
{% else %}
<script src="https://unpkg.com/wildfire-comment"></script>
{% endif %}
{% endif %}
<script src="https://unpkg.com/wf-count"></script>
{% endif %}

0 comments on commit cec072e

Please sign in to comment.