diff --git a/components/ExternalPlugins.js b/components/ExternalPlugins.js
index 2b1f1cd0..768cc384 100644
--- a/components/ExternalPlugins.js
+++ b/components/ExternalPlugins.js
@@ -171,14 +171,13 @@ const ExternalPlugin = (props) => {
{CLARITY_ID && (<>
+ (function(c,l,a,r,i,t,y){
+ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
+ t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
+ y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
+ })(window, document, "clarity", "script", "${CLARITY_ID}");
+ `
+ }} />
>)}
{COMMENT_DAO_VOICE_ID && (<>
diff --git a/pages/_app.js b/pages/_app.js
index da9b3efc..2d9699e5 100644
--- a/pages/_app.js
+++ b/pages/_app.js
@@ -9,17 +9,42 @@ import '@/styles/notion.css' // 重写部分样式
import 'aos/dist/aos.css' // You can also use for styles
import { GlobalContextProvider } from '@/lib/global'
+import { getGlobalLayoutByTheme } from '@/themes/theme'
+import { useRouter } from 'next/router'
+import { useCallback, useMemo } from 'react'
+import { getQueryParam } from '../lib/utils'
// 各种扩展插件 这个要阻塞引入
import ExternalPlugins from '@/components/ExternalPlugins'
+import { THEME } from '@/blog.config'
const MyApp = ({ Component, pageProps }) => {
+ /**
+ * 首页布局
+ * @param {*} props
+ * @returns
+ */
+ const route = useRouter()
+ const queryParam = useMemo(() => {
+ return getQueryParam(route.asPath, 'theme') || THEME
+ }, [route])
+
+ const GLayout = useCallback(
+ props => {
+ // 根据页面路径加载不同Layout文件
+ const Layout = getGlobalLayoutByTheme(queryParam)
+ return