diff --git a/.env.local b/.env.local index 3cf57133..c2daaaed 100644 --- a/.env.local +++ b/.env.local @@ -1,5 +1,5 @@ # 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=4.2.3 +NEXT_PUBLIC_VERSION=4.2.4 # 可在此添加环境变量,去掉最左边的(# )注释即可 diff --git a/blog.config.js b/blog.config.js index f038e23f..4677c555 100644 --- a/blog.config.js +++ b/blog.config.js @@ -45,8 +45,9 @@ const BLOG = { // 默认下会将你上传到 notion的主页封面图和头像也给替换,建议将主页封面图和头像放在其他图床,在 notion 里配置 link 即可。 // START ************网站字体***************** - - FONT_STYLE: process.env.NEXT_PUBLIC_FONT_STYLE || 'font-sans', // ['font-serif','font-sans'] 两种可选,分别是衬线和无衬线: 参考 https://www.jianshu.com/p/55e410bd2115 + // ['font-serif','font-sans'] 两种可选,分别是衬线和无衬线: 参考 https://www.jianshu.com/p/55e410bd2115 + // 后面空格隔开的font-light的字体粗细,留空是默认粗细;参考 https://www.tailwindcss.cn/docs/font-weight + FONT_STYLE: process.env.NEXT_PUBLIC_FONT_STYLE || 'font-sans font-light', // 字体CSS 例如 https://npm.elemecdn.com/lxgw-wenkai-webfont@1.6.0/style.css FONT_URL: [ // 'https://npm.elemecdn.com/lxgw-wenkai-webfont@1.6.0/style.css', diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 32089e30..9a1dff7c 100755 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -119,6 +119,7 @@ export async function getNotionPageData({ pageId, from }) { /** * 获取用户自定义单页菜单 + * 旧版本,不读取Menu菜单,而是读取type=Page生成菜单 * @param notionPageData * @returns {Promise<[]|*[]>} */ @@ -126,11 +127,16 @@ function getCustomNav({ allPages }) { const customNav = [] if (allPages && allPages.length > 0) { allPages.forEach(p => { + p.to = p.slug if (p?.slug?.indexOf('http') === 0) { - customNav.push({ icon: p.icon || null, name: p.title, to: p.slug, target: '_blank', show: true }) + p.target = '_blank' } else { - customNav.push({ icon: p.icon || null, name: p.title, to: '/' + p.slug, target: '_self', show: true }) + p.target = '_self' + if (p?.slug?.indexOf('/') !== 0) { + p.to = '/' + p.slug + } } + customNav.push({ icon: p.icon || null, name: p.title, to: p.slug, target: '_blank', show: true }) }) } return customNav @@ -142,13 +148,19 @@ function getCustomNav({ allPages }) { * @returns */ function getCustomMenu({ collectionData }) { - const menuPages = collectionData.filter(post => (post?.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post?.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) && post.status === 'Published') + const menuPages = collectionData.filter(post => post.status === 'Published' && (post?.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post?.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu)) const menus = [] if (menuPages && menuPages.length > 0) { menuPages.forEach(e => { e.show = true if (e?.slug?.indexOf('http') === 0) { e.target = '_blank' + e.to = e.slug + } else { + e.target = '_self' + if (e?.slug?.indexOf('/') !== 0) { + e.to = '/' + e.slug + } } if (e.type === BLOG.NOTION_PROPERTY_NAME.type_menu) { menus.push(e) diff --git a/lib/notion/getPostBlocks.js b/lib/notion/getPostBlocks.js index 7c085993..69888b5d 100644 --- a/lib/notion/getPostBlocks.js +++ b/lib/notion/getPostBlocks.js @@ -18,10 +18,7 @@ export async function getPostBlocks(id, from, slice) { return filterPostBlocks(id, pageBlock, slice) } - const start = new Date().getTime() pageBlock = await getPageWithRetry(id, from) - const end = new Date().getTime() - console.log('[API耗时]', `${end - start}ms`) if (pageBlock) { await setDataToCache(cacheKey, pageBlock) @@ -38,10 +35,7 @@ export async function getSingleBlock(id, from) { return pageBlock } - const start = new Date().getTime() pageBlock = await getPageWithRetry(id, from) - const end = new Date().getTime() - console.log('[API耗时]', `${end - start}ms`) if (pageBlock) { await setDataToCache(cacheKey, pageBlock) @@ -56,16 +50,17 @@ export async function getSingleBlock(id, from) { */ export async function getPageWithRetry(id, from, retryAttempts = 3) { if (retryAttempts && retryAttempts > 0) { - console.log('[请求API]', `from:${from}`, `id:${id}`, retryAttempts < 3 ? `剩余重试次数:${retryAttempts}` : '') + console.log('[API-->>请求]', `from:${from}`, `id:${id}`, retryAttempts < 3 ? `剩余重试次数:${retryAttempts}` : '') try { const authToken = BLOG.NOTION_ACCESS_TOKEN || null const api = new NotionAPI({ authToken, userTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }) + const start = new Date().getTime() const pageData = await api.getPage(id) - // console.log('stringfy', JSON.stringify(pageData)) - console.info('[响应成功]:', `from:${from}`) + const end = new Date().getTime() + console.log('[API<<--响应]', `耗时:${end - start}ms - from:${from}`) return pageData } catch (e) { - console.warn('[响应异常]:', e) + console.warn('[API<<--异常]:', e) await delay(1000) const cacheKey = 'page_block_' + id const pageBlock = await getDataFromCache(cacheKey) diff --git a/next.config.js b/next.config.js index f6dc572b..732303bf 100644 --- a/next.config.js +++ b/next.config.js @@ -16,13 +16,16 @@ function scanSubdirectories(directory) { const subdirectories = [] fs.readdirSync(directory).forEach(file => { - const fullPath = path.join(directory, file) - const stats = fs.statSync(fullPath) + // 这段代码会将landing排除在可选主题中 - // landing主题比较特殊,不在可切换的主题中显示 - if (stats.isDirectory() && file !== 'landing') { - subdirectories.push(file) - } + // const fullPath = path.join(directory, file) + // const stats = fs.statSync(fullPath) + // landing主题默认隐藏掉,一般网站不会用到 + // if (stats.isDirectory() && file !== 'landing') { + // subdirectories.push(file) + // } + + subdirectories.push(file) }) return subdirectories @@ -94,7 +97,7 @@ module.exports = withBundleAnalyzer({ // } // 动态主题:添加 resolve.alias 配置,将动态路径映射到实际路径 if (!isServer) { - console.log('加载默认主题', path.resolve(__dirname, 'themes', THEME)) + console.log('[加载主题]', path.resolve(__dirname, 'themes', THEME)) } config.resolve.alias['@theme-components'] = path.resolve(__dirname, 'themes', THEME) return config diff --git a/package.json b/package.json index 6a679668..82efcf06 100644 --- a/package.json +++ b/package.json @@ -1,77 +1,78 @@ { - "name": "notion-next", - "version": "4.2.3", - "homepage": "https://github.com/tangly1024/NotionNext.git", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/tangly1024/NotionNext.git" - }, - "author": { - "name": "tangly", - "email": "mail@tangly1024.com", - "url": "http://tangly1024.com" - }, - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "post-build": "next-sitemap --config next-sitemap.config.js", - "export": "next build && next-sitemap --config next-sitemap.config.js && next export", - "bundle-report": "ANALYZE=true yarn build" - }, - "dependencies": { - "@giscus/react": "^2.2.6", - "@headlessui/react": "^1.7.15", - "@next/bundle-analyzer": "^12.1.1", - "@vercel/analytics": "^1.0.0", - "algoliasearch": "^4.18.0", - "animejs": "^3.2.1", - "aos": "^3.0.0-beta.6", - "axios": ">=0.21.1", - "copy-to-clipboard": "^3.3.1", - "eslint-plugin-react-hooks": "^4.6.0", - "feed": "^4.2.2", - "js-md5": "^0.7.3", - "localStorage": "^1.0.4", - "lodash.throttle": "^4.1.1", - "memory-cache": "^0.2.0", - "mongodb": "^4.6.0", - "next": "13.3.1", - "notion-client": "6.15.6", - "notion-utils": "6.15.6", - "nprogress": "^0.2.0", - "preact": "^10.5.15", - "prism-themes": "1.9.0", - "react": "^18.2.0", - "react-cookies": "^0.1.1", - "react-dom": "^18.2.0", - "react-facebook": "^8.1.4", - "react-notion-x": "6.16.0", - "react-share": "^4.4.1", - "react-tweet-embed": "~2.0.0", - "typed.js": "^2.0.12" - }, - "devDependencies": { - "@waline/client": "^2.5.1", - "autoprefixer": "^10.4.13", - "eslint": "^7.26.0", - "eslint-config-next": "^13.1.1", - "eslint-config-standard": "^16.0.2", - "eslint-plugin-import": "^2.23.0", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^5.1.0", - "eslint-plugin-react": "^7.23.2", - "next-sitemap": "^1.6.203", - "postcss": "^8.4.31", - "tailwindcss": "^3.3.2", - "webpack-bundle-analyzer": "^4.5.0" - }, - "resolutions": { - "axios": ">=0.21.1" - }, - "bugs": { - "url": "https://github.com/tangly/NotionNext/issues", - "email": "tlyong1992@hotmail.com" - } -} + "name": "notion-next", + "version": "4.2.4", + "homepage": "https://github.com/tangly1024/NotionNext.git", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/tangly1024/NotionNext.git" + }, + "author": { + "name": "tangly", + "email": "mail@tangly1024.com", + "url": "http://tangly1024.com" + }, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "post-build": "next-sitemap --config next-sitemap.config.js", + "export": "next build && next-sitemap --config next-sitemap.config.js && next export", + "bundle-report": "ANALYZE=true yarn build" + }, + "dependencies": { + "@giscus/react": "^2.2.6", + "@headlessui/react": "^1.7.15", + "@next/bundle-analyzer": "^12.1.1", + "@vercel/analytics": "^1.0.0", + "algoliasearch": "^4.18.0", + "animejs": "^3.2.1", + "aos": "^3.0.0-beta.6", + "axios": ">=0.21.1", + "copy-to-clipboard": "^3.3.1", + "feed": "^4.2.2", + "js-md5": "^0.7.3", + "localStorage": "^1.0.4", + "lodash.throttle": "^4.1.1", + "memory-cache": "^0.2.0", + "mongodb": "^4.6.0", + "next": "13.3.1", + "notion-client": "6.15.6", + "notion-utils": "6.15.6", + "nprogress": "^0.2.0", + "preact": "^10.5.15", + "prism-themes": "1.9.0", + "react": "^18.2.0", + "react-cookies": "^0.1.1", + "react-dom": "^18.2.0", + "react-facebook": "^8.1.4", + "react-notion-x": "6.16.0", + "react-share": "^4.4.1", + "react-tweet-embed": "~2.0.0", + "typed.js": "^2.0.12" + }, + "devDependencies": { + "@waline/client": "^2.5.1", + "autoprefixer": "^10.4.13", + "eslint": "^7.26.0", + "eslint-config-next": "^13.1.1", + "eslint-config-standard": "^16.0.2", + "eslint-plugin-import": "^2.23.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-react": "^7.23.2", + "eslint-plugin-react-hooks": "^4.6.0", + "next-sitemap": "^1.6.203", + "postcss": "^8.4.31", + "prettier": "3.2.5", + "tailwindcss": "^3.3.2", + "webpack-bundle-analyzer": "^4.5.0" + }, + "resolutions": { + "axios": ">=0.21.1" + }, + "bugs": { + "url": "https://github.com/tangly/NotionNext/issues", + "email": "tlyong1992@hotmail.com" + } +} \ No newline at end of file diff --git a/pages/_document.js b/pages/_document.js index 1acc1b6c..b2649d79 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -28,7 +28,7 @@ class MyDocument extends Document { })} - +
diff --git a/themes/example/components/BlogPostCard.js b/themes/example/components/BlogPostCard.js index a8783f8c..b66dcca3 100644 --- a/themes/example/components/BlogPostCard.js +++ b/themes/example/components/BlogPostCard.js @@ -4,6 +4,7 @@ import Link from 'next/link' import TwikooCommentCount from '@/components/TwikooCommentCount' import LazyImage from '@/components/LazyImage' import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' +import NotionIcon from '@/components/NotionIcon' const BlogPostCard = ({ post }) => { const showPageCover = siteConfig('EXAMPLE_POST_LIST_COVER', null, CONFIG) && post?.pageCoverThumbnail @@ -15,16 +16,18 @@ const BlogPostCard = ({ post }) => { - {post?.title} + {post?.title}
by {siteConfig('AUTHOR')} on {post.date?.start_date || post.createdTime} + {post.category && <> | {post.category} - {/* | */} + } + {/* | */} {/* 2 Comments */}
diff --git a/themes/example/components/Title.js b/themes/example/components/Title.js index 5c251b0d..73ca9d7f 100644 --- a/themes/example/components/Title.js +++ b/themes/example/components/Title.js @@ -1,3 +1,4 @@ +import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' /** @@ -11,7 +12,7 @@ export const Title = (props) => { const description = post?.description || siteConfig('AUTHOR') return
-

{title}

+

{title}

{description}

diff --git a/themes/fukasawa/components/ArticleDetail.js b/themes/fukasawa/components/ArticleDetail.js index 1b9076a4..fb038e3d 100644 --- a/themes/fukasawa/components/ArticleDetail.js +++ b/themes/fukasawa/components/ArticleDetail.js @@ -9,6 +9,7 @@ import { AdSlot } from '@/components/GoogleAdsense' import LazyImage from '@/components/LazyImage' import { formatDateFmt } from '@/lib/formatDate' import WWAds from '@/components/WWAds' +import NotionIcon from '@/components/NotionIcon' /** * @@ -36,7 +37,7 @@ export default function ArticleDetail(props) { {/* 文章Title */}
- {post.title} + {post.title}
diff --git a/themes/fukasawa/components/BlogCard.js b/themes/fukasawa/components/BlogCard.js index 6c85bfc8..d54daaba 100644 --- a/themes/fukasawa/components/BlogCard.js +++ b/themes/fukasawa/components/BlogCard.js @@ -4,6 +4,7 @@ import TagItemMini from './TagItemMini' import CONFIG from '../config' import LazyImage from '@/components/LazyImage' import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' +import NotionIcon from '@/components/NotionIcon' /** * 文章列表卡片 @@ -32,7 +33,7 @@ const BlogCard = ({ index, post, showSummary, siteInfo }) => { const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}` return ( -
@@ -51,16 +52,18 @@ const BlogCard = ({ index, post, showSummary, siteInfo }) => { {/* 文字部分 */}
- - {post.title} - +

+ + {post.title} + +

{(!showPreview || showSummary) && ( -

+

{post.summary} -

+
)} {/* 分类标签 */} @@ -83,7 +86,7 @@ const BlogCard = ({ index, post, showSummary, siteInfo }) => {
-
+ ) } diff --git a/themes/fukasawa/components/MenuItemCollapse.js b/themes/fukasawa/components/MenuItemCollapse.js index 8251f3c7..f854c16f 100644 --- a/themes/fukasawa/components/MenuItemCollapse.js +++ b/themes/fukasawa/components/MenuItemCollapse.js @@ -44,7 +44,7 @@ export const MenuItemCollapse = (props) => {
{link.name}
} - f + {/* 折叠子菜单 */} {hasSubMenu && diff --git a/themes/gitbook/components/BlogPostCard.js b/themes/gitbook/components/BlogPostCard.js index a177b700..891e3ea7 100644 --- a/themes/gitbook/components/BlogPostCard.js +++ b/themes/gitbook/components/BlogPostCard.js @@ -2,6 +2,7 @@ import { siteConfig } from '@/lib/config' import Link from 'next/link' import { useRouter } from 'next/router' import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' +import NotionIcon from '@/components/NotionIcon' const BlogPostCard = ({ post, className }) => { const router = useRouter() @@ -9,8 +10,8 @@ const BlogPostCard = ({ post, className }) => { const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}` return (
-
- {post.title} +
+ {post.title}
diff --git a/themes/gitbook/components/MenuItemDrop.js b/themes/gitbook/components/MenuItemDrop.js index c3636ba0..572c9b22 100644 --- a/themes/gitbook/components/MenuItemDrop.js +++ b/themes/gitbook/components/MenuItemDrop.js @@ -4,8 +4,6 @@ import { useRouter } from 'next/router' export const MenuItemDrop = ({ link }) => { const [show, changeShow] = useState(false) - // const show = true - // const changeShow = () => {} const router = useRouter() if (!link || !link.show) { @@ -13,7 +11,6 @@ export const MenuItemDrop = ({ link }) => { } const hasSubMenu = link?.subMenus?.length > 0 const selected = (router.pathname === link.to) || (router.asPath === link.to) - return
  • changeShow(true)} onMouseOut={() => changeShow(false)} > {hasSubMenu && diff --git a/themes/gitbook/index.js b/themes/gitbook/index.js index b141252a..cd4f2207 100644 --- a/themes/gitbook/index.js +++ b/themes/gitbook/index.js @@ -33,6 +33,7 @@ import BlogArchiveItem from './components/BlogArchiveItem' import Link from 'next/link' import dynamic from 'next/dynamic' import { siteConfig } from '@/lib/config' +import NotionIcon from '@/components/NotionIcon' const WWAds = dynamic(() => import('@/components/WWAds'), { ssr: false }) // 主题全局变量 @@ -219,7 +220,7 @@ const LayoutSlug = (props) => { {!lock &&
    {/* title */} -

    {post?.title}

    +

    {post?.title}

    {/* Notion文章主体 */} {post && (
    diff --git a/themes/heo/components/BlogPostCard.js b/themes/heo/components/BlogPostCard.js index fa16fc25..b07fa06c 100644 --- a/themes/heo/components/BlogPostCard.js +++ b/themes/heo/components/BlogPostCard.js @@ -4,6 +4,7 @@ import TagItemMini from './TagItemMini' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' +import NotionIcon from '@/components/NotionIcon' const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { const showPreview = siteConfig('HEO_POST_LIST_PREVIEW', null, CONFIG) && post.blockMap @@ -13,7 +14,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { const showPageCover = siteConfig('HEO_POST_LIST_COVER', null, CONFIG) && post?.pageCoverThumbnail && !showPreview const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}` return ( -
    +
    { {/* 文字区块 */}
    -
    +
    {/* 分类 */} {post?.category && +
    {/* 摘要 */} {(!showPreview || showSummary) && ( -

    +

    {post.summary} -

    +
    )}
    @@ -70,7 +71,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
    -
    +
    ) } diff --git a/themes/heo/components/TagGroups.js b/themes/heo/components/TagGroups.js index 7c8ae0e6..34bf1839 100644 --- a/themes/heo/components/TagGroups.js +++ b/themes/heo/components/TagGroups.js @@ -1,4 +1,5 @@ import Link from 'next/link' +import { useRouter } from 'next/router' /** * 标签组 @@ -8,22 +9,34 @@ import Link from 'next/link' * @constructor */ const TagGroups = ({ tags, className }) => { + const router = useRouter() + const { tag: currentTag } = router.query if (!tags) return <> - return ( -
    - { - tags.map((tag, index) => { - return -
    -
    {tag.name}
    {tag.count ? {tag.count} : <>} -
    + return ( +
    + {tags.map((tag, index) => { + const selected = currentTag === tag.name + return ( + +
    +
    {tag.name}
    + {tag.count + ? ( + {tag.count} + ) + : ( + <> + )} +
    - }) - } + ) + })}
    ) } diff --git a/themes/hexo/components/BlogPostCardInfo.js b/themes/hexo/components/BlogPostCardInfo.js index 890952d5..6ab5eda7 100644 --- a/themes/hexo/components/BlogPostCardInfo.js +++ b/themes/hexo/components/BlogPostCardInfo.js @@ -5,6 +5,7 @@ import TwikooCommentCount from '@/components/TwikooCommentCount' import { siteConfig } from '@/lib/config' import { formatDateFmt } from '@/lib/formatDate' import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' +import NotionIcon from '@/components/NotionIcon' /** * 博客列表的文字内容 @@ -13,58 +14,63 @@ import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' */ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary }) => { const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}` - return
    + return
    - {/* 标题 */} - +
    +

    + {/* 标题 */} + - {post.title} + {post.title} - + +

    - {/* 分类 */} - { post?.category &&
    - + {/* 分类 */} + { post?.category &&
    + - - {post.category} + + {post.category} - + - -
    } + +
    } +
    - {/* 摘要 */} - {(!showPreview || showSummary) && !post.results && ( -

    + {/* 摘要 */} + {(!showPreview || showSummary) && !post.results && ( +

    {post.summary} -

    - )} +
    + )} - {/* 搜索结果 */} - {post.results && ( -

    - {post.results.map((r, index) => ( - {r} - ))} -

    - )} - {/* 预览 */} - {showPreview && ( -
    - -
    - )} + {/* 搜索结果 */} + {post.results && ( +

    + {post.results.map((r, index) => ( + {r} + ))} +

    + )} + + {/* 预览 */} + {showPreview && ( +
    + +
    + )}
    @@ -92,5 +98,5 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary
    -
    + } diff --git a/themes/landing/components/Features.js b/themes/landing/components/Features.js index c0e403b5..c576fd3a 100644 --- a/themes/landing/components/Features.js +++ b/themes/landing/components/Features.js @@ -25,7 +25,7 @@ export default function Features() {
    {/* Section background (needs .relative class on parent and next sibling elements) */} - +
    @@ -33,8 +33,8 @@ export default function Features() { {/* Section header */}
    -

    {siteConfig('LANDING_FEATURES_HEADER_1', null, CONFIG)}

    -

    +

    {siteConfig('LANDING_FEATURES_HEADER_1', null, CONFIG)}

    +

    {/* Section content */} @@ -43,8 +43,8 @@ export default function Features() { {/* Content */}
    -

    {siteConfig('LANDING_FEATURES_HEADER_2', null, CONFIG)}

    -

    {siteConfig('LANDING_FEATURES_HEADER_2_P', null, CONFIG)}

    +

    {siteConfig('LANDING_FEATURES_HEADER_2', null, CONFIG)}

    +

    {siteConfig('LANDING_FEATURES_HEADER_2_P', null, CONFIG)}

    {/* Tabs buttons */}
    diff --git a/themes/landing/components/FeaturesBlocks.js b/themes/landing/components/FeaturesBlocks.js index 07e63e50..fd3068b6 100644 --- a/themes/landing/components/FeaturesBlocks.js +++ b/themes/landing/components/FeaturesBlocks.js @@ -6,7 +6,7 @@ export default function FeaturesBlocks() {
    {/* Section background (needs .relative class on parent and next sibling elements) */} - +
    @@ -14,15 +14,15 @@ export default function FeaturesBlocks() { {/* Section header */}
    -

    {siteConfig('LANDING_FEATURES_BLOCK_HEADER', null, CONFIG)}

    -

    +

    {siteConfig('LANDING_FEATURES_BLOCK_HEADER', null, CONFIG)}

    +

    {/* Items */}
    {/* 1st item */} -
    +
    @@ -39,7 +39,7 @@ export default function FeaturesBlocks() {
    {/* 2nd item */} -
    +
    @@ -55,7 +55,7 @@ export default function FeaturesBlocks() {
    {/* 3rd item */} -
    +
    @@ -72,7 +72,7 @@ export default function FeaturesBlocks() {
    {/* 4th item */} -
    +
    @@ -89,7 +89,7 @@ export default function FeaturesBlocks() {
    {/* 5th item */} -
    +
    @@ -105,7 +105,7 @@ export default function FeaturesBlocks() {
    {/* 6th item */} -
    +
    diff --git a/themes/landing/components/Footer.js b/themes/landing/components/Footer.js index 63c3a8a7..2673aa38 100644 --- a/themes/landing/components/Footer.js +++ b/themes/landing/components/Footer.js @@ -149,6 +149,11 @@ export default function Footer() { {/* Social as */}
  • + ) diff --git a/themes/matery/components/PostHeader.js b/themes/matery/components/PostHeader.js index 56f8e541..9279b78c 100644 --- a/themes/matery/components/PostHeader.js +++ b/themes/matery/components/PostHeader.js @@ -1,4 +1,5 @@ import LazyImage from '@/components/LazyImage' +import NotionIcon from '@/components/NotionIcon' /** * 文章背景图 @@ -9,7 +10,7 @@ export default function PostHeader({ post, siteInfo }) { return ( )} - + ) } diff --git a/themes/nav/components/MenuItem.js b/themes/nav/components/MenuItem.js index 539a9222..d44f8b17 100644 --- a/themes/nav/components/MenuItem.js +++ b/themes/nav/components/MenuItem.js @@ -22,7 +22,7 @@ export const MenuItem = ({ link }) => { // #号加标题 快速跳转到指定锚点 const isAnchor = link?.to === '#' - const url = isAnchor ? link.to : `#${link.name}` + const url = isAnchor ? `#${link.name}` : link.to return <> {/* 菜单 */} @@ -33,7 +33,7 @@ export const MenuItem = ({ link }) => { {link?.subMenus ? (<> - {link?.title} + {link?.title}
    diff --git a/themes/nav/index.js b/themes/nav/index.js index b7e8b796..1e263050 100755 --- a/themes/nav/index.js +++ b/themes/nav/index.js @@ -33,6 +33,7 @@ import LogoBar from './components/LogoBar' import { siteConfig } from '@/lib/config' import Live2D from '@/components/Live2D' import BlogArchiveItem from './components/BlogArchiveItem' +import NotionIcon from '@/components/NotionIcon' const WWAds = dynamic(() => import('@/components/WWAds'), { ssr: false }) @@ -213,7 +214,6 @@ const LayoutPostList = props => { */ const LayoutSlug = (props) => { const { post, lock, validPassword } = props - return ( <> {/* 文章锁 */} @@ -222,7 +222,7 @@ const LayoutSlug = (props) => { {!lock &&
    {/* title */} -

    {post?.title}

    +

    {post?.title}

    {/* Notion文章主体 */} {post && (
    diff --git a/themes/nobelium/components/ArticleInfo.js b/themes/nobelium/components/ArticleInfo.js index 3e6a6220..b916d8cc 100644 --- a/themes/nobelium/components/ArticleInfo.js +++ b/themes/nobelium/components/ArticleInfo.js @@ -3,6 +3,7 @@ import Image from 'next/image' import TagItem from './TagItem' import md5 from 'js-md5' import { siteConfig } from '@/lib/config' +import NotionIcon from '@/components/NotionIcon' export const ArticleInfo = (props) => { const { post } = props @@ -12,9 +13,9 @@ export const ArticleInfo = (props) => { return
    -
    - {post?.title} -
    +

    + {post?.title} +

    {post?.type !== 'Page' && <>
    + +
    diff --git a/yarn.lock b/yarn.lock index 2e04c14b..1d1a0511 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4131,6 +4131,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@3.2.5: + version "3.2.5" + resolved "https://r.cnpmjs.org/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" + integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== + prism-themes@1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/prism-themes/-/prism-themes-1.9.0.tgz#19c034f3205f1e28d75d89728e54ccd745f7e3dd"