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

Fix: update valine comment system version and update configuration #1983

Merged
merged 2 commits into from Nov 3, 2017
Merged

Conversation

@xCss
Copy link
Contributor

@xCss xCss commented Nov 3, 2017

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes have been added (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs have been added / updated (for bug fixes / features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

Issue Number(s): N/A

What is the new behavior?

Description about this pull, in several words...

  • Screens with this changes: N/A
  • Link to demo site with this changes: N/A

How to use?

In NexT _config.yml:

-# more info please open https://github.com/xCss/Valine
+# more info please open https://valine.js.org
 valine:
   enable: false
   appid:  # your leancloud application appid
   appkey:  # your leancloud application appkey
   notify: false # mail notifier , https://github.com/xCss/Valine/wiki
   verify: false # Verification code
-  placeholder: Comment input placeholder
+  placeholder: Just go go # comment box placeholder
+  avatar: mm # gravatar style
+  guest_info: nick,mail,link # custom comment header
+  pageSize: 10 # pagination size

layout/_macro/post.swig:

+            {% elseif theme.valine.enable and theme.valine.appid and theme.valine.appkey %}
+              <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="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
+                  <span class="post-comments-count valine-comment-count" data-xid="{{ url_for(post.path) }}" itemprop="commentCount"></span>
+                </a>
+              </span>

layout/_third-party/comments/valine.swig

-{% if page.comments and theme.valine.enable and theme.valine.appid and theme.valine.appkey %}
+<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
+<script src="//unpkg.com/valine/dist/Valine.min.js"></script>
+{% if theme.valine.enable and theme.valine.appid and theme.valine.appkey %}
   
-  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
-  <script src="//cdn.jsdelivr.net/gh/xcss/valine@v1.1.7-rc3/dist/Valine.min.js"></script>
   <script type="text/javascript">
+    var GUEST = ['nick','mail','link'];
+    var guest = '{{ theme.valine.guest_info }}';
+    guest = guest.split(',').filter(item=>{
+      return GUEST.indexOf(item)>-1;
+    });
     new Valine({
-        av: AV,
         el: '#comments' ,
         verify: {{ theme.valine.verify }},
         notify: {{ theme.valine.notify }},
-        app_id: '{{ theme.valine.appid }}',
-        app_key: '{{ theme.valine.appkey }}',
-        placeholder: '{{ theme.valine.placeholder }}'
+        appId: '{{ theme.valine.appid }}',
+        appKey: '{{ theme.valine.appkey }}',
+        placeholder: '{{ theme.valine.placeholder }}',
+        avatar:'{{ theme.valine.avatar }}',
+        guest_info:guest,
+        pageSize:'{{ theme.valine.pageSize }}' || 10,

Does this PR introduce a breaking change?

  • Yes.
  • No.
@@ -64,7 +64,6 @@

{% elseif theme.valine.appid and theme.valine.appkey %}
<div class="comments" id="comments">
<div id="vcomments"></div>
Copy link
Collaborator

@ivan-nginx ivan-nginx Nov 3, 2017

No need apeear comments block on full post here?

Copy link
Contributor Author

@xCss xCss Nov 3, 2017

Ok, i got it. thx

@ivan-nginx ivan-nginx merged commit 6d10ca8 into iissnan:master Nov 3, 2017
2 checks passed
@ivan-nginx ivan-nginx added this to the v5.1.4 milestone Nov 3, 2017
@tingstory
Copy link

@tingstory tingstory commented Jan 1, 2018

是 Markdown 不是 MarkDown

@tingstory
Copy link

@tingstory tingstory commented Jan 1, 2018

Error:MarkDown is Support
is Markdown not MarkDown

@iloveuav
Copy link

@iloveuav iloveuav commented Apr 30, 2020

我可以显示评论块 一切正常 就是点击评论后 没有任何反应,learnCloud也没反应,appid那些都配置好了的 没有任何报错提示~ 网站是 https://www.uavserve.online/ 救救孩子吧~

@xCss
Copy link
Contributor Author

@xCss xCss commented Apr 30, 2020

我可以显示评论块 一切正常 就是点击评论后 没有任何反应,learnCloud也没反应,appid那些都配置好了的 没有任何报错提示~ 网站是 https://www.uavserve.online/ 救救孩子吧~

image

只能帮你到这了,加油

@iloveuav
Copy link

@iloveuav iloveuav commented Apr 30, 2020

我可以显示评论块 一切正常 就是点击评论后 没有任何反应,learnCloud也没反应,appid那些都配置好了的 没有任何报错提示~ 网站是 https://www.uavserve.online/ 救救孩子吧~

image

只能帮你到这了,加油

太感谢了 就是#号前面没有空格导致的 没想到几乎秒回 太感动了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants