From 1762613dfb06a9f2fb0958b4550234ea7193b772 Mon Sep 17 00:00:00 2001 From: Herbert <30955264+HerbertHe@users.noreply.github.com> Date: Mon, 19 Apr 2021 01:40:10 +0800 Subject: [PATCH] feat: support Valine (#79) * feat: support valine * ui: impove valine UI * feat: support valine options * fix: remove valine serverURLs option * refactor: load params in a more flexible way * feat: custom editThisPage repo branch * cRevert "feat: custom editThisPage repo branch" This reverts commit 36923ac30de6c3a690fa7407e534c5395bafcb18. Co-authored-by: Wang Chucheng --- data/assets.yaml | 9 ++++++++- exampleSite/config/_default/params.yaml | 12 ++++++++++-- layouts/partials/comment/valine.html | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 layouts/partials/comment/valine.html diff --git a/data/assets.yaml b/data/assets.yaml index ba1e3e13..47682243 100644 --- a/data/assets.yaml +++ b/data/assets.yaml @@ -35,4 +35,11 @@ mermaid: version: 8.9.2 js: url: https://cdn.jsdelivr.net/npm/mermaid@%s/dist/mermaid.min.js - sri: sha256-Zmpaaj+GXFsPF5WdPArSrnW3b30dovldeKsW00xBVwE= \ No newline at end of file + sri: sha256-Zmpaaj+GXFsPF5WdPArSrnW3b30dovldeKsW00xBVwE= + +# Valine +valine: + version: 1.4.14 + js: + url: https://cdn.jsdelivr.net/npm/valine@%s/dist/Valine.min.js + sri: sha256-fPqMAsW3FDt/rNyneSJ7HOpZNRs/O2rM016SU08JtCk= diff --git a/exampleSite/config/_default/params.yaml b/exampleSite/config/_default/params.yaml index 5eaeaf26..16e50938 100644 --- a/exampleSite/config/_default/params.yaml +++ b/exampleSite/config/_default/params.yaml @@ -19,7 +19,7 @@ publisherLogo: highlight: handler: highlightjs - + highlightjs: # highlight.js doesn't bundle every language. So please specify additional languages you want here. # See https://github.com/highlightjs/cdn-release/tree/master/build/languages for available languages. @@ -40,7 +40,7 @@ math: # leqno: comment: - # Options: disqus, commento and utterances. + # Options: disqus, commento, valine and utterances. handler: # disqus: @@ -57,6 +57,14 @@ comment: # # If self-hosting, please enter the url (e.g. https://commento.example.com) here. Otherwise leave empty. # url: + valine: + # Browse https://valine.js.org/configuration.html to see the options available. + # You can list the key and value you want as below. + # Because Hugo's config params are case-insensitive, you need to add `-` or `_` before the uppercase letters. + # For example, `appId` should be written as `app-Id` or other acceptable formats. + app-Id: + app-Key: + diagram: handler: mermaid diff --git a/layouts/partials/comment/valine.html b/layouts/partials/comment/valine.html new file mode 100644 index 00000000..7a5a7ce4 --- /dev/null +++ b/layouts/partials/comment/valine.html @@ -0,0 +1,14 @@ +
+{{- $assets := .Site.Data.assets }} + +{{- with .Site.Params.comment.valine }} + +{{- end }} \ No newline at end of file