diff --git a/_config.yml b/_config.yml index e1169b11fae..4b9041aad93 100644 --- a/_config.yml +++ b/_config.yml @@ -116,7 +116,7 @@ sharing: ## => Comments ############################## comments: - provider: false # false (default), "disqus", "gitalk", "custom" + provider: false # false (default), "disqus", "gitalk", "valine", "custom" ## Disqus disqus: @@ -134,10 +134,11 @@ comments: ## Valine # please refer to https://valine.js.org/en/index.html for more info. - custom: - API_ID : # LeanCloud App id - API_Key : # LeanCloud App key - placeholder: Just Go Go. # Prompt information + valine: + app_id : # LeanCloud App id + app_key : # LeanCloud App key + placeholder : # Prompt information + ## => Pageview ############################## diff --git a/_data/variables.yml b/_data/variables.yml index da6f98bb0ee..66388921801 100644 --- a/_data/variables.yml +++ b/_data/variables.yml @@ -46,6 +46,7 @@ sources: gitalk: js: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.js' css: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.css' + valine: 'https://unpkg.com/valine/dist/Valine.min.js' # bootcdn not available mathjax: 'https://cdn.bootcss.com/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML' mermaid: 'https://cdn.bootcss.com/mermaid/8.0.0-rc.8/mermaid.min.js' unpkg: @@ -56,5 +57,6 @@ sources: gitalk: js: 'https://unpkg.com/gitalk@1.2.2/dist/gitalk.min.js' css: 'https://unpkg.com/gitalk@1.2.2/dist/gitalk.css' + valine: 'https//unpkg.com/valine/dist/Valine.min.js' mathjax: 'https://unpkg.com/mathjax@2.7.4/unpacked/MathJax.js?config=TeX-MML-AM_CHTML' mermaid: 'https://unpkg.com/mermaid@8.0.0-rc.8/dist/mermaid.min.js' \ No newline at end of file diff --git a/_includes/comments-providers/custom.html b/_includes/comments-providers/custom.html deleted file mode 100644 index 15ffa7e46f9..00000000000 --- a/_includes/comments-providers/custom.html +++ /dev/null @@ -1,22 +0,0 @@ - -{%- if page.key and - site.comments.custom.API_ID and - site.comments.custom.API_Key and - site.comments.custom.placeholder -%} - -
- - - - - - -{%- endif -%} \ No newline at end of file diff --git a/_includes/comments-providers/valine.html b/_includes/comments-providers/valine.html new file mode 100644 index 00000000000..abe627ce64c --- /dev/null +++ b/_includes/comments-providers/valine.html @@ -0,0 +1,33 @@ +{%- include snippets/get-sources.html -%} +{%- assign _sources = __return -%} + +{%- assign _VALINE_APP_ID = site.comments.valine.app_id -%} +{%- assign _VALINE_APP_KEY = site.comments.valine.app_key -%} +{%- assign _VALINE_PLACEHOLDER = site.comments.valine.placeholder -%} + + +{%- if page.key and + _VALINE_APP_ID and + _VALINE_APP_KEY -%} + + + + +{%- endif -%} \ No newline at end of file diff --git a/_includes/comments.html b/_includes/comments.html index 6329c3cf333..41518c6c07f 100644 --- a/_includes/comments.html +++ b/_includes/comments.html @@ -3,6 +3,8 @@ {%- include comments-providers/disqus.html -%} {%- elsif site.comments.provider == 'gitalk' -%} {%- include comments-providers/gitalk.html -%} + {%- elsif site.comments.provider == 'valine' -%} + {%- include comments-providers/valine.html -%} {%- elsif site.comments.provider == 'custom' -%} {%- include comments-providers/custom.html -%} {%- endif -%} diff --git a/_includes/scripts/variables.html b/_includes/scripts/variables.html index 84ee648f120..008fc692311 100644 --- a/_includes/scripts/variables.html +++ b/_includes/scripts/variables.html @@ -17,6 +17,7 @@ js: '{{ _sources.gitalk.js }}', css: '{{ _sources.gitalk.css }}' }, + valine: '{{ _sources.valine }}', mathjax: '{{ _sources.mathjax }}', mermaid: '{{ _sources.mermaid }}' }, diff --git a/docs/_config.dev.yml b/docs/_config.dev.yml index a86f2cdcf8e..f99793945d8 100644 --- a/docs/_config.dev.yml +++ b/docs/_config.dev.yml @@ -117,7 +117,7 @@ sharing: ## => Comments ############################## comments: - provider: false # false (default), "disqus", "gitalk", "custom" + provider: false # false (default), "disqus", "gitalk", "valine", "custom" ## Disqus disqus: @@ -133,6 +133,13 @@ comments: admin: # GitHub repo owner and collaborators, only these guys can initialize GitHub issues, IT IS A LIST. # - your GitHub Id + ## Valine + # please refer to https://valine.js.org/en/index.html for more info. + valine: + app_id : # LeanCloud App id + app_key : # LeanCloud App key + placeholder : # Prompt information + ## => Pageview ############################## diff --git a/docs/_config.yml b/docs/_config.yml index cecdac42a45..1672d2279cb 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -118,7 +118,8 @@ sharing: ## => Comments ############################## comments: - provider: gitalk # false (default), "disqus", "gitalk", "custom" + provider: gitalk # false (default), "disqus", "gitalk", "valine", "custom" + # provider: valine ## Disqus disqus: @@ -134,6 +135,13 @@ comments: admin: - kitian616 + ## Valine + # please refer to https://valine.js.org/en/index.html for more info. + valine: + app_id : uAG3OhdcH8H4fxSqXLyBljA7-gzGzoHsz + app_key : Mzf5m9skSwYVWVXhGiYMNyXs + placeholder : # Prompt information + ## => Pageview ############################## diff --git a/docs/_data/variables.yml b/docs/_data/variables.yml index da6f98bb0ee..66388921801 100644 --- a/docs/_data/variables.yml +++ b/docs/_data/variables.yml @@ -46,6 +46,7 @@ sources: gitalk: js: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.js' css: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.css' + valine: 'https://unpkg.com/valine/dist/Valine.min.js' # bootcdn not available mathjax: 'https://cdn.bootcss.com/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML' mermaid: 'https://cdn.bootcss.com/mermaid/8.0.0-rc.8/mermaid.min.js' unpkg: @@ -56,5 +57,6 @@ sources: gitalk: js: 'https://unpkg.com/gitalk@1.2.2/dist/gitalk.min.js' css: 'https://unpkg.com/gitalk@1.2.2/dist/gitalk.css' + valine: 'https//unpkg.com/valine/dist/Valine.min.js' mathjax: 'https://unpkg.com/mathjax@2.7.4/unpacked/MathJax.js?config=TeX-MML-AM_CHTML' mermaid: 'https://unpkg.com/mermaid@8.0.0-rc.8/dist/mermaid.min.js' \ No newline at end of file diff --git a/test/_config.yml b/test/_config.yml index 6a745f87173..f157fa6ab84 100644 --- a/test/_config.yml +++ b/test/_config.yml @@ -116,7 +116,7 @@ sharing: ## => Comments ############################## comments: - provider: false # false (default), "disqus", "gitalk", "custom" + provider: false # false (default), "disqus", "gitalk", "valine", "custom" ## Disqus disqus: @@ -132,6 +132,13 @@ comments: admin: # GitHub repo owner and collaborators, only these guys can initialize GitHub issues, IT IS A LIST. # - your GitHub Id + ## Valine + # please refer to https://valine.js.org/en/index.html for more info. + valine: + app_id : # LeanCloud App id + app_key : # LeanCloud App key + placeholder : # Prompt information + ## => Pageview ############################## diff --git a/test/_data/variables.yml b/test/_data/variables.yml index da6f98bb0ee..66388921801 100644 --- a/test/_data/variables.yml +++ b/test/_data/variables.yml @@ -46,6 +46,7 @@ sources: gitalk: js: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.js' css: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.css' + valine: 'https://unpkg.com/valine/dist/Valine.min.js' # bootcdn not available mathjax: 'https://cdn.bootcss.com/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML' mermaid: 'https://cdn.bootcss.com/mermaid/8.0.0-rc.8/mermaid.min.js' unpkg: @@ -56,5 +57,6 @@ sources: gitalk: js: 'https://unpkg.com/gitalk@1.2.2/dist/gitalk.min.js' css: 'https://unpkg.com/gitalk@1.2.2/dist/gitalk.css' + valine: 'https//unpkg.com/valine/dist/Valine.min.js' mathjax: 'https://unpkg.com/mathjax@2.7.4/unpacked/MathJax.js?config=TeX-MML-AM_CHTML' mermaid: 'https://unpkg.com/mermaid@8.0.0-rc.8/dist/mermaid.min.js' \ No newline at end of file