From 3bd9bf20d79f502d406b349e153b43be1336188c Mon Sep 17 00:00:00 2001 From: TheYoungManLi Date: Mon, 1 Aug 2022 16:01:42 +0800 Subject: [PATCH] fix: Algolia doesn't work Signed-off-by: TheYoungManLi --- layouts/partials/css.html | 2 +- layouts/partials/head.html | 28 ++++++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/layouts/partials/css.html b/layouts/partials/css.html index fc2f3c73a..04ffe2604 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -24,7 +24,7 @@ {{ end }} -{{ if .IsDescendant (.GetPage "/docs") }} +{{ if or (.IsDescendant (.GetPage "/docs")) (.InSection (.GetPage "/docs")) }} {{ if not (eq . (.GetPage "/docs"))}} {{ $folder := . }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c6b75d948..791c63c7d 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -29,7 +29,7 @@ -{{ if .IsDescendant (.GetPage "/docs") }} +{{ if or (.IsDescendant (.GetPage "/docs")) (.InSection (.GetPage "/docs")) }} {{ end }} @@ -83,17 +83,21 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= -{{ if (and (.Site.Params.hotjarTracking) (.IsDescendant (.GetPage "/docs")) (eq .Site.Language.Lang "en")) }} - +{{ if eq .Site.Language.Lang "en" }} + {{ if .Site.Params.hotjarTracking }} + {{ if or (.IsDescendant (.GetPage "/docs")) (.InSection (.GetPage "/docs")) }} + + {{ end }} + {{ end }} {{ end }}