diff --git a/lib/db/getSiteData.js b/lib/db/getSiteData.js
index cefc25f0..302efccf 100755
--- a/lib/db/getSiteData.js
+++ b/lib/db/getSiteData.js
@@ -63,7 +63,7 @@ export async function getSiteDataByPageId({ pageId, from }) {
// 获取NOTION原始数据,此接支持mem缓存。
const pageRecordMap = await getPage(pageId, from)
// 将Notion数据按规则转成站点数据
- const data = await converNotionToSiteDate(pageId, from, pageRecordMap)
+ const data = await converNotionToSiteDate(pageId, from, deepClone(pageRecordMap))
return data
}
diff --git a/themes/starter/components/SearchInput.js b/themes/starter/components/SearchInput.js
new file mode 100644
index 00000000..1baf29e8
--- /dev/null
+++ b/themes/starter/components/SearchInput.js
@@ -0,0 +1,107 @@
+import { useGlobal } from '@/lib/global'
+import { useRouter } from 'next/router'
+import { useImperativeHandle, useRef, useState } from 'react'
+
+let lock = false
+
+/**
+ * 搜索输入框
+ * @param {*} param0
+ * @returns
+ */
+const SearchInput = ({ currentTag, keyword, cRef }) => {
+ const { locale } = useGlobal()
+ const router = useRouter()
+ const searchInputRef = useRef(null)
+ useImperativeHandle(cRef, () => {
+ return {
+ focus: () => {
+ searchInputRef?.current?.focus()
+ }
+ }
+ })
+ const handleSearch = () => {
+ const key = searchInputRef.current.value
+ if (key && key !== '') {
+ router.push({ pathname: '/search/' + key }).then(r => {})
+ } else {
+ router.push({ pathname: '/' }).then(r => {})
+ }
+ }
+ const handleKeyUp = e => {
+ if (e.keyCode === 13) {
+ // 回车
+ handleSearch(searchInputRef.current.value)
+ } else if (e.keyCode === 27) {
+ // ESC
+ cleanSearch()
+ }
+ }
+ const cleanSearch = () => {
+ searchInputRef.current.value = ''
+ setShowClean(false)
+ }
+ function lockSearchInput() {
+ lock = true
+ }
+
+ function unLockSearchInput() {
+ lock = false
+ }
+ const [showClean, setShowClean] = useState(false)
+ const updateSearchKey = val => {
+ if (lock) {
+ return
+ }
+ searchInputRef.current.value = val
+ if (val) {
+ setShowClean(true)
+ } else {
+ setShowClean(false)
+ }
+ }
+
+ return (
+