From 2294f936e4dcd6f3e6aeb7bc57889a7908a4ace0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Thu, 16 Jun 2022 10:00:36 +0800 Subject: [PATCH] :lipstick: Add gitter chat room page. --- assets/css/_common/components/third-party/gitter.scss | 6 +++--- exampleSite/config.yaml | 6 ++++-- layouts/partials/_thirdparty/chat/gitter.html | 6 ++++++ layouts/partials/widgets.html | 4 ++++ 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 layouts/partials/_thirdparty/chat/gitter.html diff --git a/assets/css/_common/components/third-party/gitter.scss b/assets/css/_common/components/third-party/gitter.scss index 8a1986e..7301c37 100644 --- a/assets/css/_common/components/third-party/gitter.scss +++ b/assets/css/_common/components/third-party/gitter.scss @@ -1,7 +1,7 @@ @if $gitter_enable { .gitter-open-chat-button { - $alignment : sidebar-toggle-alignment(false); - #{$alignment[0]}: auto !important; - #{$alignment[1]}: 10px !important; + $alignment: sidebar-toggle-alignment(false); + #{nth($alignment, 1)}: auto !important; + #{nth($alignment, 2)}: 10px !important; } } diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 68c2232..63dae73 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -12,6 +12,8 @@ paginate: 8 enableEmoji: true +relativeurls: true + # Make markdown content support HTML syntax markup: goldmark: @@ -938,8 +940,8 @@ params: # Gitter Support # For more information: https://gitter.im gitter: - enable: false - room: + enable: true + room: hugo-next/community # --------------------------------------------------------------- diff --git a/layouts/partials/_thirdparty/chat/gitter.html b/layouts/partials/_thirdparty/chat/gitter.html new file mode 100644 index 0000000..763650a --- /dev/null +++ b/layouts/partials/_thirdparty/chat/gitter.html @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/layouts/partials/widgets.html b/layouts/partials/widgets.html index 327c075..1bdf4ef 100644 --- a/layouts/partials/widgets.html +++ b/layouts/partials/widgets.html @@ -21,6 +21,10 @@ {{- end }} {{- end }} +{{- if .Site.Params.gitter.enable }} + {{ partial "_thirdparty/chat/gitter.html" . }} +{{- end }} + \ No newline at end of file