)
}
@@ -346,30 +393,39 @@ const LayoutCategoryIndex = (props) => {
* @param {*} props
* @returns
*/
-const LayoutTagIndex = (props) => {
+const LayoutTagIndex = props => {
const { tagOptions } = props
const { locale } = useGlobal()
- return <>
-
-
{locale.COMMON.TAGS}:
-
+ return (
+ <>
+
+
+
+ {locale.COMMON.TAGS}:
+
+
>
+ )
}
export {
- CONFIG as THEME_CONFIG,
- LayoutBase,
- LayoutIndex,
- LayoutSearch,
- LayoutArchive,
- LayoutSlug,
Layout404,
+ LayoutArchive,
+ LayoutBase,
LayoutCategoryIndex,
+ LayoutIndex,
LayoutPostList,
- LayoutTagIndex
+ LayoutSearch,
+ LayoutSlug,
+ LayoutTagIndex,
+ CONFIG as THEME_CONFIG
}
diff --git a/themes/nobelium/index.js b/themes/nobelium/index.js
index 1dc51210..08186a47 100644
--- a/themes/nobelium/index.js
+++ b/themes/nobelium/index.js
@@ -1,32 +1,35 @@
-import CONFIG from './config'
-import { createContext, useEffect, useState, useContext, useRef } from 'react'
-import Nav from './components/Nav'
-import { Footer } from './components/Footer'
-import JumpToTopButton from './components/JumpToTopButton'
+import Comment from '@/components/Comment'
import Live2D from '@/components/Live2D'
+import replaceSearchResult from '@/components/Mark'
+import NotionPage from '@/components/NotionPage'
+import ShareBar from '@/components/ShareBar'
+import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
+import { deepClone, isBrowser } from '@/lib/utils'
+import { Transition } from '@headlessui/react'
+import dynamic from 'next/dynamic'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+import { createContext, useContext, useEffect, useRef, useState } from 'react'
import Announcement from './components/Announcement'
+import { ArticleFooter } from './components/ArticleFooter'
+import { ArticleInfo } from './components/ArticleInfo'
+import { ArticleLock } from './components/ArticleLock'
+import BlogArchiveItem from './components/BlogArchiveItem'
+import BlogListBar from './components/BlogListBar'
import { BlogListPage } from './components/BlogListPage'
import { BlogListScroll } from './components/BlogListScroll'
-import { deepClone, isBrowser } from '@/lib/utils'
+import { Footer } from './components/Footer'
+import JumpToTopButton from './components/JumpToTopButton'
+import Nav from './components/Nav'
import SearchNavBar from './components/SearchNavBar'
-import BlogArchiveItem from './components/BlogArchiveItem'
-import { ArticleLock } from './components/ArticleLock'
-import NotionPage from '@/components/NotionPage'
-import { ArticleInfo } from './components/ArticleInfo'
-import Comment from '@/components/Comment'
-import { ArticleFooter } from './components/ArticleFooter'
-import ShareBar from '@/components/ShareBar'
-import Link from 'next/link'
-import BlogListBar from './components/BlogListBar'
-import { Transition } from '@headlessui/react'
+import CONFIG from './config'
import { Style } from './style'
-import replaceSearchResult from '@/components/Mark'
-import { siteConfig } from '@/lib/config'
-import { useRouter } from 'next/router'
-import dynamic from 'next/dynamic'
-const AlgoliaSearchModal = dynamic(() => import('@/components/AlgoliaSearchModal'), { ssr: false })
+const AlgoliaSearchModal = dynamic(
+ () => import('@/components/AlgoliaSearchModal'),
+ { ssr: false }
+)
// 主题全局状态
const ThemeGlobalNobelium = createContext()
@@ -45,56 +48,56 @@ const LayoutBase = props => {
const searchModal = useRef(null)
// 在列表中进行实时过滤
const [filterKey, setFilterKey] = useState('')
- const topSlot =
+ const topSlot =
return (
-
-
+
+
+
-
+ {/* 顶部导航栏 */}
+
- {/* 顶部导航栏 */}
-
+ {/* 主区 */}
+
+
+ {/* 顶部插槽 */}
+ {topSlot}
+ {children}
+
+
- {/* 主区 */}
-
+ {/* 页脚 */}
+
-
- {/* 顶部插槽 */}
- {topSlot}
- {children}
-
+ {/* 右下悬浮 */}
+
+
+
-
+ {/* 左下悬浮 */}
+
+
+
- {/* 页脚 */}
-
-
- {/* 右下悬浮 */}
-
-
-
-
- {/* 左下悬浮 */}
-
-
-
-
- {/* 搜索框 */}
-
-
-
-
+ {/* 搜索框 */}
+
+
+
)
}
@@ -105,9 +108,7 @@ const LayoutBase = props => {
* @returns
*/
const LayoutIndex = props => {
- return (
-
} />
- )
+ return
} />
}
/**
@@ -130,11 +131,15 @@ const LayoutPostList = props => {
}
return (
- <>
- {topSlot}
- {tag &&
}
- {siteConfig('POST_LIST_STYLE') === 'page' ?
:
}
- >
+ <>
+ {topSlot}
+ {tag &&
}
+ {siteConfig('POST_LIST_STYLE') === 'page' ? (
+
+ ) : (
+
+ )}
+ >
)
}
@@ -172,10 +177,16 @@ const LayoutSearch = props => {
filteredBlogPosts = deepClone(posts)
}
- return <>
-
- {siteConfig('POST_LIST_STYLE') === 'page' ?
:
}
- >
+ return (
+ <>
+
+ {siteConfig('POST_LIST_STYLE') === 'page' ? (
+
+ ) : (
+
+ )}
+ >
+ )
}
/**
@@ -186,11 +197,17 @@ const LayoutSearch = props => {
const LayoutArchive = props => {
const { archivePosts } = props
return (
- <>
-
- {Object.keys(archivePosts).map(archiveTitle => )}
-
- >
+ <>
+
+ {Object.keys(archivePosts).map(archiveTitle => (
+
+ ))}
+
+ >
)
}
@@ -205,34 +222,39 @@ const LayoutSlug = props => {
useEffect(() => {
// 404
if (!post) {
- setTimeout(() => {
- if (isBrowser) {
- const article = document.getElementById('notion-article')
- if (!article) {
- router.push('/404').then(() => {
- console.warn('找不到页面', router.asPath)
- })
+ setTimeout(
+ () => {
+ if (isBrowser) {
+ const article = document.getElementById('notion-article')
+ if (!article) {
+ router.push('/404').then(() => {
+ console.warn('找不到页面', router.asPath)
+ })
+ }
}
- }
- }, siteConfig('POST_WAITING_TIME_FOR_404') * 1000)
+ },
+ siteConfig('POST_WAITING_TIME_FOR_404') * 1000
+ )
}
}, [post])
return (
- <>
+ <>
+ {lock &&
}
- {lock &&
}
-
- {!lock &&
}
-
- >
+ {!lock && (
+
+ )}
+ >
)
}
@@ -241,10 +263,8 @@ const LayoutSlug = props => {
* @param {*} props
* @returns
*/
-const Layout404 = (props) => {
- return <>
- 404 Not found.
- >
+const Layout404 = props => {
+ return <>404 Not found.>
}
/**
@@ -252,28 +272,31 @@ const Layout404 = (props) => {
* @param {*} props
* @returns
*/
-const LayoutCategoryIndex = (props) => {
+const LayoutCategoryIndex = props => {
const { categoryOptions } = props
return (
- <>
-
- {categoryOptions?.map(category => {
- return (
-
-
- {category.name}({category.count})
-
-
- )
- })}
-
- >
+ <>
+
+ {categoryOptions?.map(category => {
+ return (
+
+
+
+ {category.name}({category.count})
+
+
+ )
+ })}
+
+ >
)
}
@@ -282,37 +305,43 @@ const LayoutCategoryIndex = (props) => {
* @param {*} props
* @returns
*/
-const LayoutTagIndex = (props) => {
+const LayoutTagIndex = props => {
const { tagOptions } = props
return (
- <>
-
- >
+ <>
+
+ >
)
}
export {
- CONFIG as THEME_CONFIG,
- LayoutBase,
- LayoutIndex,
- LayoutSearch,
- LayoutArchive,
- LayoutSlug,
Layout404,
- LayoutPostList,
+ LayoutArchive,
+ LayoutBase,
LayoutCategoryIndex,
- LayoutTagIndex
+ LayoutIndex,
+ LayoutPostList,
+ LayoutSearch,
+ LayoutSlug,
+ LayoutTagIndex,
+ CONFIG as THEME_CONFIG
}
diff --git a/themes/plog/index.js b/themes/plog/index.js
index 2bb9b610..be778f68 100644
--- a/themes/plog/index.js
+++ b/themes/plog/index.js
@@ -1,26 +1,26 @@
-import CONFIG from './config'
-import { createContext, useContext, useEffect, useState } from 'react'
-import Header from './components/Nav'
-import { useGlobal } from '@/lib/global'
+import Comment from '@/components/Comment'
+import replaceSearchResult from '@/components/Mark'
+import NotionPage from '@/components/NotionPage'
+import ShareBar from '@/components/ShareBar'
import { siteConfig } from '@/lib/config'
+import { useGlobal } from '@/lib/global'
+import { isBrowser } from '@/lib/utils'
+import { Transition } from '@headlessui/react'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+import { createContext, useContext, useEffect, useState } from 'react'
+import { ArticleFooter } from './components/ArticleFooter'
+import { ArticleInfo } from './components/ArticleInfo'
+import { ArticleLock } from './components/ArticleLock'
+import BlogArchiveItem from './components/BlogArchiveItem'
import { BlogListPage } from './components/BlogListPage'
import { BlogListScroll } from './components/BlogListScroll'
-import { isBrowser } from '@/lib/utils'
-import SearchNavBar from './components/SearchNavBar'
-import BlogArchiveItem from './components/BlogArchiveItem'
-import { ArticleLock } from './components/ArticleLock'
-import NotionPage from '@/components/NotionPage'
-import { ArticleInfo } from './components/ArticleInfo'
-import Comment from '@/components/Comment'
-import { ArticleFooter } from './components/ArticleFooter'
-import ShareBar from '@/components/ShareBar'
-import Link from 'next/link'
-import { Transition } from '@headlessui/react'
import BottomNav from './components/BottomNav'
import Modal from './components/Modal'
+import Header from './components/Nav'
+import SearchNavBar from './components/SearchNavBar'
+import CONFIG from './config'
import { Style } from './style'
-import replaceSearchResult from '@/components/Mark'
-import { useRouter } from 'next/router'
// 主题全局状态
const ThemeGlobalPlog = createContext()
@@ -52,42 +52,45 @@ const LayoutBase = props => {
}, [router.events])
return (
-
-
+
+
+
-
+ {/* 移动端顶部导航栏 */}
+
- {/* 移动端顶部导航栏 */}
-
+ {/* 主区 */}
+
+
+ {/* 顶部插槽 */}
+ {topSlot}
+ {children}
+
+
- {/* 主区 */}
-
+ {/* 弹出框 - 用于放大显示首页图片等作用 */}
+
-
- {/* 顶部插槽 */}
- {topSlot}
- {children}
-
-
-
-
- {/* 弹出框 - 用于放大显示首页图片等作用 */}
-
-
- {/* 桌面端底部导航栏 */}
-
-
-
+ {/* 桌面端底部导航栏 */}
+
+
+
)
}
@@ -98,9 +101,7 @@ const LayoutBase = props => {
* @returns
*/
const LayoutIndex = props => {
- return (
-
- )
+ return
}
/**
@@ -110,9 +111,13 @@ const LayoutIndex = props => {
*/
const LayoutPostList = props => {
return (
- <>
- {siteConfig('POST_LIST_STYLE') === 'page' ?
:
}
- >
+ <>
+ {siteConfig('POST_LIST_STYLE') === 'page' ? (
+
+ ) : (
+
+ )}
+ >
)
}
@@ -149,11 +154,17 @@ const LayoutSearch = props => {
const LayoutArchive = props => {
const { archivePosts } = props
return (
- <>
-
- {Object.keys(archivePosts).map(archiveTitle => )}
-
- >
+ <>
+
+ {Object.keys(archivePosts).map(archiveTitle => (
+
+ ))}
+
+ >
)
}
@@ -168,34 +179,39 @@ const LayoutSlug = props => {
useEffect(() => {
// 404
if (!post) {
- setTimeout(() => {
- if (isBrowser) {
- const article = document.getElementById('notion-article')
- if (!article) {
- router.push('/404').then(() => {
- console.warn('找不到页面', router.asPath)
- })
+ setTimeout(
+ () => {
+ if (isBrowser) {
+ const article = document.getElementById('notion-article')
+ if (!article) {
+ router.push('/404').then(() => {
+ console.warn('找不到页面', router.asPath)
+ })
+ }
}
- }
- }, siteConfig('POST_WAITING_TIME_FOR_404') * 1000)
+ },
+ siteConfig('POST_WAITING_TIME_FOR_404') * 1000
+ )
}
}, [post])
return (
- <>
+ <>
+ {lock &&
}
- {lock &&
}
-
- {!lock &&
}
-
- >
+ {!lock && (
+
+ )}
+ >
)
}
@@ -204,10 +220,8 @@ const LayoutSlug = props => {
* @param {*} props
* @returns
*/
-const Layout404 = (props) => {
- return <>
- 404 Not found.
- >
+const Layout404 = props => {
+ return <>404 Not found.>
}
/**
@@ -215,28 +229,31 @@ const Layout404 = (props) => {
* @param {*} props
* @returns
*/
-const LayoutCategoryIndex = (props) => {
+const LayoutCategoryIndex = props => {
const { categoryOptions } = props
return (
- <>
-
- {categoryOptions?.map(category => {
- return (
-
-
- {category.name}({category.count})
-
-
- )
- })}
-
- >
+ <>
+
+ {categoryOptions?.map(category => {
+ return (
+
+
+
+ {category.name}({category.count})
+
+
+ )
+ })}
+
+ >
)
}
@@ -245,37 +262,43 @@ const LayoutCategoryIndex = (props) => {
* @param {*} props
* @returns
*/
-const LayoutTagIndex = (props) => {
+const LayoutTagIndex = props => {
const { tagOptions } = props
return (
- <>
-
- >
+ <>
+
+ >
)
}
export {
- CONFIG as THEME_CONFIG,
- LayoutBase,
- LayoutIndex,
- LayoutSearch,
- LayoutArchive,
- LayoutSlug,
Layout404,
- LayoutPostList,
+ LayoutArchive,
+ LayoutBase,
LayoutCategoryIndex,
- LayoutTagIndex
+ LayoutIndex,
+ LayoutPostList,
+ LayoutSearch,
+ LayoutSlug,
+ LayoutTagIndex,
+ CONFIG as THEME_CONFIG
}
diff --git a/themes/simple/index.js b/themes/simple/index.js
index 9bef23f0..397e6a69 100644
--- a/themes/simple/index.js
+++ b/themes/simple/index.js
@@ -224,9 +224,7 @@ const LayoutSlug = props => {
<>
{lock &&
}
-
+
{/* 文章信息 */}
@@ -234,8 +232,10 @@ const LayoutSlug = props => {
{/*
*/}
- {/* Notion文章主体 */}
- {!lock &&
}
+
+ {/* Notion文章主体 */}
+ {!lock && }
+
{/* 分享 */}
diff --git a/themes/starter/index.js b/themes/starter/index.js
index 195b7d0f..55d5abd4 100644
--- a/themes/starter/index.js
+++ b/themes/starter/index.js
@@ -143,8 +143,8 @@ const LayoutSlug = props => {