diff options
author | leafee98 <leafee98@hotmail.com> | 2022-05-18 22:44:17 +0800 |
---|---|---|
committer | leafee98 <leafee98@hotmail.com> | 2022-05-18 22:44:17 +0800 |
commit | a71e469a23f99a8a203e46e00b275c03209a8fd5 (patch) | |
tree | f05e03cca5a431fcdc8f2a77feb7cd5c186e403f | |
parent | 0ce04d50c74e58b6056a99b8f7cf0653dcf33fc8 (diff) |
fix: 'with' with a logic 'and', child variable evaluated
-rw-r--r-- | layouts/partials/head.html | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index adca496..fbb837d 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -12,17 +12,18 @@ {{ end }} {{ with and .Site.Params.remark42 .Params.show_comments }} + {{ $remark42 := $.Site.Params.remark42 }} <script> var remark_config = { - host: '{{ .host }}', - site_id: '{{ .host }}', + host: '{{ $remark42.host }}', + site_id: '{{ $remark42.host }}', components: ['embed', 'last-comments'], - max_shown_comments: {{ .max_shown_comments }}, - theme: '{{ .remark42.theme }}', - page_title: '{{ .Title }}', - locale: '{{ .locale }}', - show_email_subscription: {{ .show_email_subscription }}, - simple_view: {{ .simple_view }} + max_shown_comments: {{ $remark42.max_shown_comments }}, + theme: '{{ $remark42.theme }}', + page_title: '{{ $remark42.Title }}', + locale: '{{ $remark42.locale }}', + show_email_subscription: {{ $remark42.show_email_subscription }}, + simple_view: {{ $remark42.simple_view }} }; !function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document); |