diff --git a/themes/heo/index.js b/themes/heo/index.js
index 01f23a27..778fbb48 100644
--- a/themes/heo/index.js
+++ b/themes/heo/index.js
@@ -1,7 +1,7 @@
import CONFIG from './config'
import CommonHead from '@/components/CommonHead'
-import { useEffect } from 'react'
+import { useEffect, useState } from 'react'
import Footer from './components/Footer'
import SideRight from './components/SideRight'
import NavBar from './components/NavBar'
@@ -123,11 +123,13 @@ const LayoutIndex = props => {
- {!currentSearch ? (
+ {!currentSearch
+ ? (
- ) : (
+ )
+ : (
- {BLOG.POST_LIST_STYLE === 'page' ? (
+ {BLOG.POST_LIST_STYLE === 'page'
+ ? (
- ) : (
+ )
+ : (
- )}
+ )}
- )}
+ )}
)
@@ -272,6 +280,13 @@ const LayoutSlug = props => {
const { post, lock, validPassword } = props
const { locale } = useGlobal()
+ const [hasCode, setHasCode] = useState(false)
+
+ useEffect(() => {
+ const hasCode = document.querySelectorAll('[class^="language-"]').length > 0
+ setHasCode(hasCode)
+ }, [])
+
// 右侧栏
const slotRight =