From 182481421d42706abfeda1150d7412409de73997 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 15 Aug 2021 17:08:10 +0000 Subject: [PATCH] Load disqusjs.scss only when it's enabled --- .../partials/{layout => }/comments/disqusjs.scss | 0 assets/scss/style.scss | 1 - layouts/partials/comments/provider/disqusjs.html | 12 ++++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) rename assets/scss/partials/{layout => }/comments/disqusjs.scss (100%) diff --git a/assets/scss/partials/layout/comments/disqusjs.scss b/assets/scss/partials/comments/disqusjs.scss similarity index 100% rename from assets/scss/partials/layout/comments/disqusjs.scss rename to assets/scss/partials/comments/disqusjs.scss diff --git a/assets/scss/style.scss b/assets/scss/style.scss index 93368e1..2f5aac9 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -24,7 +24,6 @@ @import "partials/layout/list.scss"; @import "partials/layout/404.scss"; @import "partials/layout/search.scss"; -@import "partials/layout/comments/disqusjs"; @import "custom.scss"; diff --git a/layouts/partials/comments/provider/disqusjs.html b/layouts/partials/comments/provider/disqusjs.html index b407fc8..6afb3dc 100644 --- a/layouts/partials/comments/provider/disqusjs.html +++ b/layouts/partials/comments/provider/disqusjs.html @@ -1,7 +1,11 @@ +{{- $pc := .Site.Config.Privacy.Disqus -}} +{{- $disqusjs := .Site.Params.Comments.disqusjs -}} +{{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}} + +{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | resources.ToCSS | minify -}} + +
- {{- $pc := .Site.Config.Privacy.Disqus -}} - {{- $disqusjs := .Site.Params.Comments.Disqusjs -}} - {{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}}
- {{- end -}}
+{{- end -}} \ No newline at end of file