diff --git a/_config.yml b/_config.yml index d1c7bdba28..4c495b2824 100644 --- a/_config.yml +++ b/_config.yml @@ -269,6 +269,14 @@ back2top: # Scroll percent label in b2t button. scrollpercent: false +# A button to open designated chat widget in sidebar. +# Firstly, you need enable the chat service you want to activate its sidebar button. +chat: + enable: false + #service: chatra + #service: tidio + text: Chat # button text, change it as you wish + # --------------------------------------------------------------- # Post Settings # See: https://theme-next.org/docs/theme-settings/posts/ @@ -827,6 +835,21 @@ reading_progress: color: "#37c6c0" height: 2px +# Chatra Support +# See: https://chatra.io +# Dashboard: https://app.chatra.io/settings/general +chatra: + enable: false + async: true + id: # visit Dashboard to get your ChatraID + #embed: # unfinished experimental feature for developers, See: https://chatra.io/help/api/#injectto + +# Tidio Support +# See: https://www.tidiochat.com +# Dashboard: https://www.tidiochat.com/panel/dashboard +tidio: + enable: false + key: # Public Key, get it from Dashboard, See: https://www.tidiochat.com/panel/settings/developer # --------------------------------------------------------------- # Tags Settings diff --git a/layout/_layout.swig b/layout/_layout.swig index a00fdce306..9c3ff3b3cd 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -120,5 +120,7 @@ {% include '_third-party/pangu.swig' %} {% include '_third-party/bookmark.swig' %} {% include '_third-party/copy-code.swig' %} + {% include '_third-party/chatra.swig' %} + {% include '_third-party/tidio.swig' %} diff --git a/layout/_macro/sidebar.swig b/layout/_macro/sidebar.swig index dfc93a7c44..05b8da680e 100644 --- a/layout/_macro/sidebar.swig +++ b/layout/_macro/sidebar.swig @@ -103,6 +103,20 @@ {% endif %} + {% if theme.chat.enable and theme.chat.service !== '' %} +
+ {% if theme.chat.service == 'chatra' and theme.chatra.enable %} + + {% endif %} + {% if theme.chat.service == 'tidio' and theme.tidio.enable %} + + {% endif %} + + {{ theme.chat.text }} + +
+ {% endif %} + {% if theme.social %}