Merge pull request #1846 from tangly1024/release/4.2.2

Release/4.2.2
This commit is contained in:
tangly1024
2024-01-31 15:27:29 +08:00
committed by GitHub
10 changed files with 7265 additions and 3621 deletions

View File

@@ -1,5 +1,5 @@
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
NEXT_PUBLIC_VERSION=4.2.1
NEXT_PUBLIC_VERSION=4.2.2
# 可在此添加环境变量,去掉最左边的(# )注释即可

View File

@@ -25,10 +25,11 @@ export function GlobalContextProvider(props) {
// 切换主题
function switchTheme() {
const currentIndex = THEMES.indexOf(theme)
const query = router.query
const currentTheme = query.theme || theme
const currentIndex = THEMES.indexOf(currentTheme)
const newIndex = currentIndex < THEMES.length - 1 ? currentIndex + 1 : 0
const newTheme = THEMES[newIndex]
const query = router.query
query.theme = newTheme
router.push({ pathname: router.pathname, query })
return newTheme

View File

@@ -278,7 +278,7 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) {
if (pageIds?.length === 0) {
console.error('获取到的文章列表为空请检查notion模板', collectionQuery, collection, collectionView, viewIds, pageRecordMap)
} else {
console.log('有效Page数量', pageIds?.length)
// console.log('有效Page数量', pageIds?.length)
}
// 获取每篇文章基础数据

10842
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "notion-next",
"version": "4.2.1",
"version": "4.2.2",
"homepage": "https://github.com/tangly1024/NotionNext.git",
"license": "MIT",
"repository": {
@@ -37,7 +37,7 @@
"lodash.throttle": "^4.1.1",
"memory-cache": "^0.2.0",
"mongodb": "^4.6.0",
"next": "13.3.1",
"next": "13.5.1",
"notion-client": "6.15.6",
"notion-utils": "6.15.6",
"nprogress": "^0.2.0",
@@ -63,7 +63,7 @@
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.23.2",
"next-sitemap": "^1.6.203",
"postcss": "^8.4.20",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.2",
"webpack-bundle-analyzer": "^4.5.0"
},

View File

@@ -130,7 +130,11 @@ const NavBar = props => {
`}</style>
{/* 顶部导航菜单栏 */}
<nav id='nav' className={`${fixedNav ? 'fixed' : 'relative bg-none'} ${textWhite ? 'text-white ' : 'text-black dark:text-white'} ${navBgWhite ? 'bg-white dark:bg-[#18171d]' : 'bg-none'} z-20 h-16 top-0 w-full`}>
<nav id='nav' className={`z-20 h-16 top-0 w-full
${fixedNav ? 'fixed' : 'relative bg-transparent'}
${textWhite ? 'text-white ' : 'text-black dark:text-white'}
${navBgWhite ? 'bg-white dark:bg-[#18171d]' : 'bg-transparent'}`}>
<div className='flex h-full mx-auto justify-between items-center max-w-[86rem] px-8'>
{/* 左侧logo */}
<div className='flex'>

View File

@@ -65,7 +65,7 @@ export default function SlideOver(props) {
<div className="absolute left-0 top-0 -ml-8 flex pr-2 pt-4 sm:-ml-10 sm:pr-4">
<button
type="button"
className="rounded-md text-gray-300 hover:text-white focus:outline-none focus:ring-2 focus:ring-white"
className="rounded-md text-gray-500 hover:text-white focus:outline-none focus:ring-2 focus:ring-white"
onClick={() => setOpen(false)}
>
<span className="sr-only">Close panel</span>

View File

@@ -62,9 +62,8 @@ const LayoutBase = props => {
const headerSlot = (
<header>
{/* 顶部导航 */}
<div id="nav-bar-wrapper" className="h-16">
<NavBar {...props} />
</div>
<NavBar {...props} />
{/* 通知横幅 */}
{router.route === '/'
? <>

View File

@@ -32,6 +32,7 @@ import dynamic from 'next/dynamic'
import { MenuItem } from './components/MenuItem'
import LogoBar from './components/LogoBar'
import { siteConfig } from '@/lib/config'
import Live2D from '@/components/Live2D'
const WWAds = dynamic(() => import('@/components/WWAds'), { ssr: false })
@@ -104,6 +105,7 @@ const LayoutBase = (props) => {
{/* 页脚站点信息 */}
<div className='w-56 fixed left-0 bottom-0 z-0'>
<Live2D />
<Footer {...props} />
</div>
</div>

View File

@@ -14,13 +14,13 @@ export const { THEMES = [] } = getConfig().publicRuntimeConfig
* @returns
*/
export const getGlobalLayoutByTheme = (themeQuery) => {
const layout = getLayoutNameByPath(-1)
if (themeQuery !== BLOG.THEME) {
return dynamic(() => import(`@/themes/${themeQuery}`).then(m => m[layout]), { ssr: true })
} else {
return ThemeComponents[layout]
}
const layout = getLayoutNameByPath(-1)
if (themeQuery !== BLOG.THEME) {
return dynamic(() => import(`@/themes/${themeQuery}`).then(m => m[layout]), { ssr: true })
} else {
return ThemeComponents[layout]
}
}
/**
* 加载主题文件
@@ -71,7 +71,7 @@ const checkThemeDOM = () => {
export const getLayoutNameByPath = (path) => {
switch (path) {
case -1:
return 'LayoutBase'
return 'LayoutBase'
case '/':
return 'LayoutIndex'
case '/archive':