+ return <>
{/* 搜索导航栏 */}
@@ -236,7 +237,7 @@ const LayoutSearch = (props) => {
{currentSearch &&
{siteConfig('POST_LIST_STYLE') === 'page' ? : }
}
-
+ >
}
/**
@@ -247,12 +248,12 @@ const LayoutSearch = (props) => {
const LayoutArchive = props => {
const { archivePosts } = props
return (
-
+ <>
{Object.keys(archivePosts)?.map(archiveTitle =>
)}
-
+ >
)
}
@@ -262,9 +263,9 @@ const LayoutArchive = props => {
* @returns
*/
const Layout404 = props => {
- return
+ return <>
404 Not found.
-
+ >
}
/**
@@ -276,7 +277,7 @@ const LayoutCategoryIndex = (props) => {
const { categoryOptions } = props
const { locale } = useGlobal()
return (
-
+ <>
{locale.COMMON.CATEGORY}:
@@ -298,7 +299,7 @@ const LayoutCategoryIndex = (props) => {
})}
-
+ >
)
}
@@ -311,7 +312,7 @@ const LayoutTagIndex = props => {
const { tagOptions } = props
const { locale } = useGlobal()
return (
-
+ <>
@@ -327,7 +328,7 @@ const LayoutTagIndex = props => {
})}
-
+ >
)
}
diff --git a/themes/nav/components/MenuItem.js b/themes/nav/components/MenuItem.js
index 9eeb5ecf..84d2a42e 100644
--- a/themes/nav/components/MenuItem.js
+++ b/themes/nav/components/MenuItem.js
@@ -50,9 +50,9 @@ export const MenuItem = ({ link }) => {
{
link?.subMenus?.map((sLink, index) => (
))
}
diff --git a/themes/nav/index.js b/themes/nav/index.js
index 9c98dab2..bf6e4662 100755
--- a/themes/nav/index.js
+++ b/themes/nav/index.js
@@ -172,10 +172,10 @@ const LayoutPostListIndex = props => {
// const { customMenu, children, post, allNavPages, categoryOptions, slotLeft, slotRight, slotTop, meta } = props
// const [filteredNavPages, setFilteredNavPages] = useState(allNavPages)
return (
-
+ >
)
}
@@ -189,7 +189,7 @@ const LayoutPostList = props => {
// 顶部如果是按照分类或标签查看文章列表,列表顶部嵌入一个横幅
// 如果是搜索,则列表顶部嵌入 搜索框
return (
-
+ <>
{posts?.map(post => (
@@ -197,7 +197,7 @@ const LayoutPostList = props => {
))}
-
+ >
)
}
@@ -210,7 +210,7 @@ const LayoutSlug = (props) => {
const { post, lock, validPassword } = props
return (
-
+ <>
{/* 文章锁 */}
{lock &&
}
@@ -244,7 +244,7 @@ const LayoutSlug = (props) => {
}
-
+ >
)
}
@@ -255,7 +255,7 @@ const LayoutSlug = (props) => {
* @returns
*/
const LayoutSearch = (props) => {
- return
{/* SEO相关 */}
@@ -105,8 +114,14 @@ const LayoutBase = (props) => {
{/* 右侧栏样式 */}
{siteConfig('NEXT_RIGHT_BAR', null, CONFIG) &&
}
+
+ {/* 悬浮目录按钮 */}
+ {post &&
+
+
}
+
{/* 右下角悬浮 */}
@@ -139,7 +154,7 @@ const LayoutIndex = (props) => {
* @returns
*/
const LayoutPostList = (props) => {
- return
+ return <>
@@ -147,7 +162,7 @@ const LayoutPostList = (props) => {
?
:
}
-
+ >
}
/**
@@ -173,7 +188,7 @@ const LayoutSearch = (props) => {
}, [])
return (
-
+ <>
{' '}
@@ -186,7 +201,7 @@ const LayoutSearch = (props) => {
:
}
-
+ >
)
}
@@ -230,7 +245,7 @@ const LayoutArchive = (props) => {
const { archivePosts } = props
return (
-
+ <>
{Object.keys(archivePosts).map(archiveTitle => (
{
/>
))}
-
+ >
)
}
@@ -251,27 +266,14 @@ const LayoutArchive = (props) => {
*/
const LayoutSlug = (props) => {
const { post, lock, validPassword } = props
- const drawerRight = useRef(null)
- const targetRef = isBrowser ? document.getElementById('article-wrapper') : null
- const floatSlot =
- {
- drawerRight?.current?.handleSwitchVisible()
- }} />
-
-
return (
-
+ <>
{post && !lock &&
}
{post && lock &&
}
- {/* 悬浮目录按钮 */}
- {post &&
-
-
}
-
-
+ >
)
}
@@ -318,7 +320,7 @@ const LayoutCategoryIndex = (props) => {
const LayoutTagIndex = (props) => {
const { tagOptions } = props
const { locale } = useGlobal()
- return
+ return <>
{locale.COMMON.TAGS}:
@@ -327,7 +329,7 @@ const LayoutTagIndex = (props) => {
})}
-
+ >
}
export {
diff --git a/themes/nobelium/components/BlogListBar.js b/themes/nobelium/components/BlogListBar.js
index 69076937..57ca7e7b 100644
--- a/themes/nobelium/components/BlogListBar.js
+++ b/themes/nobelium/components/BlogListBar.js
@@ -1,7 +1,8 @@
+import { useNobeliumGlobal } from '..'
import Tags from './Tags'
export default function BlogListBar(props) {
- const { tag, setFilterKey } = props
+ const { tag, setFilterKey } = useNobeliumGlobal()
const handleSearchChange = (val) => {
setFilterKey(val)
}
diff --git a/themes/nobelium/index.js b/themes/nobelium/index.js
index f5152842..83650ae8 100644
--- a/themes/nobelium/index.js
+++ b/themes/nobelium/index.js
@@ -37,14 +37,16 @@ export const useNobeliumGlobal = () => useContext(ThemeGlobalNobelium)
* @constructor
*/
const LayoutBase = props => {
- const { children, post, topSlot, meta } = props
-
+ const { children, post, meta } = props
const fullWidth = post?.fullWidth ?? false
const { onLoading } = useGlobal()
const searchModal = useRef(null)
+ // 在列表中进行实时过滤
+ const [filterKey, setFilterKey] = useState('')
+ const topSlot=
return (
-
+
{/* SEO相关 */}
@@ -114,10 +116,8 @@ const LayoutIndex = props => {
* @returns
*/
const LayoutPostList = props => {
- const { posts, topSlot } = props
-
- // 在列表中进行实时过滤
- const [filterKey, setFilterKey] = useState('')
+ const { posts, topSlot,tag } = props
+ const { filterKey } = useNobeliumGlobal()
let filteredBlogPosts = []
if (filterKey && posts) {
filteredBlogPosts = posts.filter(post => {
@@ -130,10 +130,11 @@ const LayoutPostList = props => {
}
return (
-
}>
+ <>
{topSlot}
+ {tag &&
}
{siteConfig('POST_LIST_STYLE') === 'page' ?
:
}
-
+ >
)
}
@@ -159,7 +160,7 @@ const LayoutSearch = props => {
}, [])
// 在列表中进行实时过滤
- const [filterKey, setFilterKey] = useState('')
+ const {filterKey} = useNobeliumGlobal()
let filteredBlogPosts = []
if (filterKey && posts) {
filteredBlogPosts = posts.filter(post => {
@@ -171,10 +172,10 @@ const LayoutSearch = props => {
filteredBlogPosts = deepClone(posts)
}
- return }>
+ return <>
{siteConfig('POST_LIST_STYLE') === 'page' ? : }
-
+ >
}
/**
@@ -185,11 +186,11 @@ const LayoutSearch = props => {
const LayoutArchive = props => {
const { archivePosts } = props
return (
-
+ <>
{Object.keys(archivePosts).map(archiveTitle => )}
-
+ >
)
}
@@ -202,7 +203,7 @@ const LayoutSlug = props => {
const { post, lock, validPassword } = props
return (
-
+ <>
{lock &&
}
@@ -216,7 +217,7 @@ const LayoutSlug = props => {
>
}
-
+ >
)
}
@@ -226,9 +227,9 @@ const LayoutSlug = props => {
* @returns
*/
const Layout404 = (props) => {
- return
+ return <>
404 Not found.
-
+ >
}
/**
@@ -240,7 +241,7 @@ const LayoutCategoryIndex = (props) => {
const { categoryOptions } = props
return (
-
+ <>
{categoryOptions?.map(category => {
return (
@@ -257,7 +258,7 @@ const LayoutCategoryIndex = (props) => {
)
})}
-
+ >
)
}
@@ -269,7 +270,7 @@ const LayoutCategoryIndex = (props) => {
const LayoutTagIndex = (props) => {
const { tagOptions } = props
return (
-
+ <>
{tagOptions.map(tag => {
@@ -284,7 +285,7 @@ const LayoutTagIndex = (props) => {
})}
-
+ >
)
}
diff --git a/themes/plog/components/BlogListBar.js b/themes/plog/components/BlogListBar.js
deleted file mode 100644
index 69076937..00000000
--- a/themes/plog/components/BlogListBar.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import Tags from './Tags'
-
-export default function BlogListBar(props) {
- const { tag, setFilterKey } = props
- const handleSearchChange = (val) => {
- setFilterKey(val)
- }
- if (tag) {
- return (
-
-
handleSearchChange(e.target.value)}
- />
-
-
-
-
)
- } else {
- return <>>
- }
-}
diff --git a/themes/plog/components/Modal.js b/themes/plog/components/Modal.js
index 24494df7..8c490093 100644
--- a/themes/plog/components/Modal.js
+++ b/themes/plog/components/Modal.js
@@ -5,6 +5,7 @@ import { ArrowPath, ChevronLeft, ChevronRight } from '@/components/HeroIcons'
import Link from 'next/link'
import { siteConfig } from '@/lib/config'
import LazyImage from '@/components/LazyImage'
+import { compressImage } from '@/lib/notion/mapImage'
/**
* 弹出框
@@ -13,7 +14,7 @@ export default function Modal(props) {
const { showModal, setShowModal, modalContent, setModalContent } = usePlogGlobal()
const { siteInfo, posts } = props
const cancelButtonRef = useRef(null)
- const img = modalContent?.pageCover || siteInfo?.pageCover
+ const img = compressImage(modalContent?.pageCover || siteInfo?.pageCover, 1200, 85, 'webp')
const imgRef = useRef(null)
// 添加loading状态
diff --git a/themes/plog/index.js b/themes/plog/index.js
index a777055b..07d34068 100644
--- a/themes/plog/index.js
+++ b/themes/plog/index.js
@@ -98,9 +98,9 @@ const LayoutIndex = props => {
*/
const LayoutPostList = props => {
return (
-
+ <>
{siteConfig('POST_LIST_STYLE') === 'page' ? : }
-
+ >
)
}
@@ -137,11 +137,11 @@ const LayoutSearch = props => {
const LayoutArchive = props => {
const { archivePosts } = props
return (
-
+ <>
{Object.keys(archivePosts).map(archiveTitle => )}
-
+ >
)
}
@@ -154,7 +154,7 @@ const LayoutSlug = props => {
const { post, lock, validPassword } = props
return (
-
+ <>
{lock &&
}
@@ -168,7 +168,7 @@ const LayoutSlug = props => {
>
}
-
+ >
)
}
@@ -178,9 +178,9 @@ const LayoutSlug = props => {
* @returns
*/
const Layout404 = (props) => {
- return