diff --git a/blog.config.js b/blog.config.js index a8a972a7..dc64824e 100644 --- a/blog.config.js +++ b/blog.config.js @@ -68,4 +68,4 @@ const BLOG = { UUID_REDIRECT: process.env.UUID_REDIRECT || false } -module.exports = BLOG +module.exports = BLOG \ No newline at end of file diff --git a/components/AlgoliaSearchModal.js b/components/AlgoliaSearchModal.js index 4a84c5aa..8b0046e7 100644 --- a/components/AlgoliaSearchModal.js +++ b/components/AlgoliaSearchModal.js @@ -3,7 +3,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import algoliasearch from 'algoliasearch' import throttle from 'lodash/throttle' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { Fragment, @@ -104,7 +104,8 @@ export default function AlgoliaSearchModal({ cRef }) { // 跳转Search结果 const onJumpSearchResult = () => { if (searchResults.length > 0) { - window.location.href = `${siteConfig('SUB_PATH', '')}/${searchResults[activeIndex].slug}` + const searchResult = searchResults[activeIndex] + window.location.href = `${siteConfig('SUB_PATH', '')}/${searchResult.slug || searchResult.objectID}` } } @@ -246,12 +247,12 @@ export default function AlgoliaSearchModal({ cRef }) { id='search-wrapper' className={`${ isModalOpen ? 'opacity-100' : 'invisible opacity-0 pointer-events-none' - } z-30 fixed h-screen w-screen left-0 top-0 sm:mt-12 flex items-start justify-center mt-0`}> + } z-30 fixed h-screen w-screen left-0 top-0 sm:mt-[10vh] flex items-start justify-center mt-0`}> {/* 模态框 */}
+ } max-h-[80vh] flex flex-col justify-between w-full min-h-[10rem] h-full md:h-fit max-w-xl dark:bg-hexo-black-gray dark:border-gray-800 bg-white dark:bg- p-5 rounded-lg z-50 shadow border hover:border-blue-600 duration-300 transition-all `}>
搜索 @@ -356,7 +357,7 @@ function TagGroups() {
{firstTenTags?.map((tag, index) => { return ( - )}
- + ) })}
diff --git a/components/ArticleExpirationNotice.js b/components/ArticleExpirationNotice.js new file mode 100644 index 00000000..ce046313 --- /dev/null +++ b/components/ArticleExpirationNotice.js @@ -0,0 +1,73 @@ +import { siteConfig } from '@/lib/config' + +/** + * 文章过期提醒组件 + * 当文章超过指定天数时显示提醒 + * @param {Object} props - 组件属性 + * @param {Object} props.post - 文章数据 + * @param {number} [props.daysThreshold=90] - 过期阈值(天) + * @returns {JSX.Element|null} + */ +export default function ArticleExpirationNotice({ + post, + daysThreshold = siteConfig('ARTICLE_EXPIRATION_DAYS', 90) +}) { + const articleExpirationEnabled = siteConfig( + 'ARTICLE_EXPIRATION_ENABLED', + false + ) + if (!articleExpirationEnabled || !post?.lastEditedDay) { + return null + } + + const postDate = new Date(post.lastEditedDay) + const today = new Date() + const diffTime = Math.abs(today - postDate) + const daysOld = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + const isVisible = daysOld >= daysThreshold + + if (!isVisible) { + return null + } + + // 使用 %%DAYS%% 作为占位符 + const articleExpirationMessage = siteConfig( + 'ARTICLE_EXPIRATION_MESSAGE', + '这篇文章发布于 %%DAYS%% 天前,内容可能已过时,请谨慎参考。' + ) + const articleExpirationMessageParts = + articleExpirationMessage.split('%%DAYS%%') + + // 直接返回 JSX 内容 + return ( +
+
+ +
+
+ {siteConfig('ARTICLE_EXPIRATION_TITLE', '温馨提醒')} +
+
+ + + {(() => { + return ( + <> + {articleExpirationMessageParts[0]} + + {daysOld} + + {articleExpirationMessageParts[1]} + + ) + })()} + +
+
+
+
+ ) +} diff --git a/components/CustomContextMenu.js b/components/CustomContextMenu.js index 19b65395..7475bbed 100644 --- a/components/CustomContextMenu.js +++ b/components/CustomContextMenu.js @@ -2,7 +2,7 @@ import useWindowSize from '@/hooks/useWindowSize' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { THEMES, saveDarkModeToLocalStorage } from '@/themes/theme' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useLayoutEffect, useRef, useState } from 'react' @@ -198,23 +198,23 @@ export default function CustomContextMenu(props) { )} {CUSTOM_RIGHT_CLICK_CONTEXT_MENU_CATEGORY && ( -
{locale.MENU.CATEGORY}
- + )} {CUSTOM_RIGHT_CLICK_CONTEXT_MENU_TAG && ( -
{locale.MENU.TAGS}
- + )}
diff --git a/components/NotByAI.js b/components/NotByAI.js new file mode 100644 index 00000000..b8c99e0a --- /dev/null +++ b/components/NotByAI.js @@ -0,0 +1,66 @@ +import { useGlobal } from '@/lib/global' + +const LANGS = { + 'en-US': 'en', + 'zh-CN': 'zh', + 'zh-HK': 'zh-HK', + 'zh-TW': 'zh-TW', + 'fr-FR': 'fr', + 'tr-TR': 'tr', + 'ja-JP': 'ja' +} + +/** + * 获取当前not-by-ai文件路径 + * 如果匹配到完整的“国家-地区”语言,则显示国家的语言 + * @returns string + */ +export function generateNotByAiPath(langString) { + const supportedLocales = Object.keys(LANGS) + let userLocale + + // 将语言字符串拆分为语言和地区代码,例如将 "zh-CN" 拆分为 "zh" 和 "CN" + const [language, region] = langString?.split(/[-_]/) + + // 优先匹配语言和地区都匹配的情况 + const specificLocale = `${language}-${region}` + if (supportedLocales.includes(specificLocale)) { + userLocale = LANGS[specificLocale] + } + + // 然后尝试匹配只有语言匹配的情况 + if (!userLocale) { + const languageOnlyLocales = supportedLocales.filter(locale => + locale.startsWith(language) + ) + if (languageOnlyLocales.length > 0) { + userLocale = LANGS[languageOnlyLocales[0]] + } + } + + // 如果还没匹配到,则返回最接近的 + if (!userLocale) { + const fallbackLocale = supportedLocales.find(locale => + locale.startsWith('en') + ) + userLocale = LANGS[fallbackLocale] + } + + return userLocale ?? 'zh' +} + +/** + * 版权声明 + * @returns + */ +export default function NotByAI() { + const { lang, isDarkMode } = useGlobal() + + return ( + not-by-ai + ) +} diff --git a/components/Player.js b/components/Player.js index 91fef339..11adef01 100644 --- a/components/Player.js +++ b/components/Player.js @@ -64,7 +64,7 @@ const Player = () => { {meting ? ( 标签不能识别的 props +const filterDOMProps = props => { + const { passHref, legacyBehavior, ...rest } = props + return rest +} + +const SmartLink = ({ href, children, ...rest }) => { + const LINK = siteConfig('LINK') + + // 获取 URL 字符串用于判断是否是外链 + let urlString = '' + + if (typeof href === 'string') { + urlString = href + } else if ( + typeof href === 'object' && + href !== null && + typeof href.pathname === 'string' + ) { + urlString = href.pathname + } + + const isExternal = urlString.startsWith('http') && !urlString.startsWith(LINK) + + if (isExternal) { + // 对于外部链接,必须是 string 类型 + const externalUrl = + typeof href === 'string' ? href : new URL(href.pathname, LINK).toString() + + return ( + + {children} + + ) + } + + // 内部链接(可为对象形式) + return ( + + {children} + + ) +} + +export default SmartLink diff --git a/components/ui/dashboard/DashboardButton.js b/components/ui/dashboard/DashboardButton.js index ff866a5f..fd61b5ee 100644 --- a/components/ui/dashboard/DashboardButton.js +++ b/components/ui/dashboard/DashboardButton.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** * 跳转仪表盘的按钮 @@ -24,7 +24,7 @@ export default function DashboardButton({ className }) { ) } diff --git a/components/ui/dashboard/DashboardHeader.js b/components/ui/dashboard/DashboardHeader.js index f564374f..ae49dbd3 100644 --- a/components/ui/dashboard/DashboardHeader.js +++ b/components/ui/dashboard/DashboardHeader.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import { useGlobal } from '@/lib/global' import formatDate from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import DashboardSignOutButton from './DashboardSignOutButton' /** @@ -25,11 +25,11 @@ export default function DashboardHeader() {
{user?.fullName} - + 普通用户 - +
{user?.username} diff --git a/components/ui/dashboard/DashboardItemAffliate.js b/components/ui/dashboard/DashboardItemAffliate.js index 443e0ac7..21adcf01 100644 --- a/components/ui/dashboard/DashboardItemAffliate.js +++ b/components/ui/dashboard/DashboardItemAffliate.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 联盟行销 @@ -140,11 +140,11 @@ export default function DashboardItemAffliate() { for='remember' className='ms-2 text-sm font-medium text-gray-900 dark:text-gray-300'> 我以阅读并同意{' '} - 服务协议 - + .
diff --git a/components/ui/dashboard/DashboardMenuList.js b/components/ui/dashboard/DashboardMenuList.js index b0ffed2a..53c51066 100644 --- a/components/ui/dashboard/DashboardMenuList.js +++ b/components/ui/dashboard/DashboardMenuList.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 仪表盘菜单 @@ -43,12 +43,12 @@ export default function DashboardMenuList() { className={`rounded-lg cursor-pointer block ${ isActive ? 'bg-blue-100 text-blue-600' : 'hover:bg-gray-100' }`}> - {item.title} - + ) })} diff --git a/conf/post.config.js b/conf/post.config.js index 3e7a4ff3..1922196c 100644 --- a/conf/post.config.js +++ b/conf/post.config.js @@ -28,6 +28,16 @@ module.exports = { POST_RECOMMEND_COUNT: process.env.NEXT_PUBLIC_POST_RECOMMEND_COUNT || 6, // 推荐文章数量 POSTS_PER_PAGE: process.env.NEXT_PUBLIC_POST_PER_PAGE || 12, // post counts per page POSTS_SORT_BY: process.env.NEXT_PUBLIC_POST_SORT_BY || 'notion', // 排序方式 'date'按时间,'notion'由notion控制 + + // 文章过期提醒配置 p.s. 目前此功能暂时只适用于heo主题 + ARTICLE_EXPIRATION_DAYS: + process.env.NEXT_PUBLIC_ARTICLE_EXPIRATION_DAYS || 90, // 文章过期提醒阈值(天) + ARTICLE_EXPIRATION_MESSAGE: + process.env.NEXT_PUBLIC_ARTICLE_EXPIRATION_MESSAGE || + '这篇文章发布于 %%DAYS%% 天前,内容可能已过时,请谨慎参考。', // 过期提示信息,使用 %%DAYS%% 作为天数占位符 + ARTICLE_EXPIRATION_ENABLED: + process.env.NEXT_PUBLIC_ARTICLE_EXPIRATION_ENABLED || 'false', // 是否启用文章过期提醒 + POST_WAITING_TIME_FOR_404: process.env.NEXT_PUBLIC_POST_WAITING_TIME_FOR_404 || '8', // 文章加载超时时间,单位秒;超时后跳转到404页面 diff --git a/conf/widget.config.js b/conf/widget.config.js index d20182ae..4e207451 100644 --- a/conf/widget.config.js +++ b/conf/widget.config.js @@ -32,7 +32,7 @@ module.exports = { MUSIC_PLAYER_LRC_TYPE: process.env.NEXT_PUBLIC_MUSIC_PLAYER_LRC_TYPE || '0', // 歌词显示类型,可选值: 3 | 1 | 0(0:禁用 lrc 歌词,1:lrc 格式的字符串,3:lrc 文件 url)(前提是有配置歌词路径,对 meting 无效) MUSIC_PLAYER_CDN_URL: process.env.NEXT_PUBLIC_MUSIC_PLAYER_CDN_URL || - 'https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.js', + 'https://cdn.jsdelivr.net/npm/aplayer@1.10.0/dist/APlayer.min.js', MUSIC_PLAYER_ORDER: process.env.NEXT_PUBLIC_MUSIC_PLAYER_ORDER || 'list', // 默认播放方式,顺序 list,随机 random MUSIC_PLAYER_AUDIO_LIST: [ // 示例音乐列表。除了以下配置外,还可配置歌词,具体配置项看此文档 https://aplayer.js.org/#/zh-Hans/ diff --git a/lib/config.js b/lib/config.js index 54b043a7..81ff88e3 100644 --- a/lib/config.js +++ b/lib/config.js @@ -2,7 +2,7 @@ import BLOG from '@/blog.config' import { useGlobal } from './global' -import { deepClone, isUrl } from './utils' +import { deepClone, isUrlLikePath } from './utils' /** * 读取配置顺序 @@ -146,7 +146,7 @@ export const convertVal = val => { } // 检测是否为 URL - if (isUrl(val)) { + if (isUrlLikePath(val)) { return val } diff --git a/lib/db/getSiteData.js b/lib/db/getSiteData.js index c9e3a9d4..95aec436 100755 --- a/lib/db/getSiteData.js +++ b/lib/db/getSiteData.js @@ -840,4 +840,4 @@ export function getNavPages({ allPages }) { publishDate: item.publishDate, ext: item.ext || {} })) -} +} \ No newline at end of file diff --git a/lib/global.js b/lib/global.js index b5d76d83..3298fa4d 100644 --- a/lib/global.js +++ b/lib/global.js @@ -31,6 +31,7 @@ export function GlobalContextProvider(props) { ) // 默认语言 const [theme, setTheme] = useState(NOTION_CONFIG?.THEME || THEME) // 默认博客主题 const [THEME_CONFIG, SET_THEME_CONFIG] = useState(null) // 主题配置 + const [isLiteMode,setLiteMode] = useState(false) const defaultDarkMode = NOTION_CONFIG?.APPEARANCE || APPEARANCE const [isDarkMode, updateDarkMode] = useState(defaultDarkMode === 'dark') // 默认深色模式 @@ -85,10 +86,17 @@ export function GlobalContextProvider(props) { // 添加路由变化时的语言处理 useEffect(() => { initLocale(router.locale, changeLang, updateLocale) - }, [router]) + // 处理极简模式 + if (router.query.lite && router.query.lite==='true') { + setLiteMode(true) + } +}, [router]) + + // 首次加载成功 useEffect(() => { initDarkMode(updateDarkMode, defaultDarkMode) + // 处理多语言自动重定向 if ( NOTION_CONFIG?.REDIRECT_LANG && JSON.parse(NOTION_CONFIG?.REDIRECT_LANG) @@ -107,6 +115,7 @@ export function GlobalContextProvider(props) { const newUrl = `${url}${url.includes('?') ? '&' : '?'}theme=${themeStr}` router.push(newUrl) } + if (!onLoading) { setOnLoading(true) } @@ -134,6 +143,7 @@ export function GlobalContextProvider(props) { return ( { + const value = item[0] + const decorations = item[1] + + if (value === '⁍') { + // 检查是否有公式 + const equation = decorations?.find(d => d[0] === 'e') + if (equation) { + return result + equation[1] // 提取 LaTeX 内容 + } + return result // 否则什么都不加 + } + + if (value === '‣') { + const ref = Array.isArray(decorations) ? decorations[0] : null + const type = ref?.[0] + const data = ref?.[1] + // todo: 处理更多类型 https://github.com/NotionX/react-notion-x/blob/9ee2d9334e260ee3600f4f8d7212f66b641b19cc/packages/notion-types/src/core.ts#L108 + switch (type) { + case 'd': + // 日期字符串 + const date = + data?.start_date || + data?.start_time || + data?.end_date || + data?.end_time || + '[Date]' + return result + date + case 'lm': + // Link Mention + const title = data?.title || data?.href || '[Link]' + return result + title + // 用户 ID,这里不展开,默认忽略或标记 + case 'u': + default: + return result + } + } + + // 默认拼接普通文本 + return result + value + }, '') +} + +export function getPageContentText(post, pageBlockMap) { + /** + * 将对象的指定字段拼接到字符串 + * @param block + * @param customKeys 优先级字段名列表 + * @returns string + */ + function getText(block, customKeys = ['title', 'caption']) { + const result = [] + const properties = block.properties + if (!properties) { + return '' + } + const textArray = getPropertyValue(properties, customKeys) + result.push(getTextArray(textArray)) + if (block.type !== 'page' && block['content']?.length > 0) { + for (const blockContent of block.content) { + result.push(getBlockContentText(blockContent)) + } + } + return result.join(' ') + } + + function getTextArray(textArray) { + const text = textArray ? getFullTextContent(textArray) : '' + if (text && text !== 'Untitled') { + return text + } + return '' + } + + function getTransclusionReference(block) { + const result = [] + const blockPointer = block.format.transclusion_reference_pointer + const blockPointerId = blockPointer.id + if (blockPointer && pageBlockMap.block[blockPointerId].value) { + const blockContentList = pageBlockMap.block[blockPointerId].value.content + for (const blockContent of blockContentList) { + result.push(getBlockContentText(blockContent)) + } + } + return result.join(' ') + } + + function getBlockContentText(id) { + const block = pageBlockMap?.block[id]?.value + if (!block) { + return '' + } + const blockType = block.type + // todo: 处理更多类型 https://github.com/NotionX/react-notion-x/blob/9ee2d9334e260ee3600f4f8d7212f66b641b19cc/packages/notion-types/src/block.ts#L3 + switch (blockType) { + case 'transclusion_reference': + return getTransclusionReference(block) + case 'table': + return getTableText(block.content) + case 'page': + if (id !== postId) { + return getText(block) + } + return '' + case 'breadcrumb': + case 'external_object_instance': + case 'divider': + return '' + case 'image': + return getText(block, ['alt_text', 'title']) + // 除title以外,还有额外的link和description可供索引,但认为不需要 + case 'bookmark': + case 'quote': + case 'callout': + case 'header': + case 'sub_header': + case 'code': + case 'equation': + case 'text': + default: + return getText(block) + } + } + + function getTableText(tableRowIds) { + const result = [] + for (const blockRowId of tableRowIds) { + if (pageBlockMap.block[blockRowId]) { + const blockRow = pageBlockMap.block[blockRowId].value + const blockRowProperties = blockRow.properties + for (const blockRowPropertyValue of Object.values(blockRowProperties)) { + result.push(getTextArray(blockRowPropertyValue)) + } + } + } + return result.join(' ') + } + + const postId = post.id + const postContent = post.content + let contentTextList = [] + // 防止搜到加密文章的内容 + if (postContent && postContent.length > 0 && !post.password) { + for (const postContentId of postContent) { + const blockContentText = getBlockContentText(postContentId) + if (blockContentText) { + contentTextList.push(blockContentText) + } + } + } + // console.log('开始', contentTextList.join(''), '结束') + return contentTextList.join('') +} diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js index 571c1b8c..29bb5472 100644 --- a/lib/notion/getPageProperties.js +++ b/lib/notion/getPageProperties.js @@ -4,11 +4,7 @@ import formatDate from '../utils/formatDate' // import { createHash } from 'crypto' import md5 from 'js-md5' import { siteConfig } from '../config' -import { - checkStartWithHttp, - convertUrlStartWithOneSlash, - getLastSegmentFromUrl -} from '../utils' +import { convertUrlStartWithOneSlash, getLastSegmentFromUrl, isHttpLink, isMailOrTelLink } from '../utils' import { extractLangPrefix } from '../utils/pageId' import { mapImgUrl } from './mapImage' import notionAPI from '@/lib/notion/getNotionAPI' @@ -85,8 +81,9 @@ export default async function getPageProperties( const fieldNames = BLOG.NOTION_PROPERTY_NAME if (fieldNames) { Object.keys(fieldNames).forEach(key => { - if (fieldNames[key] && properties[fieldNames[key]]) + if (fieldNames[key] && properties[fieldNames[key]]) { properties[key] = properties[fieldNames[key]] + } }) } @@ -190,9 +187,12 @@ export function adjustPageProperties(properties, NOTION_CONFIG) { } // http or https 开头的视为外链 - if (checkStartWithHttp(properties?.href)) { + if (isHttpLink(properties?.href)) { properties.href = properties?.slug properties.target = '_blank' + } else if (isMailOrTelLink(properties?.href)) { + properties.href = properties?.slug + properties.target = '_self' } else { properties.target = '_self' // 伪静态路径右侧拼接.html @@ -238,7 +238,7 @@ export function adjustPageProperties(properties, NOTION_CONFIG) { */ function generateCustomizeSlug(postProperties, NOTION_CONFIG) { // 外链不处理 - if (checkStartWithHttp(postProperties.slug)) { + if (isHttpLink(postProperties.slug)) { return postProperties.slug } let fullPrefix = '' diff --git a/lib/notion/mapImage.js b/lib/notion/mapImage.js index 85ed4e30..bd816954 100644 --- a/lib/notion/mapImage.js +++ b/lib/notion/mapImage.js @@ -119,10 +119,19 @@ const compressImage = (image, width, quality = 50, fmt = 'webp') => { width = siteConfig('IMAGE_COMPRESS_WIDTH') } - // 将URL解析为一个对象 - const urlObj = new URL(image) - // 获取URL参数 - const params = new URLSearchParams(urlObj.search) + + let urlObj + let params + try { + // 将URL解析为一个对象 + urlObj = new URL(image) + // 获取URL参数 + params = new URLSearchParams(urlObj.search) + } catch (err) { + // 捕获异常并打印错误的url + console.error('compressImage: Invalid URL:', image, err) + return image + } // Notion图床 if ( diff --git a/lib/plugins/aiSummary.js b/lib/plugins/aiSummary.js index 336b9954..67021c64 100644 --- a/lib/plugins/aiSummary.js +++ b/lib/plugins/aiSummary.js @@ -27,6 +27,6 @@ export async function getAiSummary(aiSummaryAPI, aiSummaryKey, truncatedText) { } } catch (error) { console.error('ChucklePostAI:请求失败', error) - return '获取文章摘要失败,请稍后再试。' + return null } } diff --git a/lib/plugins/algolia.js b/lib/plugins/algolia.js index e6c76422..acf3cabb 100644 --- a/lib/plugins/algolia.js +++ b/lib/plugins/algolia.js @@ -1,6 +1,31 @@ import BLOG from '@/blog.config' -import { getPageContentText } from '@/pages/search/[keyword]' import algoliasearch from 'algoliasearch' +import { getPageContentText } from '@/lib/notion/getPageContentText' + +// 全局初始化 Algolia 客户端和索引 +let algoliaClient +let algoliaIndex + +const initAlgolia = () => { + if (!algoliaClient) { + if ( + !BLOG.ALGOLIA_APP_ID || + !BLOG.ALGOLIA_ADMIN_APP_KEY || + !BLOG.ALGOLIA_INDEX + ) { + console.error('Algolia configuration is missing') + } + algoliaClient = algoliasearch( + BLOG.ALGOLIA_APP_ID, + BLOG.ALGOLIA_ADMIN_APP_KEY + ) + algoliaIndex = algoliaClient.initIndex(BLOG.ALGOLIA_INDEX) + } + return { client: algoliaClient, index: algoliaIndex } +} + +// 初始化全局实例 +initAlgolia() /** * 生成全文索引 @@ -15,17 +40,57 @@ const generateAlgoliaSearch = ({ allPages, force = false }) => { }) } +/** + * 检查数据是否需要从algolia删除 + * @param {*} props + */ +export const checkDataFromAlgolia = async props => { + const { allPages } = props + const deletions = (allPages || []) + .map(p => { + if (p && (p.password || p.status === 'Draft')) { + return deletePostDataFromAlgolia(p) + } + }) + .filter(Boolean) // 去除 undefined + await Promise.all(deletions) +} + +/** + * 删除数据 + * @param post + */ +const deletePostDataFromAlgolia = async post => { + if (!post) { + return + } + + // 检查是否有索引 + let existed + try { + existed = await algoliaIndex.getObject(post.id) + } catch (error) { + // 通常是不存在索引 + } + + if (existed) { + await algoliaIndex + .deleteObject(post.id) + .wait() + .then(r => { + console.log('Algolia索引删除成功', r) + }) + .catch(err => { + console.log('Algolia异常', err) + }) + } +} + /** * 上传数据 * 根据上次修改文章日期和上次更新索引数据判断是否需要更新algolia索引 */ const uploadDataToAlgolia = async post => { - // Connect and authenticate with your Algolia app - const client = algoliasearch(BLOG.ALGOLIA_APP_ID, BLOG.ALGOLIA_ADMIN_APP_KEY) - - // Create a new index and add a record - const index = client.initIndex(BLOG.ALGOLIA_INDEX) - if (!post) { return } @@ -34,7 +99,7 @@ const uploadDataToAlgolia = async post => { let existed let needUpdateIndex = false try { - existed = await index.getObject(post.id) + existed = await algoliaIndex.getObject(post.id) } catch (error) { // 通常是不存在索引 } @@ -64,7 +129,7 @@ const uploadDataToAlgolia = async post => { content: truncate(getPageContentText(post, post.blockMap), 8192) // 索引8192个字符,API限制总请求内容上限1万个字节 } // console.log('更新Algolia索引', record) - index + algoliaIndex .saveObject(record) .wait() .then(r => { diff --git a/lib/utils/index.js b/lib/utils/index.js index e12f2f85..b0e0c77e 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -80,28 +80,31 @@ export function convertUrlStartWithOneSlash(str) { } /** - * 是否是一个相对或绝对路径的ur类 - * @param {*} str - * @returns + * 判断是否是一个“URL 样式”的路径(内部或外部) + * 内部如 /about,外部如 http://xxx.com + * @param str + * @returns {boolean} */ -export function isUrl(str) { - if (!str) { - return false - } - - return str?.indexOf('/') === 0 || checkStartWithHttp(str) +export function isUrlLikePath(str) { + return typeof str === 'string' && (str.startsWith('/') || isHttpLink(str)) } -// 检查是否外链 -export function checkStartWithHttp(str) { - // 检查字符串是否包含http - if (str?.indexOf('http:') === 0 || str?.indexOf('https:') === 0) { - // 如果包含,找到http的位置 - return true - } else { - // 不包含 - return false - } +/** + * 判断是否是 http(s) 开头的链接(外部网页) + * @param str + * @returns {boolean} + */ +export function isHttpLink(str) { + return typeof str === 'string' && /^https?:\/\//i.test(str) +} + +/** + * 检查是否是邮件或电话链接 + * @param href + * @returns {boolean} + */ +export function isMailOrTelLink(href) { + return /^(mailto:|tel:)/i.test(href) } // 检查一个字符串是否UUID https://ihateregex.io/expr/uuid/ diff --git a/lib/utils/post.js b/lib/utils/post.js index a3ee0f91..fb1ef075 100644 --- a/lib/utils/post.js +++ b/lib/utils/post.js @@ -1,16 +1,16 @@ /** * 文章相关工具 */ -import { checkStartWithHttp } from '.' +import { isHttpLink } from '.' import { getPostBlocks } from '@/lib/db/getSiteData' import { getPageTableOfContents } from '@/lib/notion/getPageTableOfContents' import { siteConfig } from '@/lib/config' import { getDataFromCache, setDataToCache } from '@/lib/cache/cache_manager' -import { getPageContentText } from '@/pages/search/[keyword]' import { getAiSummary } from '@/lib/plugins/aiSummary' import BLOG from '@/blog.config' import { uploadDataToAlgolia } from '@/lib/plugins/algolia' import { countWords } from '@/lib/plugins/wordCount' +import { getPageContentText } from '@/lib/notion/getPageContentText' /** * 获取文章的关联推荐文章列表,目前根据标签关联性筛选 @@ -59,7 +59,7 @@ export function checkSlugHasNoSlash(row) { } return ( (slug.match(/\//g) || []).length === 0 && - !checkStartWithHttp(slug) && + !isHttpLink(slug) && row.type.indexOf('Menu') < 0 ) } @@ -76,7 +76,7 @@ export function checkSlugHasOneSlash(row) { } return ( (slug.match(/\//g) || []).length === 1 && - !checkStartWithHttp(slug) && + !isHttpLink(slug) && row.type.indexOf('Menu') < 0 ) } @@ -94,7 +94,7 @@ export function checkSlugHasMorThanTwoSlash(row) { return ( (slug.match(/\//g) || []).length >= 2 && row.type.indexOf('Menu') < 0 && - !checkStartWithHttp(slug) + !isHttpLink(slug) ) } diff --git a/package.json b/package.json index d56e4580..00326f26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notion-next", - "version": "4.8.5", + "version": "4.8.6", "homepage": "https://github.com/tangly1024/NotionNext.git", "license": "MIT", "engines": { diff --git a/pages/index.js b/pages/index.js index b66b5610..b4b9937a 100644 --- a/pages/index.js +++ b/pages/index.js @@ -6,6 +6,7 @@ import { generateRss } from '@/lib/rss' import { generateSitemapXml } from '@/lib/sitemap.xml' import { DynamicLayout } from '@/themes/theme' import { generateRedirectJson } from '@/lib/redirect' +import { checkDataFromAlgolia } from '@/lib/plugins/algolia' /** * 首页布局 @@ -61,6 +62,8 @@ export async function getStaticProps(req) { generateRss(props) // 生成 generateSitemapXml(props) + // 检查数据是否需要从algolia删除 + checkDataFromAlgolia(props) if (siteConfig('UUID_REDIRECT', false, props?.NOTION_CONFIG)) { // 生成重定向 JSON generateRedirectJson(props) diff --git a/pages/search/[keyword]/index.js b/pages/search/[keyword]/index.js index 4116e689..cb486895 100644 --- a/pages/search/[keyword]/index.js +++ b/pages/search/[keyword]/index.js @@ -3,6 +3,7 @@ import { getDataFromCache } from '@/lib/cache/cache_manager' import { siteConfig } from '@/lib/config' import { getGlobalData } from '@/lib/db/getSiteData' import { DynamicLayout } from '@/themes/theme' +import { getPageContentText } from '@/lib/notion/getPageContentText' const Index = props => { const theme = siteConfig('THEME', BLOG.THEME, props.NOTION_CONFIG) @@ -58,50 +59,6 @@ export function getStaticPaths() { } } -/** - * 将对象的指定字段拼接到字符串 - * @param sourceTextArray - * @param targetObj - * @param key - * @returns {*} - */ -function appendText(sourceTextArray, targetObj, key) { - if (!targetObj) { - return sourceTextArray - } - const textArray = targetObj[key] - const text = textArray ? getTextContent(textArray) : '' - if (text && text !== 'Untitled') { - return sourceTextArray.concat(text) - } - return sourceTextArray -} - -/** - * 递归获取层层嵌套的数组 - * @param {*} textArray - * @returns - */ -function getTextContent(textArray) { - if (typeof textArray === 'object' && isIterable(textArray)) { - let result = '' - for (const textObj of textArray) { - result = result + getTextContent(textObj) - } - return result - } else if (typeof textArray === 'string') { - return textArray - } -} - -/** - * 对象是否可以遍历 - * @param {*} obj - * @returns - */ -const isIterable = obj => - obj != null && typeof obj[Symbol.iterator] === 'function' - /** * 在内存缓存中进行全文索引 * @param {*} allPosts @@ -124,12 +81,12 @@ async function filterByMemCache(allPosts, keyword) { : '' const articleInfo = post.title + post.summary + tagContent + categoryContent let hit = articleInfo.toLowerCase().indexOf(keyword) > -1 - const indexContent = getPageContentText(post, page) + const contentTextList = getPageContentText(post, page) // console.log('全文搜索缓存', cacheKey, page != null) post.results = [] let hitCount = 0 - for (const i of indexContent) { - const c = indexContent[i] + for (const i of contentTextList) { + const c = contentTextList[i] if (!c) { continue } @@ -151,18 +108,4 @@ async function filterByMemCache(allPosts, keyword) { return filterPosts } -export function getPageContentText(post, pageBlockMap) { - let indexContent = [] - // 防止搜到加密文章的内容 - if (pageBlockMap && pageBlockMap.block && !post.password) { - const contentIds = Object.keys(pageBlockMap.block) - contentIds.forEach(id => { - const properties = pageBlockMap?.block[id]?.value?.properties - indexContent = appendText(indexContent, properties, 'title') - indexContent = appendText(indexContent, properties, 'caption') - }) - } - return indexContent.join('') -} - export default Index diff --git a/public/images/themes-preview/typography.png b/public/images/themes-preview/typography.png new file mode 100644 index 00000000..c70f9f8a Binary files /dev/null and b/public/images/themes-preview/typography.png differ diff --git a/public/svg/not-by-ai/en/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/en/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..a9fcb382 --- /dev/null +++ b/public/svg/not-by-ai/en/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/en/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/en/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..49cac441 --- /dev/null +++ b/public/svg/not-by-ai/en/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/fr/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/fr/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..031a9abe --- /dev/null +++ b/public/svg/not-by-ai/fr/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/fr/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/fr/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..41dcd8b5 --- /dev/null +++ b/public/svg/not-by-ai/fr/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/ja/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/ja/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..0ba40b75 --- /dev/null +++ b/public/svg/not-by-ai/ja/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/ja/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/ja/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..53775d31 --- /dev/null +++ b/public/svg/not-by-ai/ja/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/tr/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/tr/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..a8fdbafe --- /dev/null +++ b/public/svg/not-by-ai/tr/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/tr/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/tr/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..4e79df1e --- /dev/null +++ b/public/svg/not-by-ai/tr/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..18c32c01 --- /dev/null +++ b/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..872377df --- /dev/null +++ b/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..18c32c01 --- /dev/null +++ b/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..872377df --- /dev/null +++ b/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/zh/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..637cc2a8 --- /dev/null +++ b/public/svg/not-by-ai/zh/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/zh/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..a0590bc8 --- /dev/null +++ b/public/svg/not-by-ai/zh/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/commerce/components/ArticleAdjacent.js b/themes/commerce/components/ArticleAdjacent.js index 21ca9e32..aaadd6d9 100644 --- a/themes/commerce/components/ArticleAdjacent.js +++ b/themes/commerce/components/ArticleAdjacent.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -12,22 +12,22 @@ export default function ArticleAdjacent ({ prev, next }) { } return (
- {prev.title} - - + {next.title} - +
) } diff --git a/themes/commerce/components/ArticleCopyright.js b/themes/commerce/components/ArticleCopyright.js index 67c65bab..be56f052 100644 --- a/themes/commerce/components/ArticleCopyright.js +++ b/themes/commerce/components/ArticleCopyright.js @@ -1,11 +1,12 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import CONFIG from '../config' import { siteConfig } from '@/lib/config' +import NotByAI from '@/components/NotByAI' -export default function ArticleCopyright () { +export default function ArticleCopyright() { const router = useRouter() const [path, setPath] = useState(siteConfig('LINK') + router.asPath) useEffect(() => { @@ -14,22 +15,24 @@ export default function ArticleCopyright () { const { locale } = useGlobal() - if (!CONFIG.ARTICLE_COPYRIGHT) { + if (!siteConfig('COMMERCE_ARTICLE_COPYRIGHT', null, CONFIG)) { return <> } return ( -
-
    +
    +
    • {locale.COMMON.AUTHOR}: - + {siteConfig('AUTHOR')} - +
    • - {locale.COMMON.URL}: - + {locale.COMMON.URL}: + {path}
    • @@ -37,7 +40,12 @@ export default function ArticleCopyright () { {locale.COMMON.COPYRIGHT}: {locale.COMMON.COPYRIGHT_NOTICE} + {siteConfig('COMMERCE_ARTICLE_NOT_BY_AI', false, CONFIG) && ( +
    • + +
    • + )}
    - ); + ) } diff --git a/themes/commerce/components/ArticleRecommend.js b/themes/commerce/components/ArticleRecommend.js index b26aace1..ebd6bc62 100644 --- a/themes/commerce/components/ArticleRecommend.js +++ b/themes/commerce/components/ArticleRecommend.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' @@ -35,7 +35,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) { : siteInfo?.pageCover return ( - (
- ) + ) ) })}
diff --git a/themes/commerce/components/BlogPostArchive.js b/themes/commerce/components/BlogPostArchive.js index 8c3fbaaf..527efb44 100644 --- a/themes/commerce/components/BlogPostArchive.js +++ b/themes/commerce/components/BlogPostArchive.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { siteConfig } from '@/lib/config' /** @@ -29,14 +29,14 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
{post.date?.start_date}{' '}   - {post.title} - +
))} diff --git a/themes/commerce/components/BlogPostCardInfo.js b/themes/commerce/components/BlogPostCardInfo.js index 8b2f4a48..4c37ee2a 100644 --- a/themes/commerce/components/BlogPostCardInfo.js +++ b/themes/commerce/components/BlogPostCardInfo.js @@ -1,5 +1,5 @@ import NotionPage from '@/components/NotionPage' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import TagItemMini from './TagItemMini' import TwikooCommentCount from '@/components/TwikooCommentCount' import { siteConfig } from '@/lib/config' @@ -14,7 +14,7 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary return
{/* 标题 */} - {post.title} - + {/* 分类 */} { post?.category &&
- @@ -37,7 +37,7 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary {post.category} - +
} @@ -70,7 +70,7 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary {/* 日期标签 */}
{/* 日期 */} - @@ -78,7 +78,7 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary {post?.publishDay || post.lastEditedDay} - +
diff --git a/themes/commerce/components/CategoryGroup.js b/themes/commerce/components/CategoryGroup.js index 0b313088..aeccc262 100644 --- a/themes/commerce/components/CategoryGroup.js +++ b/themes/commerce/components/CategoryGroup.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const CategoryGroup = ({ currentCategory, categories }) => { if (!categories) { @@ -9,7 +9,7 @@ const CategoryGroup = ({ currentCategory, categories }) => { {categories.map(category => { const selected = currentCategory === category.name return ( - {
{category.name}({category.count})
- + ); })}
diff --git a/themes/commerce/components/Footer.js b/themes/commerce/components/Footer.js index 0db4f1f7..a9a7f262 100644 --- a/themes/commerce/components/Footer.js +++ b/themes/commerce/components/Footer.js @@ -2,7 +2,7 @@ import { BeiAnGongAn } from '@/components/BeiAnGongAn' import BeiAnSite from '@/components/BeiAnSite' import CopyRightDate from '@/components/CopyRightDate' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { decryptEmail, handleEmailClick } from '@/lib/plugins/mailEncrypt' import { useRef } from 'react' @@ -47,13 +47,13 @@ const Footer = props => { className={'flex flex-col space-y-2 text-start'}> {categoryOptions?.map(category => { return ( - {category.name} - + ) })} @@ -69,13 +69,13 @@ const Footer = props => { className={'flex flex-col space-y-2 text-start'}> {customMenu?.map(menu => { return ( - {menu.name} - + ) })} diff --git a/themes/commerce/components/HexoRecentComments.js b/themes/commerce/components/HexoRecentComments.js index db712bea..f1e59612 100644 --- a/themes/commerce/components/HexoRecentComments.js +++ b/themes/commerce/components/HexoRecentComments.js @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { siteConfig } from '@/lib/config' import Card from '@/themes/hexo/components/Card' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' /** @@ -36,7 +36,7 @@ const HexoRecentComments = (props) => { {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
- --{comment.nick} + --{comment.nick}
)} diff --git a/themes/commerce/components/LatestPostsGroup.js b/themes/commerce/components/LatestPostsGroup.js index 3c4fadbc..5a702a16 100644 --- a/themes/commerce/components/LatestPostsGroup.js +++ b/themes/commerce/components/LatestPostsGroup.js @@ -2,7 +2,7 @@ import { siteConfig } from '@/lib/config' import LazyImage from '@/components/LazyImage' import { useGlobal } from '@/lib/global' // import Image from 'next/image' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -33,7 +33,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => { const headerImage = post?.pageCoverThumbnail ? post.pageCoverThumbnail : siteInfo?.pageCover return ( - ( {
- ) + ) ) })} diff --git a/themes/commerce/components/LogoBar.js b/themes/commerce/components/LogoBar.js index de5a5bfe..c3943c1d 100644 --- a/themes/commerce/components/LogoBar.js +++ b/themes/commerce/components/LogoBar.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' // import { siteConfig } from '@/lib/config' import LazyImage from '@/components/LazyImage'; @@ -11,9 +11,9 @@ export default function LogoBar (props) { const { siteInfo } = props return (
- + - + {/*
{siteConfig('TITLE')}
*/}
); diff --git a/themes/commerce/components/MenuGroupCard.js b/themes/commerce/components/MenuGroupCard.js index 63f0f48e..1733abd1 100644 --- a/themes/commerce/components/MenuGroupCard.js +++ b/themes/commerce/components/MenuGroupCard.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' const MenuGroupCard = props => { @@ -45,7 +45,7 @@ const MenuGroupCard = props => { {links.map(link => { if (link.show) { return ( - {
{link.name}
{link.slot}
- + ) } else { return null diff --git a/themes/commerce/components/MenuItemCollapse.js b/themes/commerce/components/MenuItemCollapse.js index ad8f4b93..31d0af61 100644 --- a/themes/commerce/components/MenuItemCollapse.js +++ b/themes/commerce/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -32,7 +32,7 @@ export const MenuItemCollapse = props => { className='w-full px-8 py-3 text-left dark:bg-hexo-black-gray' onClick={toggleShow}> {!hasSubMenu && ( - @@ -40,7 +40,7 @@ export const MenuItemCollapse = props => { {link?.icon && } {link?.name} - + )} {hasSubMenu && (
{
- + {link?.icon && }{' '} {sLink.title} - +
) })} diff --git a/themes/commerce/components/MenuItemDrop.js b/themes/commerce/components/MenuItemDrop.js index d5b80449..16c98dcf 100644 --- a/themes/commerce/components/MenuItemDrop.js +++ b/themes/commerce/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -22,13 +22,13 @@ export const MenuItemDrop = ({ link }) => { onMouseOut={() => changeShow(false)} className='h-full'> {!hasSubMenu && ( - {link?.icon && }
{link?.name}
{/* {hasSubMenu && } */} - + )} {hasSubMenu && ( @@ -50,12 +50,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/commerce/components/NavButtonGroup.js b/themes/commerce/components/NavButtonGroup.js index 8539eb49..8d671a7a 100644 --- a/themes/commerce/components/NavButtonGroup.js +++ b/themes/commerce/components/NavButtonGroup.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 首页导航大按钮组件 @@ -15,14 +15,14 @@ const NavButtonGroup = (props) => { diff --git a/themes/commerce/components/PaginationNumber.js b/themes/commerce/components/PaginationNumber.js index d041fe6c..8eff44c5 100644 --- a/themes/commerce/components/PaginationNumber.js +++ b/themes/commerce/components/PaginationNumber.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -18,7 +18,7 @@ const PaginationNumber = ({ page, totalPage }) => { return (
    {/* 上一页 */} - { - + {pages} {/* 下一页 */} - { - +
    ) } function getPageElement(page, currentPage, pagePrefix) { return ( - () + ) ) } diff --git a/themes/commerce/components/PostHeader.js b/themes/commerce/components/PostHeader.js index 4a258cb5..1f819fca 100644 --- a/themes/commerce/components/PostHeader.js +++ b/themes/commerce/components/PostHeader.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import NotionIcon from '@/components/NotionIcon' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' @@ -19,11 +19,11 @@ export default function PostHeader({ post }) {
    {post.category && <> - +
    {post.category}
    - +
    }
    diff --git a/themes/commerce/components/ProductCard.js b/themes/commerce/components/ProductCard.js index 8ec25b6c..b413d397 100644 --- a/themes/commerce/components/ProductCard.js +++ b/themes/commerce/components/ProductCard.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { siteConfig } from '@/lib/config' import LazyImage from '@/components/LazyImage' @@ -19,11 +19,11 @@ const ProductCard = ({ index, post, siteInfo }) => {
    {/* 图片封面 */} - +
    - +
    {post.title}
    diff --git a/themes/commerce/components/ProductCategories.js b/themes/commerce/components/ProductCategories.js index 4a6b7422..c2334314 100644 --- a/themes/commerce/components/ProductCategories.js +++ b/themes/commerce/components/ProductCategories.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' export default function ProductCategories(props) { @@ -21,14 +21,14 @@ export default function ProductCategories(props) { className={'flex flex-col space-y-2 text-start'}> {categoryOptions?.map(category => { return ( - {category.name} - + ) })} diff --git a/themes/commerce/components/SearchNav.js b/themes/commerce/components/SearchNav.js index fc393c1b..05d06197 100644 --- a/themes/commerce/components/SearchNav.js +++ b/themes/commerce/components/SearchNav.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useRef } from 'react' import Card from './Card' import SearchInput from './SearchInput' @@ -31,7 +31,7 @@ export default function SearchNav(props) {
    {categoryOptions?.map(category => { return ( - {category.name}({category.count})
    - + ) })}
    diff --git a/themes/commerce/components/SlotBar.js b/themes/commerce/components/SlotBar.js index c7c1c802..ad1ee121 100644 --- a/themes/commerce/components/SlotBar.js +++ b/themes/commerce/components/SlotBar.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博客列表上方嵌入条 @@ -10,10 +10,10 @@ export default function SlotBar(props) { if (tag) { return
    -
    #{tag}
    - +
    } else if (category) { return
    diff --git a/themes/commerce/components/TagItemMini.js b/themes/commerce/components/TagItemMini.js index fea3b755..a3dea43b 100644 --- a/themes/commerce/components/TagItemMini.js +++ b/themes/commerce/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - {
    {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
    - + ); } diff --git a/themes/commerce/config.js b/themes/commerce/config.js index 4c3e872a..c0f147ae 100644 --- a/themes/commerce/config.js +++ b/themes/commerce/config.js @@ -15,6 +15,9 @@ const CONFIG = { COMMERCE_HOME_POSTS_COUNT: 9, // 首页展示商品数 COMMERCE_CONTACT_WHATSAPP_SHOW: true, // 是否展示whatsapp联系按钮 请配置 CONTACT_WHATSAPP - COMMERCE_CONTACT_TELEGRAM_SHOW: true // 联系栏展示telegram按钮 请配置 CONTACT_TELEGRAM + COMMERCE_CONTACT_TELEGRAM_SHOW: true, // 联系栏展示telegram按钮 请配置 CONTACT_TELEGRAM + + COMMERCE_ARTICLE_COPYRIGHT: true, // 文章版权声明 + COMMERCE_ARTICLE_NOT_BY_AI: false // 显示非AI写作 } export default CONFIG diff --git a/themes/commerce/index.js b/themes/commerce/index.js index 9efbd684..ae77e4ac 100644 --- a/themes/commerce/index.js +++ b/themes/commerce/index.js @@ -7,7 +7,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { isBrowser, scanAndConvertToLinks } from '@/lib/utils' import { Transition } from '@headlessui/react' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useRef } from 'react' import { ArticleLock } from './components/ArticleLock' @@ -346,7 +346,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {category.name}( {category.count})
    - + ) })}
    diff --git a/themes/example/components/BlogItem.js b/themes/example/components/BlogItem.js index 90a40f3a..4e6d84a8 100644 --- a/themes/example/components/BlogItem.js +++ b/themes/example/components/BlogItem.js @@ -2,7 +2,7 @@ import LazyImage from '@/components/LazyImage' import NotionIcon from '@/components/NotionIcon' import TwikooCommentCount from '@/components/TwikooCommentCount' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -20,14 +20,14 @@ const BlogItem = ({ post }) => { className={`${showPageCover ? 'flex md:flex-row flex-col-reverse' : ''} replace mb-12 `}>

    - {siteConfig('POST_TITLE_ICON') && ( )} {post?.title} - +

    @@ -40,11 +40,11 @@ const BlogItem = ({ post }) => { {post.category && ( <> | - {post.category} - + )} {/* | */} @@ -68,12 +68,12 @@ const BlogItem = ({ post }) => { {/* 图片封面 */} {showPageCover && (
    - + - +
    )} diff --git a/themes/example/components/BlogListArchive.js b/themes/example/components/BlogListArchive.js index 256edbdf..f38434b6 100644 --- a/themes/example/components/BlogListArchive.js +++ b/themes/example/components/BlogListArchive.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博客归档列表;仅归档页面使用 @@ -21,11 +21,11 @@ export default function BlogListArchive({ archiveTitle, archivePosts }) { className='border-l-2 p-1 text-xs md:text-base items-center hover:scale-x-105 hover:border-gray-500 dark:hover:border-gray-300 dark:border-gray-400 transform duration-500'>
    {post?.publishDay}   - {post.title} - +
    ) diff --git a/themes/example/components/BlogListPage.js b/themes/example/components/BlogListPage.js index fe56e0bf..2d374f73 100644 --- a/themes/example/components/BlogListPage.js +++ b/themes/example/components/BlogListPage.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import CONFIG from '../config' import BlogItem from './BlogItem' @@ -37,7 +37,7 @@ export const BlogListPage = props => {
    - { }} className={`${showPrev ? 'bg-black dark:bg-hexo-black-gray' : 'bg-gray pointer-events-none invisible'} text-white no-underline py-2 px-3 rounded`}> {locale.PAGINATION.PREV} - - + {locale.PAGINATION.NEXT} - +
    ) diff --git a/themes/example/components/Header.js b/themes/example/components/Header.js index 12111edd..486fb79a 100644 --- a/themes/example/components/Header.js +++ b/themes/example/components/Header.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { MenuList } from './MenuList' /** @@ -11,11 +11,11 @@ export const Header = props => { return (
    - {siteConfig('TITLE')} - +
    {/* 右侧文字 */}
    diff --git a/themes/example/components/MenuItemDrop.js b/themes/example/components/MenuItemDrop.js index 2610b585..198c2b00 100644 --- a/themes/example/components/MenuItemDrop.js +++ b/themes/example/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -17,10 +17,10 @@ export const MenuItemDrop = ({ link }) => { onMouseOut={() => changeShow(false)}> {!hasSubMenu && (
    - + {link?.icon && } {link?.name} {hasSubMenu && } - +
    )} @@ -41,12 +41,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/example/components/PostMeta.js b/themes/example/components/PostMeta.js index 19a6cab2..ebbb14b0 100644 --- a/themes/example/components/PostMeta.js +++ b/themes/example/components/PostMeta.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 文章详情的元信息 * 标题、作者、分类、标签、创建日期等等。 @@ -14,25 +14,25 @@ export const PostMeta = props => {
    {post?.type !== 'Page' && ( <> - {post?.category} - + | )} {post?.type !== 'Page' && ( <> - {post?.publishDay} - + | {locale.COMMON.LAST_EDITED_TIME}: {post?.lastEditedDay} diff --git a/themes/example/components/RecentCommentListForExample.js b/themes/example/components/RecentCommentListForExample.js index e6c97c4c..0fbd075e 100644 --- a/themes/example/components/RecentCommentListForExample.js +++ b/themes/example/components/RecentCommentListForExample.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { RecentComments } from '@waline/client' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useState } from 'react' /** @@ -44,14 +44,14 @@ const RecentCommentListForExample = props => { dangerouslySetInnerHTML={{ __html: comment.comment }} />
    - --{comment.nick} - +
    ))} diff --git a/themes/example/components/SideBar.js b/themes/example/components/SideBar.js index 35c95b1e..42be608f 100644 --- a/themes/example/components/SideBar.js +++ b/themes/example/components/SideBar.js @@ -2,7 +2,7 @@ import Live2D from '@/components/Live2D' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import dynamic from 'next/dynamic' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import Announcement from './Announcement' import Catalog from './Catalog' @@ -53,7 +53,7 @@ export const SideBar = props => {
      {categoryOptions?.map(category => { return ( - { {category.name}({category.count}) - + ) })}
    @@ -83,7 +83,7 @@ export const SideBar = props => {
      {latestPosts?.map(p => { return ( - +
    • {' '} { {p.title}
    • - +
      ) })}
    diff --git a/themes/example/index.js b/themes/example/index.js index 4834039b..0f5751da 100644 --- a/themes/example/index.js +++ b/themes/example/index.js @@ -8,7 +8,7 @@ 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 SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect } from 'react' import BlogListArchive from './components/BlogListArchive' @@ -292,7 +292,7 @@ const LayoutCategoryIndex = props => { <>
    {categoryOptions?.map(category => ( - { {category.name}({category.count})
    - + ))}
    @@ -323,7 +323,7 @@ const LayoutTagIndex = props => {
    {tagOptions.map(tag => (
    - { {' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
    - +
    ))}
    diff --git a/themes/fukasawa/components/ArticleAround.js b/themes/fukasawa/components/ArticleAround.js index b0de69c7..ffcd69cf 100644 --- a/themes/fukasawa/components/ArticleAround.js +++ b/themes/fukasawa/components/ArticleAround.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 上一篇,下一篇文章 @@ -11,22 +11,22 @@ export default function ArticleAround ({ prev, next }) { } return (
    - {prev.title} - - + {next.title} - +
    ); } diff --git a/themes/fukasawa/components/ArticleDetail.js b/themes/fukasawa/components/ArticleDetail.js index 62a0a0d8..63b193bc 100644 --- a/themes/fukasawa/components/ArticleDetail.js +++ b/themes/fukasawa/components/ArticleDetail.js @@ -8,7 +8,7 @@ import WWAds from '@/components/WWAds' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import ArticleAround from './ArticleAround' import TagItemMini from './TagItemMini' @@ -55,25 +55,25 @@ export default function ArticleDetail(props) {
    {post?.category && ( <> - {post.category} - + | )} {post?.type !== 'Page' && ( <> - {post?.publishDay} - + | {locale.COMMON.LAST_EDITED_TIME}: {post.lastEditedDay} diff --git a/themes/fukasawa/components/BlogCard.js b/themes/fukasawa/components/BlogCard.js index 2cfb0ce4..3b478c49 100644 --- a/themes/fukasawa/components/BlogCard.js +++ b/themes/fukasawa/components/BlogCard.js @@ -2,7 +2,7 @@ import LazyImage from '@/components/LazyImage' import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import TagItemMini from './TagItemMini' @@ -51,7 +51,7 @@ const {siteInfo} =useGlobal()
    {/* 封面图 */} {showPageCover && ( - +
    - +
    )} {/* 文字部分 */}

    - @@ -73,7 +73,7 @@ const {siteInfo} =useGlobal() )}{' '} {post.title} - +

    {(!showPreview || showSummary) && ( @@ -85,13 +85,13 @@ const {siteInfo} =useGlobal() {/* 分类标签 */}
    {post.category && ( - {post.category} - + )}
    diff --git a/themes/fukasawa/components/BlogPostArchive.js b/themes/fukasawa/components/BlogPostArchive.js index bcdafccf..61c1b1ee 100644 --- a/themes/fukasawa/components/BlogPostArchive.js +++ b/themes/fukasawa/components/BlogPostArchive.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博客归档 @@ -27,12 +27,12 @@ const BlogArchiveItem = ({ posts = [], archiveTitle }) => {
    {post.date?.start_date}{' '}   - {post.title} - +
    ) diff --git a/themes/fukasawa/components/GroupCategory.js b/themes/fukasawa/components/GroupCategory.js index 1753afd2..df1a0805 100644 --- a/themes/fukasawa/components/GroupCategory.js +++ b/themes/fukasawa/components/GroupCategory.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' function GroupCategory ({ currentCategory, categories }) { if (!categories) { @@ -10,7 +10,7 @@ function GroupCategory ({ currentCategory, categories }) { {categories.map(category => { const selected = currentCategory === category.name return ( - {category.name}({category.count}) - + ) })}
    diff --git a/themes/fukasawa/components/Logo.js b/themes/fukasawa/components/Logo.js index ae951363..6cc2bd8f 100644 --- a/themes/fukasawa/components/Logo.js +++ b/themes/fukasawa/components/Logo.js @@ -1,14 +1,14 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const Logo = props => { return (
    - {siteConfig('TITLE')} - +
    ) } diff --git a/themes/fukasawa/components/MenuItemCollapse.js b/themes/fukasawa/components/MenuItemCollapse.js index eb00850f..d0da4902 100644 --- a/themes/fukasawa/components/MenuItemCollapse.js +++ b/themes/fukasawa/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -42,7 +42,7 @@ export const MenuItemCollapse = props => { } onClick={toggleShow}> {!hasSubMenu && ( - @@ -50,7 +50,7 @@ export const MenuItemCollapse = props => {
    {link.name}
    - + )} {hasSubMenu && ( @@ -79,14 +79,14 @@ export const MenuItemCollapse = props => { className='whitespace-nowrap dark:text-gray-200 not:last-child:border-b-0 border-b dark:border-gray-800 py-2 px-14 cursor-pointer hover:bg-gray-100 font-extralight dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'> - +
    {sLink.title}
    - +
    ) })} diff --git a/themes/fukasawa/components/MenuItemDrop.js b/themes/fukasawa/components/MenuItemDrop.js index 1de272c2..8bd7da3d 100644 --- a/themes/fukasawa/components/MenuItemDrop.js +++ b/themes/fukasawa/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -13,7 +13,7 @@ export const MenuItemDrop = ({ link }) => { onMouseOut={() => changeShow(false)} className='relative py-1 mb-1.5 duration-500 justify-between text-gray-500 dark:text-gray-300 hover:text-black hover:underline cursor-pointer flex flex-nowrap items-center '> {!hasSubMenu && ( - @@ -22,7 +22,7 @@ export const MenuItemDrop = ({ link }) => { {link.name}
    {link.slot} - + )} {hasSubMenu && ( @@ -48,7 +48,7 @@ export const MenuItemDrop = ({ link }) => { {link?.subMenus?.map((sLink, index) => { return (
  • - @@ -57,7 +57,7 @@ export const MenuItemDrop = ({ link }) => { )}
    {sLink.name}
    {sLink.slot} - +
  • ) })} diff --git a/themes/fukasawa/components/MenuItemNormal.js b/themes/fukasawa/components/MenuItemNormal.js index a4ccf59d..4c69e72b 100644 --- a/themes/fukasawa/components/MenuItemNormal.js +++ b/themes/fukasawa/components/MenuItemNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const MenuItemNormal = props => { @@ -9,7 +9,7 @@ export const MenuItemNormal = props => { return null } return ( - {
    {link.name}
    {link.slot} - + ) } diff --git a/themes/fukasawa/components/PaginationSimple.js b/themes/fukasawa/components/PaginationSimple.js index 11c0d3f3..792989e5 100644 --- a/themes/fukasawa/components/PaginationSimple.js +++ b/themes/fukasawa/components/PaginationSimple.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' @@ -17,7 +17,7 @@ const PaginationSimple = ({ page, showNext }) => { return (
    - { } text-center w-full duration-200 px-4 py-2 hover:border-black border-b-2 hover:font-bold`}> ←{locale.PAGINATION.PREV} - - + { } text-center w-full duration-200 px-4 py-2 hover:border-black border-b-2 hover:font-bold`}> {locale.PAGINATION.NEXT}→ - +
    ) } diff --git a/themes/fukasawa/components/TagItem.js b/themes/fukasawa/components/TagItem.js index 179da9db..00771ca3 100644 --- a/themes/fukasawa/components/TagItem.js +++ b/themes/fukasawa/components/TagItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useGlobal } from '@/lib/global' const TagItem = ({ tag, selected }) => { @@ -7,7 +7,7 @@ const TagItem = ({ tag, selected }) => {
    { locale.COMMON.NOTAG }
    } return ( - @@ -19,7 +19,7 @@ const TagItem = ({ tag, selected }) => { {selected && } {`${tag.name} `} {tag.count ? `(${tag.count})` : ''}
    - + ); } diff --git a/themes/fukasawa/components/TagItemMini.js b/themes/fukasawa/components/TagItemMini.js index 26295088..c83b9f0f 100644 --- a/themes/fukasawa/components/TagItemMini.js +++ b/themes/fukasawa/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - {
    {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
    - + ); } diff --git a/themes/fukasawa/index.js b/themes/fukasawa/index.js index 4176ed11..2bb9c57b 100644 --- a/themes/fukasawa/index.js +++ b/themes/fukasawa/index.js @@ -9,7 +9,7 @@ import { useGlobal } from '@/lib/global' import { isBrowser } from '@/lib/utils' import { Transition } from '@headlessui/react' import dynamic from 'next/dynamic' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef } from 'react' import ArticleDetail from './components/ArticleDetail' @@ -258,7 +258,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {category.name}({category.count})
    - + ) })}
    diff --git a/themes/game/components/BlogArchiveItem.js b/themes/game/components/BlogArchiveItem.js index 4a92959e..7a010961 100644 --- a/themes/game/components/BlogArchiveItem.js +++ b/themes/game/components/BlogArchiveItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 归档分组文章 @@ -21,12 +21,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
    {post.date?.start_date}{' '}   - {post.title} - +
    ) diff --git a/themes/game/components/BlogPost.js b/themes/game/components/BlogPost.js index 51354bd8..e33c3da2 100644 --- a/themes/game/components/BlogPost.js +++ b/themes/game/components/BlogPost.js @@ -2,7 +2,7 @@ import NotionIcon from '@/components/NotionIcon' import NotionPage from '@/components/NotionPage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const BlogPost = ({ post }) => { const { NOTION_CONFIG } = useGlobal() @@ -10,7 +10,7 @@ const BlogPost = ({ post }) => { siteConfig('POST_LIST_PREVIEW', false, NOTION_CONFIG) && post?.blockMap return ( - +

    @@ -37,7 +37,7 @@ const BlogPost = ({ post }) => { )}

    - +
    ) } diff --git a/themes/game/components/ExampleRecentComments.js b/themes/game/components/ExampleRecentComments.js index 9dbdfa7f..cf1f5bed 100644 --- a/themes/game/components/ExampleRecentComments.js +++ b/themes/game/components/ExampleRecentComments.js @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' /** @@ -26,7 +26,7 @@ const ExampleRecentComments = (props) => { {!onLoading && comments && comments.length === 0 &&
    No Comments
    } {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
    -
    --{comment.nick}
    +
    --{comment.nick}
    )} diff --git a/themes/game/components/GameEmbed.js b/themes/game/components/GameEmbed.js index cb83c8f3..1de42784 100644 --- a/themes/game/components/GameEmbed.js +++ b/themes/game/components/GameEmbed.js @@ -2,7 +2,7 @@ import { Draggable } from '@/components/Draggable' import { siteConfig } from '@/lib/config' import { deepClone } from '@/lib/utils' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useState } from 'react' import DownloadButton from './DownloadButton' import FullScreenButton from './FullScreenButton' @@ -100,12 +100,12 @@ export default function GameEmbed({ post, siteInfo }) {
    - - {' '} + {' '} { diff --git a/themes/game/components/GameListIndexCombine.js b/themes/game/components/GameListIndexCombine.js index ac8b14ba..8e5d703c 100644 --- a/themes/game/components/GameListIndexCombine.js +++ b/themes/game/components/GameListIndexCombine.js @@ -3,7 +3,7 @@ import { AdSlot } from '@/components/GoogleAdsense' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { deepClone } from '@/lib/utils' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' import CONFIG from '../config' @@ -142,7 +142,7 @@ const GameItem = ({ item, isLargeCard }) => { const video = item?.ext?.video return ( - { alt={title} fill='full' /> - + ) } diff --git a/themes/game/components/GameListNormal.js b/themes/game/components/GameListNormal.js index 22fc4a6f..9a15d185 100644 --- a/themes/game/components/GameListNormal.js +++ b/themes/game/components/GameListNormal.js @@ -1,6 +1,6 @@ /* eslint-disable @next/next/no-img-element */ import { deepClone } from '@/lib/utils' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -45,7 +45,7 @@ const GameItem = ({ item }) => { const video = item?.ext?.video return ( - { setShowType('video') @@ -77,6 +77,6 @@ const GameItem = ({ item }) => { src={img} alt={title} /> - + ) } diff --git a/themes/game/components/GameListRealate.js b/themes/game/components/GameListRealate.js index 3d925c3a..b22cff64 100644 --- a/themes/game/components/GameListRealate.js +++ b/themes/game/components/GameListRealate.js @@ -1,6 +1,6 @@ /* eslint-disable @next/next/no-img-element */ import { deepClone } from '@/lib/utils' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -46,7 +46,7 @@ const GameItem = ({ item }) => { const video = item?.ext?.video return ( - { setShowType('video') @@ -78,6 +78,6 @@ const GameItem = ({ item }) => { src={img} alt={title} /> - + ) } diff --git a/themes/game/components/GroupCategory.js b/themes/game/components/GroupCategory.js index 4da5128c..b91abefc 100644 --- a/themes/game/components/GroupCategory.js +++ b/themes/game/components/GroupCategory.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' function GroupCategory({ currentCategory, categoryOptions }) { if (!categoryOptions) { @@ -7,16 +7,16 @@ function GroupCategory({ currentCategory, categoryOptions }) { return (
    - + - +
    {categoryOptions.map(category => { const selected = currentCategory === category.name return ( - {category.count} */} - + ) })}
    diff --git a/themes/game/components/GroupTag.js b/themes/game/components/GroupTag.js index 2fa712bd..3c6806dd 100644 --- a/themes/game/components/GroupTag.js +++ b/themes/game/components/GroupTag.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import TagItemMini from './TagItemMini' /** @@ -12,9 +12,9 @@ function GroupTag({ tagOptions, currentTag }) { if (!tagOptions) return <> return (
    - + - +
    {tagOptions?.slice(0, 20)?.map(tag => { const selected = tag.name === currentTag diff --git a/themes/game/components/Logo.js b/themes/game/components/Logo.js index 896ae725..8de33512 100644 --- a/themes/game/components/Logo.js +++ b/themes/game/components/Logo.js @@ -1,10 +1,10 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /* eslint-disable @next/next/no-html-link-for-pages */ export default function Logo({ siteInfo }) { return ( - @@ -16,6 +16,6 @@ export default function Logo({ siteInfo }) { {siteConfig('BIO')}
    - + ) } diff --git a/themes/game/components/LogoMini.js b/themes/game/components/LogoMini.js index b540e6e6..8b8899a8 100644 --- a/themes/game/components/LogoMini.js +++ b/themes/game/components/LogoMini.js @@ -1,11 +1,11 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /* eslint-disable @next/next/no-html-link-for-pages */ export default function LogoMini() { return ( - + {siteConfig('TITLE')?.charAt(0)} - + ) } diff --git a/themes/game/components/MenuItemCollapse.js b/themes/game/components/MenuItemCollapse.js index f70ed8d1..d7fd1993 100644 --- a/themes/game/components/MenuItemCollapse.js +++ b/themes/game/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -32,7 +32,7 @@ export const MenuItemCollapse = props => { className='w-full px-4 py-2 text-left dark:bg-hexo-black-gray dark:border-black' onClick={toggleShow}> {!hasSubMenu && ( - @@ -44,7 +44,7 @@ export const MenuItemCollapse = props => { )} {link?.name} - + )} {hasSubMenu && (
    {
    - + {sLink.title} - +
    ) })} diff --git a/themes/game/components/MenuItemDrop.js b/themes/game/components/MenuItemDrop.js index e72a87dd..54f13cc0 100644 --- a/themes/game/components/MenuItemDrop.js +++ b/themes/game/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -17,7 +17,7 @@ export const MenuItemDrop = ({ link }) => { onMouseOut={() => changeShow(false)}> {!hasSubMenu && (
    - @@ -25,7 +25,7 @@ export const MenuItemDrop = ({ link }) => { {link?.icon && }
    {link?.name} - +
    )} @@ -47,12 +47,12 @@ export const MenuItemDrop = ({ link }) => {
    - + {link?.icon &&   } {sLink.title} - +
    ) })} diff --git a/themes/game/components/PaginationSimple.js b/themes/game/components/PaginationSimple.js index 6df710f5..c2874b59 100644 --- a/themes/game/components/PaginationSimple.js +++ b/themes/game/components/PaginationSimple.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -21,7 +21,7 @@ const PaginationSimple = ({ page, showNext }) => { return (
    - { currentPage === 1 ? 'invisible' : 'visible' } text-center w-full duration-200 px-4 py-2 hover:border-black dark:border-hexo-black-gray border-b-2 hover:font-bold`}> ←{locale.PAGINATION.PREV} - - + { showNext ? 'visible' : 'invisible' } text-center w-full duration-200 px-4 py-2 hover:border-black dark:border-hexo-black-gray border-b-2 hover:font-bold`}> {locale.PAGINATION.NEXT}→ - +
    ) } diff --git a/themes/game/components/PostInfo.js b/themes/game/components/PostInfo.js index 0e430765..243d569e 100644 --- a/themes/game/components/PostInfo.js +++ b/themes/game/components/PostInfo.js @@ -1,5 +1,5 @@ import NotionIcon from '@/components/NotionIcon' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import TagItem from './TagItem' import { siteConfig } from '@/lib/config' @@ -15,12 +15,12 @@ export default function PostInfo(props) {
    {post?.type !== 'Page' && ( <> - {post?.category} - + )}
    diff --git a/themes/game/components/SideBar.js b/themes/game/components/SideBar.js index a4d1e060..5cc321ba 100644 --- a/themes/game/components/SideBar.js +++ b/themes/game/components/SideBar.js @@ -1,7 +1,7 @@ import { siteConfig } from '@/lib/config' import Live2D from '@/components/Live2D' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import dynamic from 'next/dynamic' const ExampleRecentComments = dynamic(() => import('./ExampleRecentComments')) @@ -18,13 +18,13 @@ export const SideBar = (props) => { @@ -39,9 +39,9 @@ export const SideBar = (props) => {
      {latestPosts?.map(p => { return ( - +
    • {p.title}
    • - +
      ); })}
    diff --git a/themes/game/components/TagItem.js b/themes/game/components/TagItem.js index 4f01fb72..fd94acbd 100644 --- a/themes/game/components/TagItem.js +++ b/themes/game/components/TagItem.js @@ -1,11 +1,11 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItem = ({ tag }) => ( - +

    {tag}

    - +
    ) export default TagItem diff --git a/themes/game/components/TagItemMini.js b/themes/game/components/TagItemMini.js index 3fe0c7bf..48f101b5 100644 --- a/themes/game/components/TagItemMini.js +++ b/themes/game/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - { {tag.count ? `${tag.count}` : ''} - + ) } diff --git a/themes/game/components/Tags.js b/themes/game/components/Tags.js index bdab3ee5..db94dd93 100644 --- a/themes/game/components/Tags.js +++ b/themes/game/components/Tags.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const Tags = props => { const { tagOptions, tag } = props @@ -19,14 +19,14 @@ const Tags = props => { : 'bg-gray-100 border-gray-100 text-gray-400 dark:bg-night dark:border-gray-800' }`} > - {`${tag.name} (${tag.count})`} - + ) })} diff --git a/themes/game/index.js b/themes/game/index.js index a2ad09e0..e57fea09 100644 --- a/themes/game/index.js +++ b/themes/game/index.js @@ -9,7 +9,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { loadWowJS } from '@/lib/plugins/wow' import { deepClone, isBrowser, shuffleArray } from '@/lib/utils' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef, useState } from 'react' import Announcement from './components/Announcement' @@ -400,7 +400,7 @@ const LayoutCategoryIndex = props => { className='duration-200 flex flex-wrap my-4 gap-2'> {categoryOptions?.map(category => { return ( - { {/* */} {category.name}({category.count})
    - + ) })}
    @@ -433,14 +433,14 @@ const LayoutTagIndex = props => {
    {tagOptions.map(tag => { return ( - {' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '} - + ) })}
    diff --git a/themes/gitbook/components/ArticleAround.js b/themes/gitbook/components/ArticleAround.js index 4125e1cc..62893af4 100644 --- a/themes/gitbook/components/ArticleAround.js +++ b/themes/gitbook/components/ArticleAround.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 上一篇,下一篇文章 @@ -15,7 +15,7 @@ export default function ArticleAround({ prev, next }) { return (
    - @@ -24,9 +24,9 @@ export default function ArticleAround({ prev, next }) {
    {locale.COMMON.PREV_POST}
    {prev.title}
    - + - @@ -35,7 +35,7 @@ export default function ArticleAround({ prev, next }) {
    {next.title}
    - + ) } diff --git a/themes/gitbook/components/BlogArchiveItem.js b/themes/gitbook/components/BlogArchiveItem.js index 7d7b5a1c..a6d77c51 100644 --- a/themes/gitbook/components/BlogArchiveItem.js +++ b/themes/gitbook/components/BlogArchiveItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 归档分组 @@ -20,12 +20,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
    {post.date?.start_date}{' '}   - {post.title} - +
    ) diff --git a/themes/gitbook/components/BlogPostCard.js b/themes/gitbook/components/BlogPostCard.js index a311f47c..c19a099b 100644 --- a/themes/gitbook/components/BlogPostCard.js +++ b/themes/gitbook/components/BlogPostCard.js @@ -1,7 +1,7 @@ import Badge from '@/components/Badge' import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' const BlogPostCard = ({ post, className }) => { @@ -10,7 +10,7 @@ const BlogPostCard = ({ post, className }) => { decodeURIComponent(router.asPath.split('?')[0]) === post?.href return ( - +
    { )}
    - +
    ) } diff --git a/themes/gitbook/components/CategoryItem.js b/themes/gitbook/components/CategoryItem.js index 779488de..8b7cbcfc 100644 --- a/themes/gitbook/components/CategoryItem.js +++ b/themes/gitbook/components/CategoryItem.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function CategoryItem ({ selected, category, categoryCount }) { return ( - {category} {categoryCount && `(${categoryCount})`}
    - + ); } diff --git a/themes/gitbook/components/LeftMenuBar.js b/themes/gitbook/components/LeftMenuBar.js index 6bde6c51..6f9da093 100644 --- a/themes/gitbook/components/LeftMenuBar.js +++ b/themes/gitbook/components/LeftMenuBar.js @@ -1,14 +1,14 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function LeftMenuBar () { return (
    - +
    - +
    ); diff --git a/themes/gitbook/components/LogoBar.js b/themes/gitbook/components/LogoBar.js index b3f96cdf..3e086de5 100644 --- a/themes/gitbook/components/LogoBar.js +++ b/themes/gitbook/components/LogoBar.js @@ -1,6 +1,6 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -12,9 +12,9 @@ export default function LogoBar(props) { const { siteInfo } = props return (
    - + className='flex text-lg font-bold md:text-2xl dark:text-gray-200 items-center'> {siteInfo?.title || siteConfig('TITLE')} - +
    ) } diff --git a/themes/gitbook/components/MenuItemCollapse.js b/themes/gitbook/components/MenuItemCollapse.js index 96186533..a199cf9e 100644 --- a/themes/gitbook/components/MenuItemCollapse.js +++ b/themes/gitbook/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -42,7 +42,7 @@ export const MenuItemCollapse = props => { } onClick={toggleShow}> {!hasSubMenu && ( - @@ -50,7 +50,7 @@ export const MenuItemCollapse = props => {
    {link.name}
    - + )} {hasSubMenu && ( @@ -79,14 +79,14 @@ export const MenuItemCollapse = props => { className=' not:last-child:border-b-0 border-b dark:border-gray-800 py-2 px-14 cursor-pointer hover:bg-gray-100 dark:text-gray-200 font-extralight dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'> - +
    {sLink.title}
    - +
    ) })} diff --git a/themes/gitbook/components/MenuItemDrop.js b/themes/gitbook/components/MenuItemDrop.js index 9cc721d7..7fb7d2f5 100644 --- a/themes/gitbook/components/MenuItemDrop.js +++ b/themes/gitbook/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -24,9 +24,9 @@ export const MenuItemDrop = ({ link }) => { ? 'bg-green-600 text-white hover:text-white' : 'hover:text-green-600') }> - + {link?.icon && } {link?.name} - +
    )} @@ -56,12 +56,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/gitbook/components/MenuItemMobileNormal.js b/themes/gitbook/components/MenuItemMobileNormal.js index de16827d..d04ba79b 100644 --- a/themes/gitbook/components/MenuItemMobileNormal.js +++ b/themes/gitbook/components/MenuItemMobileNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const NormalMenu = props => { @@ -12,7 +12,7 @@ export const NormalMenu = props => { const selected = router.pathname === link.href || router.asPath === link.href return ( - {
    {link.name}
    {link.slot} - + ) } diff --git a/themes/gitbook/components/MenuItemPCNormal.js b/themes/gitbook/components/MenuItemPCNormal.js index bf3a22c7..06bee8a6 100644 --- a/themes/gitbook/components/MenuItemPCNormal.js +++ b/themes/gitbook/components/MenuItemPCNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const MenuItemPCNormal = props => { @@ -10,7 +10,7 @@ export const MenuItemPCNormal = props => { } return ( - {
    {link.name}
    {link.slot} - + ) } diff --git a/themes/gitbook/components/PaginationSimple.js b/themes/gitbook/components/PaginationSimple.js index b48259ea..90d6101b 100644 --- a/themes/gitbook/components/PaginationSimple.js +++ b/themes/gitbook/components/PaginationSimple.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' @@ -18,7 +18,7 @@ const PaginationSimple = ({ page, totalPage }) => { return (
    - { } text-center w-full duration-200 px-4 py-2 hover:border-green-500 border-b-2 hover:font-bold`}> ←{locale.PAGINATION.PREV} - - + { } text-center w-full duration-200 px-4 py-2 hover:border-green-500 border-b-2 hover:font-bold`}> {locale.PAGINATION.NEXT}→ - +
    ) } diff --git a/themes/gitbook/components/TagItemMini.js b/themes/gitbook/components/TagItemMini.js index 9922a069..e8fde285 100644 --- a/themes/gitbook/components/TagItemMini.js +++ b/themes/gitbook/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - {
    {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
    - + ) } diff --git a/themes/gitbook/index.js b/themes/gitbook/index.js index eda1faa3..e18c3f1f 100644 --- a/themes/gitbook/index.js +++ b/themes/gitbook/index.js @@ -16,7 +16,7 @@ import { getShortId } from '@/lib/utils/pageId' import { SignIn, SignUp } from '@clerk/nextjs' import dynamic from 'next/dynamic' import Head from 'next/head' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef, useState } from 'react' import Announcement from './components/Announcement' @@ -479,7 +479,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {category.name}({category.count})
    - + ) })} diff --git a/themes/heo/components/BlogPostArchive.js b/themes/heo/components/BlogPostArchive.js index 1ba8b2da..3d6dc60d 100644 --- a/themes/heo/components/BlogPostArchive.js +++ b/themes/heo/components/BlogPostArchive.js @@ -1,6 +1,6 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import TagItemMini from './TagItemMini' @@ -44,12 +44,12 @@ const BlogPostArchive = ({ posts = [], archiveTitle, siteInfo }) => { {/* 图片封面 */} {showPageCover && (
    - + - +
    )} @@ -60,24 +60,24 @@ const BlogPostArchive = ({ posts = [], archiveTitle, siteInfo }) => { {post?.category && ( )} {/* 标题 */} - {post.title} - + {/* 摘要 */} diff --git a/themes/heo/components/BlogPostCard.js b/themes/heo/components/BlogPostCard.js index c6e09f4a..ebbb6238 100644 --- a/themes/heo/components/BlogPostCard.js +++ b/themes/heo/components/BlogPostCard.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import NotionIcon from './NotionIcon' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import TagItemMini from './TagItemMini' @@ -38,7 +38,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { }> {/* 图片封面 */} {showPageCover && ( - +
    { className='h-full w-full object-cover group-hover:scale-105 group-hover:brightness-75 transition-all duration-500 ease-in-out' //宽高都调整为自适应,保证封面居中 />
    - +
    )} {/* 文字区块 */} @@ -65,17 +65,17 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { {post?.category && ( )} {/* 标题和图标 */} - { /> )} {post.title} - + {/* 摘要 */} diff --git a/themes/heo/components/CategoryBar.js b/themes/heo/components/CategoryBar.js index d5548f9d..5a955c29 100644 --- a/themes/heo/components/CategoryBar.js +++ b/themes/heo/components/CategoryBar.js @@ -1,6 +1,6 @@ import { ChevronDoubleLeft, ChevronDoubleRight } from '@/components/HeroIcons' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useRef, useState } from 'react' @@ -55,11 +55,11 @@ export default function CategoryBar(props) { )} - {locale.MENU.CATEGORY} - + ) @@ -77,7 +77,7 @@ const MenuItem = ({ href, name }) => { return (
    - {name} + {name}
    ) } diff --git a/themes/heo/components/CategoryGroup.js b/themes/heo/components/CategoryGroup.js index 21915d72..a3bde599 100644 --- a/themes/heo/components/CategoryGroup.js +++ b/themes/heo/components/CategoryGroup.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const CategoryGroup = ({ currentCategory, categories }) => { if (!categories) { @@ -9,7 +9,7 @@ const CategoryGroup = ({ currentCategory, categories }) => { {categories.map(category => { const selected = currentCategory === category.name return ( - {
    {category.name}({category.count})
    - + ) })} diff --git a/themes/heo/components/Hero.js b/themes/heo/components/Hero.js index 8c2a871b..a0cae172 100644 --- a/themes/heo/components/Hero.js +++ b/themes/heo/components/Hero.js @@ -3,7 +3,7 @@ import { ArrowSmallRight, PlusSmall } from '@/components/HeroIcons' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useImperativeHandle, useRef, useState } from 'react' import CONFIG from '../config' @@ -176,7 +176,7 @@ function GroupMenu() { return (
    -
    @@ -186,8 +186,8 @@ function GroupMenu() {
    - - +
    @@ -197,9 +197,9 @@ function GroupMenu() {
    - + {/* 第三个标签在小屏上不显示 */} -
    @@ -209,7 +209,7 @@ function GroupMenu() {
    - +
    ) } @@ -239,7 +239,7 @@ function TopGroup(props) { className='w-full flex space-x-3 xl:space-x-0 xl:grid xl:grid-cols-3 xl:gap-3 xl:h-[342px]'> {topPosts?.map((p, index) => { return ( - +
    - +
    ) })}
    diff --git a/themes/heo/components/HexoRecentComments.js b/themes/heo/components/HexoRecentComments.js index 354e2182..11b403b1 100644 --- a/themes/heo/components/HexoRecentComments.js +++ b/themes/heo/components/HexoRecentComments.js @@ -1,7 +1,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { RecentComments } from '@waline/client' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useState } from 'react' /** @@ -49,14 +49,14 @@ const HexoRecentComments = props => { dangerouslySetInnerHTML={{ __html: comment.comment }} />
    - --{comment.nick} - +
    ))} diff --git a/themes/heo/components/InfoCard.js b/themes/heo/components/InfoCard.js index af31d060..5c5cbccc 100644 --- a/themes/heo/components/InfoCard.js +++ b/themes/heo/components/InfoCard.js @@ -1,7 +1,7 @@ import { ArrowRightCircle } from '@/components/HeroIcons' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' import CONFIG from '../config' @@ -50,16 +50,16 @@ export function InfoCard(props) { {/* 两个社交按钮 */} {url1 && (
    - + - +
    )} {url2 && (
    - + - +
    )}
    @@ -81,7 +81,7 @@ function MoreButton() { return <> } return ( - +
    {text3}
    - +
    ) } diff --git a/themes/heo/components/LatestPostsGroup.js b/themes/heo/components/LatestPostsGroup.js index 1eb19022..b3350e95 100644 --- a/themes/heo/components/LatestPostsGroup.js +++ b/themes/heo/components/LatestPostsGroup.js @@ -1,5 +1,5 @@ import LazyImage from '@/components/LazyImage' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 最新文章列表 @@ -22,7 +22,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => { : siteInfo?.pageCover return ( - { }>
    {post.title}
    - + ) })} diff --git a/themes/heo/components/LatestPostsGroupMini.js b/themes/heo/components/LatestPostsGroupMini.js index 32094157..519f0f6e 100644 --- a/themes/heo/components/LatestPostsGroupMini.js +++ b/themes/heo/components/LatestPostsGroupMini.js @@ -2,7 +2,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' // import Image from 'next/image' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -33,7 +33,7 @@ export default function LatestPostsGroupMini({ latestPosts, siteInfo }) { : siteInfo?.pageCover return ( - {post.lastEditedDay} - + ) })} diff --git a/themes/heo/components/Logo.js b/themes/heo/components/Logo.js index 55ab2b4f..828d485f 100644 --- a/themes/heo/components/Logo.js +++ b/themes/heo/components/Logo.js @@ -1,12 +1,12 @@ import { Home } from '@/components/HeroIcons' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const Logo = props => { const { siteInfo } = props return ( - +
    {
    - +
    ) } export default Logo diff --git a/themes/heo/components/MenuGroupCard.js b/themes/heo/components/MenuGroupCard.js index e9810411..bd5b3f31 100644 --- a/themes/heo/components/MenuGroupCard.js +++ b/themes/heo/components/MenuGroupCard.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' const MenuGroupCard = props => { @@ -39,7 +39,7 @@ const MenuGroupCard = props => { if (link.show) { return (
    - {
    {link.name} :
    {link.slot}
    - +
    ) } else { diff --git a/themes/heo/components/MenuItemCollapse.js b/themes/heo/components/MenuItemCollapse.js index 6278cebe..8cd2e463 100644 --- a/themes/heo/components/MenuItemCollapse.js +++ b/themes/heo/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -31,7 +31,7 @@ export const MenuItemCollapse = ({ link }) => { className='select-none w-full p-2 border dark:border-gray-600 rounded-lg text-left dark:bg-[#1e1e1e]' onClick={toggleShow}> {!hasSubMenu && ( - @@ -39,7 +39,7 @@ export const MenuItemCollapse = ({ link }) => { {link?.icon && } {link?.name} - + )} {hasSubMenu && (
    {
    - + {link?.icon && }{' '} {sLink.title} - +
    ) })} diff --git a/themes/heo/components/MenuItemDrop.js b/themes/heo/components/MenuItemDrop.js index 48f80ad8..11c5ea84 100644 --- a/themes/heo/components/MenuItemDrop.js +++ b/themes/heo/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -15,12 +15,12 @@ export const MenuItemDrop = ({ link }) => { onMouseOut={() => changeShow(false)}> {/* 不含子菜单 */} {!hasSubMenu && ( - {link?.icon && } {link?.name} - + )} {/* 含子菜单的按钮 */} {hasSubMenu && ( @@ -44,12 +44,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/heo/components/NavButtonGroup.js b/themes/heo/components/NavButtonGroup.js index 82331852..947acbfb 100644 --- a/themes/heo/components/NavButtonGroup.js +++ b/themes/heo/components/NavButtonGroup.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 首页导航大按钮组件 @@ -15,14 +15,14 @@ const NavButtonGroup = (props) => { diff --git a/themes/heo/components/PaginationNumber.js b/themes/heo/components/PaginationNumber.js index a68f33e5..ae4359b4 100644 --- a/themes/heo/components/PaginationNumber.js +++ b/themes/heo/components/PaginationNumber.js @@ -1,6 +1,6 @@ import { ChevronDoubleRight } from '@/components/HeroIcons' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -47,7 +47,7 @@ const PaginationNumber = ({ page, totalPage }) => { {/* pc端分页按钮 */}
    {/* 上一页 */} - { {locale.PAGINATION.PREV}
    - + {/* 分页 */}
    @@ -84,7 +84,7 @@ const PaginationNumber = ({ page, totalPage }) => {
    {/* 下一页 */} - { {locale.PAGINATION.NEXT} - + {/* 移动端分页 */}
    {/* 上一页 */} - { rel='prev' className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}> {locale.PAGINATION.PREV} - + {showPrev && showNext &&
    } {/* 下一页 */} - { rel='next' className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}> {locale.PAGINATION.NEXT} - +
    ) @@ -147,7 +147,7 @@ function getPageElement(page, currentPage, pagePrefix) { return <> } return ( - {page} - + ) } diff --git a/themes/heo/components/PostAdjacent.js b/themes/heo/components/PostAdjacent.js index 9f97eac7..f49efb73 100644 --- a/themes/heo/components/PostAdjacent.js +++ b/themes/heo/components/PostAdjacent.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import CONFIG from '../config' @@ -63,7 +63,7 @@ export default function PostAdjacent({ prev, next }) {
    {/* 移动端 */}
    - @@ -71,8 +71,8 @@ export default function PostAdjacent({ prev, next }) {
    {prev.title}
    - - + @@ -80,7 +80,7 @@ export default function PostAdjacent({ prev, next }) {
    {next.title}
    - +
    {/* 桌面端 */} @@ -88,13 +88,13 @@ export default function PostAdjacent({ prev, next }) {
    ) diff --git a/themes/heo/components/PostCopyright.js b/themes/heo/components/PostCopyright.js index a209d25e..22775d4c 100644 --- a/themes/heo/components/PostCopyright.js +++ b/themes/heo/components/PostCopyright.js @@ -1,9 +1,10 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import CONFIG from '../config' +import NotByAI from '@/components/NotByAI' /** * 版权声明 @@ -27,9 +28,9 @@ export default function PostCopyright() {
    • {locale.COMMON.AUTHOR}: - + {siteConfig('AUTHOR')} - +
    • {locale.COMMON.URL}: @@ -43,6 +44,11 @@ export default function PostCopyright() { {locale.COMMON.COPYRIGHT}: {locale.COMMON.COPYRIGHT_NOTICE}
    • + {siteConfig('HEO_ARTICLE_NOT_BY_AI', false, CONFIG) && ( +
    • + +
    • + )}
    ) diff --git a/themes/heo/components/PostHeader.js b/themes/heo/components/PostHeader.js index 88711b50..cbb137fa 100644 --- a/themes/heo/components/PostHeader.js +++ b/themes/heo/components/PostHeader.js @@ -4,7 +4,7 @@ import NotionIcon from '@/components/NotionIcon' import WordCount from '@/components/WordCount' import { siteConfig } from '@/lib/config' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import WavesArea from './WavesArea' /** @@ -60,7 +60,7 @@ export default function PostHeader({ post, siteInfo, isDarkMode }) {
    {post.category && ( <> - {post.category}
    - + )} {post.tagItems && (
    {post.tagItems.map((tag, index) => ( - {' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
    - + ))} )} @@ -111,13 +111,13 @@ export default function PostHeader({ post, siteInfo, isDarkMode }) { {post?.type !== 'Page' && ( <> - {' '} {post?.publishDay} - + )} diff --git a/themes/heo/components/PostRecommend.js b/themes/heo/components/PostRecommend.js index c66b8d4f..48d273ef 100644 --- a/themes/heo/components/PostRecommend.js +++ b/themes/heo/components/PostRecommend.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -39,7 +39,7 @@ export default function PostRecommend({ recommendPosts, siteInfo }) { : siteInfo?.pageCover return ( - - + ) })} diff --git a/themes/heo/components/SearchNav.js b/themes/heo/components/SearchNav.js index 7be2b8ce..4970a5dd 100644 --- a/themes/heo/components/SearchNav.js +++ b/themes/heo/components/SearchNav.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useRef } from 'react' import Card from './Card' import SearchInput from './SearchInput' @@ -30,7 +30,7 @@ export default function SearchNav(props) {
    {categoryOptions?.map(category => { return ( - {category.name}({category.count})
    - + ) })} diff --git a/themes/heo/components/SlideOver.js b/themes/heo/components/SlideOver.js index e7bb95de..e015dd38 100644 --- a/themes/heo/components/SlideOver.js +++ b/themes/heo/components/SlideOver.js @@ -1,7 +1,7 @@ import DarkModeButton from '@/components/DarkModeButton' import { useGlobal } from '@/lib/global' import { Dialog, Transition } from '@headlessui/react' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { Fragment, @@ -149,12 +149,12 @@ function DarkModeBlockButton() { */ function Button({ title, url }) { return ( - {title} - + ) } diff --git a/themes/heo/components/TagGroups.js b/themes/heo/components/TagGroups.js index 34bf1839..a5e926a7 100644 --- a/themes/heo/components/TagGroups.js +++ b/themes/heo/components/TagGroups.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -18,7 +18,7 @@ const TagGroups = ({ tags, className }) => { {tags.map((tag, index) => { const selected = currentTag === tag.name return ( -
    { <> )}
    - + ) })} diff --git a/themes/heo/components/TagItemMini.js b/themes/heo/components/TagItemMini.js index 7b9a7c56..66d6d5ba 100644 --- a/themes/heo/components/TagItemMini.js +++ b/themes/heo/components/TagItemMini.js @@ -1,9 +1,9 @@ import { HashTag } from '@/components/HeroIcons' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - { {' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '} - + ) } diff --git a/themes/heo/components/TouchMeCard.js b/themes/heo/components/TouchMeCard.js index 42129ae0..7ed4dbe9 100644 --- a/themes/heo/components/TouchMeCard.js +++ b/themes/heo/components/TouchMeCard.js @@ -1,6 +1,6 @@ import FlipCard from '@/components/FlipCard' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -32,11 +32,11 @@ export default function TouchMeCard() { } backContent={ - +
    {siteConfig('HEO_SOCIAL_CARD_TITLE_3', null, CONFIG)}
    - +
    } /> diff --git a/themes/heo/config.js b/themes/heo/config.js index 4a037982..b093f61f 100644 --- a/themes/heo/config.js +++ b/themes/heo/config.js @@ -146,6 +146,7 @@ const CONFIG = { HEO_ARTICLE_ADJACENT: true, // 显示上一篇下一篇文章推荐 HEO_ARTICLE_COPYRIGHT: true, // 显示文章版权声明 + HEO_ARTICLE_NOT_BY_AI: false, // 显示非AI写作 HEO_ARTICLE_RECOMMEND: true, // 文章关联推荐 HEO_WIDGET_LATEST_POSTS: true, // 显示最新文章卡 diff --git a/themes/heo/index.js b/themes/heo/index.js index 6fa85552..fd21adeb 100644 --- a/themes/heo/index.js +++ b/themes/heo/index.js @@ -20,7 +20,7 @@ import { useGlobal } from '@/lib/global' import { loadWowJS } from '@/lib/plugins/wow' import { isBrowser } from '@/lib/utils' import { Transition } from '@headlessui/react' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import BlogPostArchive from './components/BlogPostArchive' @@ -43,6 +43,7 @@ import SideRight from './components/SideRight' import CONFIG from './config' import { Style } from './style' import AISummary from '@/components/AISummary' +import ArticleExpirationNotice from '@/components/ArticleExpirationNotice' /** * 基础布局 采用上中下布局,移动端使用顶部侧边导航栏 @@ -307,7 +308,8 @@ const LayoutSlug = props => {
    - + + {post && } @@ -395,11 +397,11 @@ const Layout404 = props => { 404
    请尝试站内搜索寻找文章
    - + - + @@ -433,7 +435,7 @@ const LayoutCategoryIndex = props => { className='duration-200 flex flex-wrap m-10 justify-center'> {categoryOptions?.map(category => { return ( - { {category.count} - + ) })} @@ -475,7 +477,7 @@ const LayoutTagIndex = props => { className='duration-200 flex flex-wrap space-x-5 space-y-5 m-10 justify-center'> {tagOptions.map(tag => { return ( - { {tag.count} - + ) })} diff --git a/themes/hexo/components/ArticleAdjacent.js b/themes/hexo/components/ArticleAdjacent.js index dc6a5b99..f1b2f847 100644 --- a/themes/hexo/components/ArticleAdjacent.js +++ b/themes/hexo/components/ArticleAdjacent.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { siteConfig } from '@/lib/config' @@ -13,22 +13,22 @@ export default function ArticleAdjacent ({ prev, next }) { } return (
    - {prev.title} - - + {next.title} - +
    ) } diff --git a/themes/hexo/components/ArticleCopyright.js b/themes/hexo/components/ArticleCopyright.js index af3808a2..2115453e 100644 --- a/themes/hexo/components/ArticleCopyright.js +++ b/themes/hexo/components/ArticleCopyright.js @@ -1,11 +1,12 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import CONFIG from '../config' import { siteConfig } from '@/lib/config' +import NotByAI from '@/components/NotByAI' -export default function ArticleCopyright () { +export default function ArticleCopyright() { const router = useRouter() const [path, setPath] = useState(siteConfig('LINK') + router.asPath) useEffect(() => { @@ -19,17 +20,19 @@ export default function ArticleCopyright () { } return ( -
    -
      +
      +
      • {locale.COMMON.AUTHOR}: - + {siteConfig('AUTHOR')} - +
      • - {locale.COMMON.URL}: - + {locale.COMMON.URL}: + {path}
      • @@ -37,7 +40,12 @@ export default function ArticleCopyright () { {locale.COMMON.COPYRIGHT}: {locale.COMMON.COPYRIGHT_NOTICE} + {siteConfig('HEXO_ARTICLE_NOT_BY_AI', false, CONFIG) && ( +
      • + +
      • + )}
      - ); + ) } diff --git a/themes/hexo/components/ArticleRecommend.js b/themes/hexo/components/ArticleRecommend.js index b3f9e73a..30c9d56c 100644 --- a/themes/hexo/components/ArticleRecommend.js +++ b/themes/hexo/components/ArticleRecommend.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -35,7 +35,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) { : siteInfo?.pageCover return ( - - + ) })} diff --git a/themes/hexo/components/BlogPostArchive.js b/themes/hexo/components/BlogPostArchive.js index e296eaef..b18b6797 100644 --- a/themes/hexo/components/BlogPostArchive.js +++ b/themes/hexo/components/BlogPostArchive.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博客归档列表 @@ -27,12 +27,12 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
      {post.date?.start_date}{' '}   - {post.title} - +
      ) diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index 47b7f8b8..ba901793 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -1,6 +1,6 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { BlogPostCardInfo } from './BlogPostCardInfo' @@ -45,7 +45,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { {/* 图片封面 */} {showPageCover && (
      - + <> { className='h-56 w-full object-cover object-center group-hover:scale-110 duration-500' /> - +
      )} diff --git a/themes/hexo/components/BlogPostCardInfo.js b/themes/hexo/components/BlogPostCardInfo.js index 80f8f0f5..71c1ce36 100644 --- a/themes/hexo/components/BlogPostCardInfo.js +++ b/themes/hexo/components/BlogPostCardInfo.js @@ -3,7 +3,7 @@ import NotionPage from '@/components/NotionPage' import TwikooCommentCount from '@/components/TwikooCommentCount' import { siteConfig } from '@/lib/config' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import TagItemMini from './TagItemMini' /** @@ -24,7 +24,7 @@ export const BlogPostCardInfo = ({

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

      {/* 分类 */} @@ -43,13 +43,13 @@ export const BlogPostCardInfo = ({ className={`flex mt-2 items-center ${ showPreview ? 'justify-center' : 'justify-start' } flex-wrap dark:text-gray-500 text-gray-400 `}> - {post.category} - + {/* 日期 */} - {post?.publishDay || post.lastEditedDay} - +
      diff --git a/themes/hexo/components/CategoryGroup.js b/themes/hexo/components/CategoryGroup.js index 69aa4c1c..4d0c43d0 100644 --- a/themes/hexo/components/CategoryGroup.js +++ b/themes/hexo/components/CategoryGroup.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const CategoryGroup = ({ currentCategory, categories }) => { if (!categories) { @@ -9,7 +9,7 @@ const CategoryGroup = ({ currentCategory, categories }) => { {categories.map(category => { const selected = currentCategory === category.name return ( - {
      {category.name}({category.count})
      - + ); })}
      diff --git a/themes/hexo/components/Header.js b/themes/hexo/components/Header.js index 29a83d71..d318c264 100644 --- a/themes/hexo/components/Header.js +++ b/themes/hexo/components/Header.js @@ -1,7 +1,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import throttle from 'lodash.throttle' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useCallback, useEffect, useRef, useState } from 'react' import CONFIG from '../config' @@ -106,12 +106,12 @@ const Header = props => { {locale.COMMON.CATEGORY}
      - {locale.COMMON.MORE} - + { {locale.COMMON.TAGS} - {locale.COMMON.MORE} - +
      diff --git a/themes/hexo/components/HexoRecentComments.js b/themes/hexo/components/HexoRecentComments.js index db712bea..f1e59612 100644 --- a/themes/hexo/components/HexoRecentComments.js +++ b/themes/hexo/components/HexoRecentComments.js @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { siteConfig } from '@/lib/config' import Card from '@/themes/hexo/components/Card' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' /** @@ -36,7 +36,7 @@ const HexoRecentComments = (props) => { {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
      - --{comment.nick} + --{comment.nick}
      )} diff --git a/themes/hexo/components/LatestPostsGroup.js b/themes/hexo/components/LatestPostsGroup.js index 5a0a0161..673ea3db 100644 --- a/themes/hexo/components/LatestPostsGroup.js +++ b/themes/hexo/components/LatestPostsGroup.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import { useGlobal } from '@/lib/global' // import Image from 'next/image' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -34,7 +34,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => { const selected = currentPath === post?.href return ( - {
      {post.lastEditedDay}
      - + ) })} diff --git a/themes/hexo/components/Logo.js b/themes/hexo/components/Logo.js index 2279834c..b150456c 100644 --- a/themes/hexo/components/Logo.js +++ b/themes/hexo/components/Logo.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * Logo * 实际值支持文字 @@ -9,14 +9,14 @@ import Link from 'next/link' const Logo = props => { const { siteInfo } = props return ( - +
      {' '} {siteInfo?.title || siteConfig('TITLE')}
      - +
      ) } export default Logo diff --git a/themes/hexo/components/MenuGroupCard.js b/themes/hexo/components/MenuGroupCard.js index de0368e2..28675cc1 100644 --- a/themes/hexo/components/MenuGroupCard.js +++ b/themes/hexo/components/MenuGroupCard.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' const MenuGroupCard = props => { @@ -46,7 +46,7 @@ const MenuGroupCard = props => { {links.map(link => { if (link.show) { return ( - {
      {link.name}
      {link.slot}
      - + ) } else { return null diff --git a/themes/hexo/components/MenuItemCollapse.js b/themes/hexo/components/MenuItemCollapse.js index 0281388f..d01d98b2 100644 --- a/themes/hexo/components/MenuItemCollapse.js +++ b/themes/hexo/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -32,7 +32,7 @@ export const MenuItemCollapse = props => { className='w-full px-8 py-3 dark:hover:bg-indigo-500 hover:bg-indigo-500 hover:text-white text-left dark:bg-hexo-black-gray' onClick={toggleShow}> {!hasSubMenu && ( - @@ -40,7 +40,7 @@ export const MenuItemCollapse = props => { {link?.icon && } {link?.name} - + )} {hasSubMenu && (
      {
      - + {link?.icon && }{' '} {sLink.title} - +
      ) })} diff --git a/themes/hexo/components/MenuItemDrop.js b/themes/hexo/components/MenuItemDrop.js index 09d4eb3b..594c1f70 100644 --- a/themes/hexo/components/MenuItemDrop.js +++ b/themes/hexo/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** * 支持二级展开的菜单 @@ -18,13 +18,13 @@ export const MenuItemDrop = ({ link }) => { onMouseOver={() => changeShow(true)} onMouseOut={() => changeShow(false)}> {!hasSubMenu && ( - {link?.icon && } {link?.name} {hasSubMenu && } - + )} {hasSubMenu && ( @@ -51,12 +51,12 @@ export const MenuItemDrop = ({ link }) => {
    • - + {link?.icon &&   } {sLink.title} - +
    • ) })} diff --git a/themes/hexo/components/NavButtonGroup.js b/themes/hexo/components/NavButtonGroup.js index 8539eb49..8d671a7a 100644 --- a/themes/hexo/components/NavButtonGroup.js +++ b/themes/hexo/components/NavButtonGroup.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 首页导航大按钮组件 @@ -15,14 +15,14 @@ const NavButtonGroup = (props) => { diff --git a/themes/hexo/components/PaginationNumber.js b/themes/hexo/components/PaginationNumber.js index 57d755dd..2179500d 100644 --- a/themes/hexo/components/PaginationNumber.js +++ b/themes/hexo/components/PaginationNumber.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -22,7 +22,7 @@ const PaginationNumber = ({ page, totalPage }) => { return (
      {/* 上一页 */} - { rel='prev' className={`${currentPage === 1 ? 'invisible' : 'block'} pb-0.5 hover:bg-indigo-400 hover:text-white w-6 text-center cursor-pointer duration-200 hover:font-bold`}> - + {pages} {/* 下一页 */} - { rel='next' className={`${+showNext ? 'block' : 'invisible'} pb-0.5 hover:bg-indigo-400 hover:text-white w-6 text-center cursor-pointer duration-200 hover:font-bold`}> - +
      ) } @@ -61,7 +61,7 @@ const PaginationNumber = ({ page, totalPage }) => { function getPageElement(page, currentPage, pagePrefix) { const selected = page + '' === currentPage + '' return ( - {page} - + ) } diff --git a/themes/hexo/components/PostHero.js b/themes/hexo/components/PostHero.js index 4cedf597..ec6b797c 100644 --- a/themes/hexo/components/PostHero.js +++ b/themes/hexo/components/PostHero.js @@ -3,7 +3,7 @@ import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import TagItemMini from './TagItemMini' /** @@ -38,14 +38,14 @@ export default function PostHero({ post, siteInfo }) {
      {post.category && ( <> -
      {post.category}
      - + )}
      @@ -62,12 +62,12 @@ export default function PostHero({ post, siteInfo }) {
      {post?.type !== 'Page' && ( <> - {locale.COMMON.POST_TIME}: {post?.publishDay} - + )}
      diff --git a/themes/hexo/components/SearchNav.js b/themes/hexo/components/SearchNav.js index 359f5c8c..0cad9d57 100644 --- a/themes/hexo/components/SearchNav.js +++ b/themes/hexo/components/SearchNav.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useRef } from 'react' import Card from './Card' import SearchInput from './SearchInput' @@ -31,7 +31,7 @@ export default function SearchNav(props) {
      {categoryOptions?.map(category => { return ( - {category.name}({category.count})
      - + ) })}
      diff --git a/themes/hexo/components/SlotBar.js b/themes/hexo/components/SlotBar.js index a41b0695..4e4879ec 100644 --- a/themes/hexo/components/SlotBar.js +++ b/themes/hexo/components/SlotBar.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博客列表上方嵌入条 @@ -10,10 +10,10 @@ export default function SlotBar(props) { if (tag) { return
      -
      #{tag}
      - +
      } else if (category) { return
      diff --git a/themes/hexo/components/TagItemMini.js b/themes/hexo/components/TagItemMini.js index 32221ea4..98f6dad2 100644 --- a/themes/hexo/components/TagItemMini.js +++ b/themes/hexo/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - {
      {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
      - + ); } diff --git a/themes/hexo/config.js b/themes/hexo/config.js index c4b0be31..a6fc222a 100644 --- a/themes/hexo/config.js +++ b/themes/hexo/config.js @@ -32,6 +32,7 @@ const CONFIG = { HEXO_ARTICLE_ADJACENT: true, // 显示上一篇下一篇文章推荐 HEXO_ARTICLE_COPYRIGHT: true, // 显示文章版权声明 + HEXO_ARTICLE_NOT_BY_AI: false, // 显示非AI写作 HEXO_ARTICLE_RECOMMEND: true, // 文章关联推荐 HEXO_WIDGET_LATEST_POSTS: true, // 显示最新文章卡 diff --git a/themes/hexo/index.js b/themes/hexo/index.js index 30d0fc46..8e8c33b3 100644 --- a/themes/hexo/index.js +++ b/themes/hexo/index.js @@ -7,7 +7,7 @@ import { useGlobal } from '@/lib/global' import { isBrowser } from '@/lib/utils' import { Transition } from '@headlessui/react' import dynamic from 'next/dynamic' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef } from 'react' import ArticleAdjacent from './components/ArticleAdjacent' @@ -377,7 +377,7 @@ const LayoutCategoryIndex = props => {
      {categoryOptions?.map(category => { return ( - { {category.name}( {category.count})
      - + ) })}
      diff --git a/themes/landing/components/Footer.js b/themes/landing/components/Footer.js index 3f27b76f..98c00fe1 100644 --- a/themes/landing/components/Footer.js +++ b/themes/landing/components/Footer.js @@ -1,5 +1,5 @@ import { subscribeToNewsletter } from '@/lib/plugins/mailchimp' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useRef, useState } from 'react' import CONFIG from '../config' import Logo from './Logo' @@ -45,7 +45,7 @@ export default function Footer() {
      - 服务条款 · 隐私政策 + 服务条款 · 隐私政策
      diff --git a/themes/landing/components/Header.js b/themes/landing/components/Header.js index 2b71d944..a6b9c2e0 100644 --- a/themes/landing/components/Header.js +++ b/themes/landing/components/Header.js @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import Logo from './Logo' import MobileMenu from './MobileMenu' import CONFIG from '../config' @@ -36,17 +36,17 @@ export default function Header() { {/* Desktop sign in links */}
      • - +
        {siteConfig('LANDING_HEADER_BUTTON_1_TITLE', null, CONFIG)}
        - +
      • - + {siteConfig('LANDING_HEADER_BUTTON_2_TITLE', null, CONFIG)} - +
      diff --git a/themes/landing/components/Logo.js b/themes/landing/components/Logo.js index 313d7656..aec60abf 100644 --- a/themes/landing/components/Logo.js +++ b/themes/landing/components/Logo.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function Logo() { return ( - + - + ) } diff --git a/themes/landing/components/MobileMenu.js b/themes/landing/components/MobileMenu.js index c61e325b..9d1be106 100644 --- a/themes/landing/components/MobileMenu.js +++ b/themes/landing/components/MobileMenu.js @@ -2,7 +2,7 @@ import { useState, useRef, useEffect } from 'react' import { Transition } from '@headlessui/react' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { siteConfig } from '@/lib/config' @@ -67,17 +67,17 @@ export default function MobileMenu() { >
      • - setMobileNavOpen(false)}> + setMobileNavOpen(false)}>
        {siteConfig('LANDING_HEADER_BUTTON_1_TITLE', null, CONFIG)}
        - +
      • - setMobileNavOpen(false)}> + setMobileNavOpen(false)}> {siteConfig('LANDING_HEADER_BUTTON_2_TITLE', null, CONFIG)} - +
      diff --git a/themes/landing/components/Pricing.js b/themes/landing/components/Pricing.js index 973c6a1b..4a99242d 100644 --- a/themes/landing/components/Pricing.js +++ b/themes/landing/components/Pricing.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import CONFIG from '../config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 价格收费表 @@ -21,9 +21,9 @@ export const Pricing = (props) => { )}
    - + - +
    @@ -34,9 +34,9 @@ export const Pricing = (props) => { )}
    - + - +
    @@ -47,9 +47,9 @@ export const Pricing = (props) => { )}
    - + - +
    diff --git a/themes/magzine/components/BannerItem.js b/themes/magzine/components/BannerItem.js index b83f79f5..732a4b7d 100644 --- a/themes/magzine/components/BannerItem.js +++ b/themes/magzine/components/BannerItem.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -28,7 +28,7 @@ export default function BannerItem() {

    {description}

    {button && (
    - {text} + {text}
    )} {tips} diff --git a/themes/magzine/components/CategoryGroup.js b/themes/magzine/components/CategoryGroup.js index 5f2d8b68..c37f5e2c 100644 --- a/themes/magzine/components/CategoryGroup.js +++ b/themes/magzine/components/CategoryGroup.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 分类 @@ -18,7 +18,7 @@ const CategoryGroup = ({ currentCategory, categoryOptions }) => { {categoryOptions?.map((category, index) => { const selected = currentCategory === category.name return ( - { {category.name} {category?.count && `(${category?.count})`} - + ) })} diff --git a/themes/magzine/components/CategoryItem.js b/themes/magzine/components/CategoryItem.js index f4cff30b..f7978853 100644 --- a/themes/magzine/components/CategoryItem.js +++ b/themes/magzine/components/CategoryItem.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function CategoryItem({ selected, category, categoryCount }) { return ( - {category} {categoryCount && `(${categoryCount})`} - + ) } diff --git a/themes/magzine/components/Footer.js b/themes/magzine/components/Footer.js index 47a11a20..27a48254 100644 --- a/themes/magzine/components/Footer.js +++ b/themes/magzine/components/Footer.js @@ -7,7 +7,7 @@ import LazyImage from '@/components/LazyImage' import PoweredBy from '@/components/PoweredBy' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import SocialButton from './SocialButton' @@ -56,9 +56,9 @@ const Footer = ({ title }) => { {group?.menus?.map((menu, index) => { return (
    - + {menu.title} - +
    ) })} diff --git a/themes/magzine/components/LeftMenuBar.js b/themes/magzine/components/LeftMenuBar.js index 6bde6c51..6f9da093 100644 --- a/themes/magzine/components/LeftMenuBar.js +++ b/themes/magzine/components/LeftMenuBar.js @@ -1,14 +1,14 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function LeftMenuBar () { return (
    - +
    - +
    ); diff --git a/themes/magzine/components/LogoBar.js b/themes/magzine/components/LogoBar.js index 25490c47..80bb0632 100644 --- a/themes/magzine/components/LogoBar.js +++ b/themes/magzine/components/LogoBar.js @@ -1,13 +1,13 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function LogoBar({ siteInfo, className }) { return (
    - {siteConfig('TITLE')} - +
    ) } diff --git a/themes/magzine/components/MenuItemCollapse.js b/themes/magzine/components/MenuItemCollapse.js index 56329755..523ff790 100644 --- a/themes/magzine/components/MenuItemCollapse.js +++ b/themes/magzine/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' @@ -47,7 +47,7 @@ export const MenuItemCollapse = props => { } onClick={toggleShow}> {!hasSubMenu && ( - @@ -55,7 +55,7 @@ export const MenuItemCollapse = props => {
    {link.name}
    - + )} {hasSubMenu && ( @@ -84,14 +84,14 @@ export const MenuItemCollapse = props => { className=' not:last-child:border-b-0 border-b dark:border-gray-800 py-2 pl-12 cursor-pointer hover:bg-gray-100 dark:text-gray-200 dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'> - +
    {sLink.title}
    - +
    ) })} diff --git a/themes/magzine/components/MenuItemDrop.js b/themes/magzine/components/MenuItemDrop.js index f0dcde4c..09f2a6b5 100644 --- a/themes/magzine/components/MenuItemDrop.js +++ b/themes/magzine/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -43,9 +43,9 @@ export const MenuItemDrop = ({ link }) => { ? 'bg-gray-600 text-white hover:text-white' : 'hover:text-gray-600') }> - + {link?.icon && } {link?.name} - + )} @@ -58,12 +58,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon && } {sLink.title} - +
  • ) })} diff --git a/themes/magzine/components/MenuItemMobileNormal.js b/themes/magzine/components/MenuItemMobileNormal.js index 33569bfb..63e496af 100644 --- a/themes/magzine/components/MenuItemMobileNormal.js +++ b/themes/magzine/components/MenuItemMobileNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const NormalMenu = props => { @@ -12,7 +12,7 @@ export const NormalMenu = props => { const selected = router.pathname === link.href || router.asPath === link.href return ( - {
    {link.name}
    {link.slot} - +
    ) } diff --git a/themes/magzine/components/MenuItemPCNormal.js b/themes/magzine/components/MenuItemPCNormal.js index e93ca07f..a88d2632 100644 --- a/themes/magzine/components/MenuItemPCNormal.js +++ b/themes/magzine/components/MenuItemPCNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const MenuItemPCNormal = props => { @@ -10,7 +10,7 @@ export const MenuItemPCNormal = props => { } return ( - {
    {link.name}
    {link.slot} - + ) } diff --git a/themes/magzine/components/PaginationSimple.js b/themes/magzine/components/PaginationSimple.js index 0fcbebab..6ae9f2ab 100644 --- a/themes/magzine/components/PaginationSimple.js +++ b/themes/magzine/components/PaginationSimple.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -21,7 +21,7 @@ const PaginationSimple = ({ page, totalPage }) => { return (
    - { currentPage === 1 ? 'invisible' : 'block' } text-center w-full duration-200 px-4 py-2 hover:border-gray-500 border-b-2 hover:font-bold`}> ←{locale.PAGINATION.PREV} - - + { +showNext ? 'block' : 'invisible' } text-center w-full duration-200 px-4 py-2 hover:border-gray-500 border-b-2 hover:font-bold`}> {locale.PAGINATION.NEXT}→ - +
    ) } diff --git a/themes/magzine/components/PostGroupLatest.js b/themes/magzine/components/PostGroupLatest.js index c354af17..1dcdb5c9 100644 --- a/themes/magzine/components/PostGroupLatest.js +++ b/themes/magzine/components/PostGroupLatest.js @@ -2,7 +2,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' // import Image from 'next/image' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -38,7 +38,7 @@ const PostGroupLatest = props => { : siteInfo?.pageCover return ( - {
    {post.lastEditedDay}
    - + ) })} diff --git a/themes/magzine/components/PostItemCard.js b/themes/magzine/components/PostItemCard.js index 09a9352a..d0b2799b 100644 --- a/themes/magzine/components/PostItemCard.js +++ b/themes/magzine/components/PostItemCard.js @@ -3,7 +3,7 @@ import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CategoryItem from './CategoryItem' /** @@ -17,7 +17,7 @@ const PostItemCard = ({ post }) => {
    {siteConfig('MAGZINE_POST_LIST_COVER') && ( - { className='w-full h-40 aspect-video object-cover' />
    - + )} {siteConfig('MAGZINE_POST_LIST_CATEGORY') && ( )} - { )} {post.title} - +
    {formatDateFmt(post.publishDate, 'yyyy-MM')} diff --git a/themes/magzine/components/PostItemCardSimple.js b/themes/magzine/components/PostItemCardSimple.js index 924876e6..026ad0f7 100644 --- a/themes/magzine/components/PostItemCardSimple.js +++ b/themes/magzine/components/PostItemCardSimple.js @@ -1,6 +1,6 @@ import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CategoryItem from './CategoryItem' /** @@ -20,7 +20,7 @@ const PostItemCardSimple = ({ post }) => {
    {/* 文章标题 */} - { {siteConfig('POST_TITLE_ICON') && } {post.title} - +
    {post.date?.start_date}
    diff --git a/themes/magzine/components/PostItemCardTop.js b/themes/magzine/components/PostItemCardTop.js index 9462507f..25dde622 100644 --- a/themes/magzine/components/PostItemCardTop.js +++ b/themes/magzine/components/PostItemCardTop.js @@ -3,7 +3,7 @@ import NotionIcon from '@/components/NotionIcon' import NotionPage from '@/components/NotionPage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import CategoryItem from './CategoryItem' import TagItemMini from './TagItemMini' @@ -28,7 +28,7 @@ const PostItemCardTop = ({ post, showSummary }) => {
    {siteConfig('MAGZINE_POST_LIST_COVER', true, CONFIG) && post?.pageCoverThumbnail && ( - { className='w-full h-80 object-cover hover:scale-125 duration-150' />
    - + )}
    @@ -60,7 +60,7 @@ const PostItemCardTop = ({ post, showSummary }) => {
    - { )} {post?.title} - +
    @@ -87,13 +87,13 @@ const PostItemCardTop = ({ post, showSummary }) => {
    - {locale.COMMON.ARTICLE_DETAIL} - +
    diff --git a/themes/magzine/components/PostItemCardWide.js b/themes/magzine/components/PostItemCardWide.js index 2aec9a8e..47a63ce6 100644 --- a/themes/magzine/components/PostItemCardWide.js +++ b/themes/magzine/components/PostItemCardWide.js @@ -3,7 +3,7 @@ import NotionIcon from '@/components/NotionIcon' import NotionPage from '@/components/NotionPage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CategoryItem from './CategoryItem' /** @@ -21,7 +21,7 @@ const PostItemCardWide = ({ post, showSummary }) => { {siteConfig('MAGZINE_POST_LIST_CATEGORY') && ( )} - { )} {post?.title} - + {(!showPreview || showSummary) && (
    @@ -46,13 +46,13 @@ const PostItemCardWide = ({ post, showSummary }) => {
    - {locale.COMMON.ARTICLE_DETAIL} - +
    diff --git a/themes/magzine/components/PostListHorizontal.js b/themes/magzine/components/PostListHorizontal.js index 5e5544df..3dc65bdf 100644 --- a/themes/magzine/components/PostListHorizontal.js +++ b/themes/magzine/components/PostListHorizontal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import PostItemCard from './PostItemCard' import PostListEmpty from './PostListEmpty' import Swiper from './Swiper' @@ -23,12 +23,12 @@ const PostListHorizontal = ({ title, href, posts, hasBg }) => {

    {title}

    {href && ( - 查看全部 - + )}
    {/* 列表 */} @@ -40,10 +40,10 @@ const PostListHorizontal = ({ title, href, posts, hasBg }) => {
    {href && ( - + 查看全部 - + )}
    diff --git a/themes/magzine/components/PostListSimpleHorizontal.js b/themes/magzine/components/PostListSimpleHorizontal.js index 2268a428..30a7aac5 100644 --- a/themes/magzine/components/PostListSimpleHorizontal.js +++ b/themes/magzine/components/PostListSimpleHorizontal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import PostItemCardSimple from './PostItemCardSimple' import PostListEmpty from './PostListEmpty' @@ -19,12 +19,12 @@ const PostSimpleListHorizontal = ({ title, href, posts }) => {

    {title}

    {href && ( - 查看全部 - + )}
    {/* 列表 */} @@ -34,10 +34,10 @@ const PostSimpleListHorizontal = ({ title, href, posts }) => { })} {href && ( - + 查看全部 - + )} diff --git a/themes/magzine/components/PostNavAround.js b/themes/magzine/components/PostNavAround.js index 754e1257..657bb9c4 100644 --- a/themes/magzine/components/PostNavAround.js +++ b/themes/magzine/components/PostNavAround.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' @@ -63,7 +63,7 @@ export default function PostNavAround({ prev, next }) {
    {/* 移动端 */}
    - @@ -71,8 +71,8 @@ export default function PostNavAround({ prev, next }) {
    {prev.title}
    - - + @@ -80,7 +80,7 @@ export default function PostNavAround({ prev, next }) {
    {next.title}
    - +
    {/* 桌面端 */} @@ -88,13 +88,13 @@ export default function PostNavAround({ prev, next }) {
    ) diff --git a/themes/magzine/components/TagItemMini.js b/themes/magzine/components/TagItemMini.js index e8e2987c..93f94311 100644 --- a/themes/magzine/components/TagItemMini.js +++ b/themes/magzine/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - { {/* {selected && } */}# {tag.name + (tag.count ? `(${tag.count})` : '')}{' '} - + ) } diff --git a/themes/magzine/components/TouchMeCard.js b/themes/magzine/components/TouchMeCard.js index a2a46c1c..16613949 100644 --- a/themes/magzine/components/TouchMeCard.js +++ b/themes/magzine/components/TouchMeCard.js @@ -1,6 +1,6 @@ import FlipCard from '@/components/FlipCard' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -28,11 +28,11 @@ export default function TouchMeCard() { } backContent={ - +
    {siteConfig('MAGZINE_SOCIAL_CARD_TITLE_3')}
    - +
    } /> diff --git a/themes/magzine/index.js b/themes/magzine/index.js index 8a0496cd..d581b1ab 100644 --- a/themes/magzine/index.js +++ b/themes/magzine/index.js @@ -12,7 +12,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { isBrowser } from '@/lib/utils' import { SignIn, SignUp } from '@clerk/nextjs' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef, useState } from 'react' import ArticleInfo from './components/ArticleInfo' @@ -415,7 +415,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {/* */} {category.name}({category.count})
    - + ) })} diff --git a/themes/matery/components/ArticleCopyright.js b/themes/matery/components/ArticleCopyright.js index 61a9aa16..b3c15b9f 100644 --- a/themes/matery/components/ArticleCopyright.js +++ b/themes/matery/components/ArticleCopyright.js @@ -1,11 +1,12 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import CONFIG from '../config' import { siteConfig } from '@/lib/config' +import NotByAI from '@/components/NotByAI' -export default function ArticleCopyright () { +export default function ArticleCopyright() { const router = useRouter() const [path, setPath] = useState(siteConfig('LINK') + router.asPath) useEffect(() => { @@ -19,17 +20,17 @@ export default function ArticleCopyright () { } return ( -
    -
      +
      +
      • {locale.COMMON.AUTHOR}: - + {siteConfig('AUTHOR')} - +
      • - {locale.COMMON.URL}: - + {locale.COMMON.URL}: + {path}
      • @@ -37,6 +38,11 @@ export default function ArticleCopyright () { {locale.COMMON.COPYRIGHT}: {locale.COMMON.COPYRIGHT_NOTICE} + {siteConfig('MATERY_ARTICLE_NOT_BY_AI', false, CONFIG) && ( +
      • + +
      • + )}
      ) diff --git a/themes/matery/components/ArticleInfo.js b/themes/matery/components/ArticleInfo.js index 010d5e85..a098e4cf 100644 --- a/themes/matery/components/ArticleInfo.js +++ b/themes/matery/components/ArticleInfo.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useGlobal } from '@/lib/global' import TagItemMiddle from './TagItemMiddle' import { formatDateFmt } from '@/lib/utils/formatDate' @@ -24,13 +24,13 @@ export const ArticleInfo = props => {
      {post?.type !== 'Page' && ( <> - {' '} {locale.COMMON.POST_TIME}: {post?.publishDay} - + {locale.COMMON.LAST_EDITED_TIME}: {post.lastEditedDay} diff --git a/themes/matery/components/ArticleRecommend.js b/themes/matery/components/ArticleRecommend.js index 58fd7398..8348e5a8 100644 --- a/themes/matery/components/ArticleRecommend.js +++ b/themes/matery/components/ArticleRecommend.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -35,7 +35,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) { : siteInfo?.pageCover return ( -
      - + ) })} diff --git a/themes/matery/components/BlogListBar.js b/themes/matery/components/BlogListBar.js index 8453e7ea..82449d36 100644 --- a/themes/matery/components/BlogListBar.js +++ b/themes/matery/components/BlogListBar.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useGlobal } from '@/lib/global' import TagItemMiddle from './TagItemMiddle' @@ -13,12 +13,12 @@ export default function BlogListBar(props) { {categoryOptions?.map(e => { const selected = e.name === category return ( - +
      {e.name}({e.count})
      - +
      ) })} diff --git a/themes/matery/components/BlogPostArchive.js b/themes/matery/components/BlogPostArchive.js index e296eaef..b18b6797 100644 --- a/themes/matery/components/BlogPostArchive.js +++ b/themes/matery/components/BlogPostArchive.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博客归档列表 @@ -27,12 +27,12 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
      {post.date?.start_date}{' '}   - {post.title} - +
      ) diff --git a/themes/matery/components/BlogPostCard.js b/themes/matery/components/BlogPostCard.js index 8d10fdf4..45b35929 100644 --- a/themes/matery/components/BlogPostCard.js +++ b/themes/matery/components/BlogPostCard.js @@ -3,7 +3,7 @@ import NotionIcon from '@/components/NotionIcon' import TwikooCommentCount from '@/components/TwikooCommentCount' import { siteConfig } from '@/lib/config' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import TagItemMini from './TagItemMini' @@ -36,7 +36,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
      {/* 头部图片 填充卡片 */} {showPageCover && ( - +
      {
      - +
      )} {/* 文字描述 */} @@ -69,25 +69,25 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
      - {post.date?.start_date || post.lastEditedDay} - +
      - {post.category} - +
      diff --git a/themes/matery/components/CategoryGroup.js b/themes/matery/components/CategoryGroup.js index 62046784..65bc7c67 100644 --- a/themes/matery/components/CategoryGroup.js +++ b/themes/matery/components/CategoryGroup.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const CategoryGroup = ({ currentCategory, categories }) => { if (!categories) { @@ -9,7 +9,7 @@ const CategoryGroup = ({ currentCategory, categories }) => { {categories.map(category => { const selected = currentCategory === category.name return ( - {
      {category.name}({category.count})
      - + ) })} diff --git a/themes/matery/components/Header.js b/themes/matery/components/Header.js index d6c195f8..127de271 100644 --- a/themes/matery/components/Header.js +++ b/themes/matery/components/Header.js @@ -2,7 +2,7 @@ import SideBarDrawer from '@/components/SideBarDrawer' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import throttle from 'lodash.throttle' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useCallback, useEffect, useRef, useState } from 'react' import CONFIG from '../config' @@ -108,12 +108,12 @@ const Header = props => { {locale.COMMON.CATEGORY} - {locale.COMMON.MORE} - + { {locale.COMMON.TAGS} - {locale.COMMON.MORE} - +
      diff --git a/themes/matery/components/HexoRecentComments.js b/themes/matery/components/HexoRecentComments.js index 29dedb38..7d0c8291 100644 --- a/themes/matery/components/HexoRecentComments.js +++ b/themes/matery/components/HexoRecentComments.js @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { siteConfig } from '@/lib/config' import Card from '@/themes/hexo/components/Card' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' /** @@ -35,7 +35,7 @@ const HexoRecentComments = (props) => { {!onLoading && comments && comments.length === 0 &&
      No Comments
      } {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
      -
      --{comment.nick}
      +
      --{comment.nick}
      )} diff --git a/themes/matery/components/Logo.js b/themes/matery/components/Logo.js index a1082ae3..2d55fa03 100644 --- a/themes/matery/components/Logo.js +++ b/themes/matery/components/Logo.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 站点logo * 这里默认只支持纯文字 @@ -9,14 +9,14 @@ import Link from 'next/link' const Logo = props => { const { siteInfo } = props return ( - +
      {' '} {siteInfo?.title || siteConfig('TITLE')}
      - +
      ) } export default Logo diff --git a/themes/matery/components/MenuGroupCard.js b/themes/matery/components/MenuGroupCard.js index 4aafb5d9..88079ae4 100644 --- a/themes/matery/components/MenuGroupCard.js +++ b/themes/matery/components/MenuGroupCard.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' const MenuGroupCard = props => { @@ -36,7 +36,7 @@ const MenuGroupCard = props => { {links.map(link => { if (link.show) { return ( - {
      {link.name}
      {link.slot}
      - + ) } else { return null diff --git a/themes/matery/components/MenuItemCollapse.js b/themes/matery/components/MenuItemCollapse.js index d1f5017b..a81c373e 100644 --- a/themes/matery/components/MenuItemCollapse.js +++ b/themes/matery/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -40,7 +40,7 @@ export const MenuItemCollapse = ({ link }) => { : ' text-black dark:text-white ') }> {!hasSubMenu && ( - +
      {link.icon && ( @@ -48,7 +48,7 @@ export const MenuItemCollapse = ({ link }) => {
      {link.name}
      {link.slot} - +
      )} {hasSubMenu && ( @@ -73,12 +73,12 @@ export const MenuItemCollapse = ({ link }) => {
      - + {sLink.title} - +
      ) })} diff --git a/themes/matery/components/MenuItemDrop.js b/themes/matery/components/MenuItemDrop.js index 15e02a02..cd642acf 100644 --- a/themes/matery/components/MenuItemDrop.js +++ b/themes/matery/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** * 菜单 @@ -17,13 +17,13 @@ export const MenuItemDrop = ({ link }) => { onMouseOver={() => changeShow(true)} onMouseOut={() => changeShow(false)}> {!hasSubMenu && ( - {link?.icon && } {link?.name} {hasSubMenu && } - + )} {hasSubMenu && ( @@ -50,12 +50,12 @@ export const MenuItemDrop = ({ link }) => {
    • - + {link?.icon &&   } {sLink.title} - +
    • ) })} diff --git a/themes/matery/components/MenuItemNormal.js b/themes/matery/components/MenuItemNormal.js index 0254089b..4af05062 100644 --- a/themes/matery/components/MenuItemNormal.js +++ b/themes/matery/components/MenuItemNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const MenuItemNormal = props => { @@ -8,7 +8,7 @@ export const MenuItemNormal = props => { const selected = router.pathname === link.href || router.asPath === link.href return ( - {
      {link.name}
      {link.slot} - + ) } diff --git a/themes/matery/components/MenuList.js b/themes/matery/components/MenuList.js index ecd306c1..44f22767 100644 --- a/themes/matery/components/MenuList.js +++ b/themes/matery/components/MenuList.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import CONFIG from '../config' @@ -58,7 +58,7 @@ const MenuList = props => { const selected = router.pathname === link.href || router.asPath === link.href return ( - {
      {link.name}
      {link.slot} - + ) } else { return null diff --git a/themes/matery/components/NavButtonGroup.js b/themes/matery/components/NavButtonGroup.js index 1b0d471e..06891e99 100644 --- a/themes/matery/components/NavButtonGroup.js +++ b/themes/matery/components/NavButtonGroup.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 首页导航大按钮组件 @@ -15,14 +15,14 @@ const NavButtonGroup = (props) => { diff --git a/themes/matery/components/PaginationNumber.js b/themes/matery/components/PaginationNumber.js index 42281b93..7c551cec 100644 --- a/themes/matery/components/PaginationNumber.js +++ b/themes/matery/components/PaginationNumber.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -18,7 +18,7 @@ const PaginationNumber = ({ page, totalPage }) => { return (
      {/* 上一页 */} - { - + {pages} {/* 下一页 */} - { - +
      ) } function getPageElement(page, currentPage, pagePrefix) { return ( - () + ) ) } diff --git a/themes/matery/components/PaginationSimple.js b/themes/matery/components/PaginationSimple.js index df2a3f1a..0f343346 100644 --- a/themes/matery/components/PaginationSimple.js +++ b/themes/matery/components/PaginationSimple.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -15,7 +15,7 @@ const PaginationSimple = ({ page, totalPage }) => { const pagePrefix = router.asPath.split('?')[0].replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '') return (
      - { } duration-200 px-3.5 py-2 hover:border-black rounded-full`} > - - + { > - +
      ) } diff --git a/themes/matery/components/SearchNav.js b/themes/matery/components/SearchNav.js index fb13f6ae..f829d0df 100644 --- a/themes/matery/components/SearchNav.js +++ b/themes/matery/components/SearchNav.js @@ -2,7 +2,7 @@ import SearchInput from './SearchInput' import TagItemMini from './TagItemMini' import Card from './Card' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useRef } from 'react' import { useGlobal } from '@/lib/global' @@ -34,11 +34,11 @@ export default function SearchNave(props) {
      {categoryOptions?.map(category => { return ( - +
      {category.name}({category.count})
      - +
      ) })}
      diff --git a/themes/matery/components/TagItemMiddle.js b/themes/matery/components/TagItemMiddle.js index 8da44092..7cddd701 100644 --- a/themes/matery/components/TagItemMiddle.js +++ b/themes/matery/components/TagItemMiddle.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMiddle = ({ tag, selected = false }) => { return ( - { {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')} - + ) } diff --git a/themes/matery/components/TagItemMini.js b/themes/matery/components/TagItemMini.js index 28a1d970..fd7b2fb1 100644 --- a/themes/matery/components/TagItemMini.js +++ b/themes/matery/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - {
      {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
      - + ) } diff --git a/themes/matery/config.js b/themes/matery/config.js index 705d3765..5835051c 100644 --- a/themes/matery/config.js +++ b/themes/matery/config.js @@ -1,7 +1,12 @@ const CONFIG = { MATERY_HOME_BANNER_ENABLE: true, // 3.14.1以后的版本中,欢迎语在blog.config.js中配置,用英文逗号','隔开多个。 - MATERY_HOME_BANNER_GREETINGS: ['Hi,我是一个程序员', 'Hi,我是一个打工人', 'Hi,我是一个干饭人', '欢迎来到我的博客🎉'], // 首页大图标语文字 + MATERY_HOME_BANNER_GREETINGS: [ + 'Hi,我是一个程序员', + 'Hi,我是一个打工人', + 'Hi,我是一个干饭人', + '欢迎来到我的博客🎉' + ], // 首页大图标语文字 MATERY_HOME_NAV_BUTTONS: true, // 首页是否显示分类大图标按钮 MATERY_HOME_NAV_BACKGROUND_IMG_FIXED: false, // 首页背景图滚动时是否固定,true 则滚动时图片不懂; false则随鼠标滚动 @@ -21,6 +26,7 @@ const CONFIG = { MATERY_ARTICLE_ADJACENT: true, // 显示上一篇下一篇文章推荐 MATERY_ARTICLE_COPYRIGHT: true, // 显示文章版权声明 + MATERY_ARTICLE_NOT_BY_AI: false, // 显示非AI写作 MATERY_ARTICLE_RECOMMEND: true, // 文章关联推荐 MATERY_WIDGET_LATEST_POSTS: true, // 显示最新文章卡 diff --git a/themes/matery/index.js b/themes/matery/index.js index 25234e7c..6ae66215 100644 --- a/themes/matery/index.js +++ b/themes/matery/index.js @@ -10,7 +10,7 @@ import { useGlobal } from '@/lib/global' import { loadWowJS } from '@/lib/plugins/wow' import { isBrowser } from '@/lib/utils' import dynamic from 'next/dynamic' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef } from 'react' import Announcement from './components/Announcement' @@ -359,7 +359,7 @@ const LayoutCategoryIndex = props => {
      {categoryOptions?.map(e => { return ( - {
      {e.name}({e.count})
      - + ) })}
      diff --git a/themes/medium/components/ArticleAround.js b/themes/medium/components/ArticleAround.js index 95b6f83f..27b54681 100644 --- a/themes/medium/components/ArticleAround.js +++ b/themes/medium/components/ArticleAround.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 上一篇,下一篇文章 @@ -11,22 +11,22 @@ export default function ArticleAround ({ prev, next }) { } return (
      - {prev.title} - - + {next.title} - +
      ) } diff --git a/themes/medium/components/ArticleInfo.js b/themes/medium/components/ArticleInfo.js index c1961fb6..45b7f3f9 100644 --- a/themes/medium/components/ArticleInfo.js +++ b/themes/medium/components/ArticleInfo.js @@ -1,5 +1,5 @@ import LazyImage from '@/components/LazyImage' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { siteConfig } from '@/lib/config' import NotionIcon from '@/components/NotionIcon' @@ -25,7 +25,7 @@ export default function ArticleInfo(props) { - +
      @@ -33,7 +33,7 @@ export default function ArticleInfo(props) { {siteConfig('AUTHOR')}
      - +
    ) } diff --git a/themes/medium/components/BlogArchiveItem.js b/themes/medium/components/BlogArchiveItem.js index 7d7b5a1c..a6d77c51 100644 --- a/themes/medium/components/BlogArchiveItem.js +++ b/themes/medium/components/BlogArchiveItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 归档分组 @@ -20,12 +20,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
    {post.date?.start_date}{' '}   - {post.title} - +
    ) diff --git a/themes/medium/components/BlogPostCard.js b/themes/medium/components/BlogPostCard.js index a688f601..974f6547 100644 --- a/themes/medium/components/BlogPostCard.js +++ b/themes/medium/components/BlogPostCard.js @@ -4,7 +4,7 @@ import NotionPage from '@/components/NotionPage' import TwikooCommentCount from '@/components/TwikooCommentCount' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import CategoryItem from './CategoryItem' import TagItemMini from './TagItemMini' @@ -22,7 +22,7 @@ const BlogPostCard = ({ post, showSummary }) => { data-aos-anchor-placement='top-bottom' className='mb-6 max-w-7xl border-b dark:border-gray-800 '>
    - { )} {post.title} - +
    {
    - {locale.COMMON.ARTICLE_DETAIL} - +
    diff --git a/themes/medium/components/BottomMenuBar.js b/themes/medium/components/BottomMenuBar.js index c04269c2..9b0aa4df 100644 --- a/themes/medium/components/BottomMenuBar.js +++ b/themes/medium/components/BottomMenuBar.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useMediumGlobal } from '..' import JumpToTopButton from './JumpToTopButton' @@ -17,11 +17,11 @@ export default function BottomMenuBar({ post, className }) { className }>
    - +
    - +
    @@ -33,11 +33,11 @@ export default function BottomMenuBar({ post, className }) {
    )} {!showTocButton && ( - +
    - +
    )} diff --git a/themes/medium/components/CategoryItem.js b/themes/medium/components/CategoryItem.js index 779488de..8b7cbcfc 100644 --- a/themes/medium/components/CategoryItem.js +++ b/themes/medium/components/CategoryItem.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function CategoryItem ({ selected, category, categoryCount }) { return ( - {category} {categoryCount && `(${categoryCount})`} - + ); } diff --git a/themes/medium/components/LeftMenuBar.js b/themes/medium/components/LeftMenuBar.js index 6bde6c51..6f9da093 100644 --- a/themes/medium/components/LeftMenuBar.js +++ b/themes/medium/components/LeftMenuBar.js @@ -1,14 +1,14 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function LeftMenuBar () { return (
    - +
    - +
    ); diff --git a/themes/medium/components/LogoBar.js b/themes/medium/components/LogoBar.js index d739425c..2bb1b891 100644 --- a/themes/medium/components/LogoBar.js +++ b/themes/medium/components/LogoBar.js @@ -1,12 +1,12 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function LogoBar(props) { return (
    - + {siteConfig('TITLE')} - +
    ) } diff --git a/themes/medium/components/MenuItemCollapse.js b/themes/medium/components/MenuItemCollapse.js index 01d40f5d..074e9510 100644 --- a/themes/medium/components/MenuItemCollapse.js +++ b/themes/medium/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -42,7 +42,7 @@ export const MenuItemCollapse = props => { } onClick={toggleShow}> {!hasSubMenu && ( - @@ -50,7 +50,7 @@ export const MenuItemCollapse = props => {
    {link.name}
    - + )} {hasSubMenu && ( @@ -79,14 +79,14 @@ export const MenuItemCollapse = props => { className=' not:last-child:border-b-0 border-b dark:border-gray-800 py-2 px-14 cursor-pointer hover:bg-gray-100 dark:text-gray-200 font-extralight dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'> - +
    {sLink.title}
    - +
    ) })} diff --git a/themes/medium/components/MenuItemDrop.js b/themes/medium/components/MenuItemDrop.js index b6c7a62c..8fa3171b 100644 --- a/themes/medium/components/MenuItemDrop.js +++ b/themes/medium/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -45,9 +45,9 @@ export const MenuItemDrop = ({ link }) => { ? 'bg-green-600 text-white hover:text-white' : 'hover:text-green-600') }> - + {link?.icon && } {link?.name} - + )} @@ -60,12 +60,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/medium/components/MenuItemMobileNormal.js b/themes/medium/components/MenuItemMobileNormal.js index 33569bfb..63e496af 100644 --- a/themes/medium/components/MenuItemMobileNormal.js +++ b/themes/medium/components/MenuItemMobileNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const NormalMenu = props => { @@ -12,7 +12,7 @@ export const NormalMenu = props => { const selected = router.pathname === link.href || router.asPath === link.href return ( - {
    {link.name}
    {link.slot} - +
    ) } diff --git a/themes/medium/components/MenuItemPCNormal.js b/themes/medium/components/MenuItemPCNormal.js index fad3307e..de8154c9 100644 --- a/themes/medium/components/MenuItemPCNormal.js +++ b/themes/medium/components/MenuItemPCNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const MenuItemPCNormal = props => { @@ -10,7 +10,7 @@ export const MenuItemPCNormal = props => { } return ( - {
    {link.name}
    {link.slot} - + ) } diff --git a/themes/medium/components/PaginationSimple.js b/themes/medium/components/PaginationSimple.js index fb3493a7..0eec5853 100644 --- a/themes/medium/components/PaginationSimple.js +++ b/themes/medium/components/PaginationSimple.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' @@ -18,7 +18,7 @@ const PaginationSimple = ({ page, totalPage }) => { return (
    - { } text-center w-full duration-200 px-4 py-2 hover:border-green-500 border-b-2 hover:font-bold`}> ←{locale.PAGINATION.PREV} - - + { } text-center w-full duration-200 px-4 py-2 hover:border-green-500 border-b-2 hover:font-bold`}> {locale.PAGINATION.NEXT}→ - +
    ) } diff --git a/themes/medium/components/TagItemMini.js b/themes/medium/components/TagItemMini.js index 9922a069..e8fde285 100644 --- a/themes/medium/components/TagItemMini.js +++ b/themes/medium/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - {
    {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
    - + ) } diff --git a/themes/medium/index.js b/themes/medium/index.js index 799a29b6..23283401 100644 --- a/themes/medium/index.js +++ b/themes/medium/index.js @@ -8,7 +8,7 @@ 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 SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useState } from 'react' import Announcement from './components/Announcement' @@ -379,7 +379,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {category.name}({category.count})
    - + ) })} diff --git a/themes/movie/components/ArchiveDateList.js b/themes/movie/components/ArchiveDateList.js index cd389028..c6ece352 100644 --- a/themes/movie/components/ArchiveDateList.js +++ b/themes/movie/components/ArchiveDateList.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function ArchiveDateList(props) { const postsSortByDate = Object.create(props.allNavPages) @@ -24,12 +24,12 @@ export default function ArchiveDateList(props) { {dates?.map((date, index) => { return (
    - {date} - +
    ) })} diff --git a/themes/movie/components/ArticleInfo.js b/themes/movie/components/ArticleInfo.js index 9997579a..8e579e44 100644 --- a/themes/movie/components/ArticleInfo.js +++ b/themes/movie/components/ArticleInfo.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export const ArticleInfo = props => { const { post } = props @@ -11,18 +11,18 @@ export const ArticleInfo = props => {

    {post?.title}

    - {post?.publishDay} - + {post?.type !== 'Page' && ( <> - + {post?.category} - + )} @@ -34,9 +34,9 @@ export const ArticleInfo = props => { )} {post?.tags?.map(tag => { return ( - + {tag} - + ) })}
    diff --git a/themes/movie/components/BlogListGroupByDate.js b/themes/movie/components/BlogListGroupByDate.js index ebc30aa5..da8e18ad 100644 --- a/themes/movie/components/BlogListGroupByDate.js +++ b/themes/movie/components/BlogListGroupByDate.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 按照日期将文章分组 @@ -21,11 +21,11 @@ export default function BlogListGroupByDate({ archiveTitle, archivePosts }) { className='border-l-2 p-1 text-xs md:text-base items-center hover:scale-x-105 hover:border-gray-500 dark:hover:border-gray-300 dark:border-gray-400 transform duration-500'>
    {post?.publishDay}   - {post.title} - +
    ) diff --git a/themes/movie/components/BlogPostCard.js b/themes/movie/components/BlogPostCard.js index fe44b8cd..e039edf7 100644 --- a/themes/movie/components/BlogPostCard.js +++ b/themes/movie/components/BlogPostCard.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import TagItemMini from './TagItemMini' const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { @@ -15,7 +15,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
    - + {/* 固定高度 ,空白用图片拉升填充 */}
    {/* 图片 填充卡片 */} @@ -54,7 +54,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
    - +
    ) } diff --git a/themes/movie/components/BlogRecommend.js b/themes/movie/components/BlogRecommend.js index ef87030e..a6bfbc22 100644 --- a/themes/movie/components/BlogRecommend.js +++ b/themes/movie/components/BlogRecommend.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -35,7 +35,7 @@ export default function BlogRecommend(props) { : siteInfo?.pageCover return ( - - + ) })} diff --git a/themes/movie/components/CategoryGroup.js b/themes/movie/components/CategoryGroup.js index 89c5f5ca..7fcb76ee 100644 --- a/themes/movie/components/CategoryGroup.js +++ b/themes/movie/components/CategoryGroup.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const CategoryGroup = props => { const { currentCategory, categoryOptions } = props @@ -16,7 +16,7 @@ const CategoryGroup = props => { {categories.map(category => { const selected = currentCategory === category.name return ( - { className={`${selected ? 'text-white fa-folder-open ' : 'text-gray-500 fa-folder '} mr-2 fas`} /> {category.name}({category.count}) - + ) })} diff --git a/themes/movie/components/CategoryItem.js b/themes/movie/components/CategoryItem.js index 1190965b..635bd69e 100644 --- a/themes/movie/components/CategoryItem.js +++ b/themes/movie/components/CategoryItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 文章分类 @@ -7,7 +7,7 @@ import Link from 'next/link' */ export default function CategoryItem({ category }) { return ( - {category.name}({category.count}) - + ) } diff --git a/themes/movie/components/ExampleRecentComments.js b/themes/movie/components/ExampleRecentComments.js index 9dbdfa7f..cf1f5bed 100644 --- a/themes/movie/components/ExampleRecentComments.js +++ b/themes/movie/components/ExampleRecentComments.js @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' /** @@ -26,7 +26,7 @@ const ExampleRecentComments = (props) => { {!onLoading && comments && comments.length === 0 &&
    No Comments
    } {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
    -
    --{comment.nick}
    +
    --{comment.nick}
    )} diff --git a/themes/movie/components/Header.js b/themes/movie/components/Header.js index e3ecba63..8e5a8480 100644 --- a/themes/movie/components/Header.js +++ b/themes/movie/components/Header.js @@ -1,7 +1,7 @@ import Collapse from '@/components/Collapse' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import { useMovieGlobal } from '..' @@ -101,11 +101,11 @@ export const Header = props => { <>
    {/* 左侧Logo */} - {siteConfig('TITLE')} - +
    {/* 右侧菜单 */} diff --git a/themes/movie/components/LatestPostsGroup.js b/themes/movie/components/LatestPostsGroup.js index 40366e37..49746e56 100644 --- a/themes/movie/components/LatestPostsGroup.js +++ b/themes/movie/components/LatestPostsGroup.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -32,7 +32,7 @@ const LatestPostsGroup = ({ latestPosts }) => { currentPath === `${siteConfig('SUB_PATH', '')}/${post.slug}` return ( - { }>
  • {post.title}
  • - + ) })}
    diff --git a/themes/movie/components/MenuItemCollapse.js b/themes/movie/components/MenuItemCollapse.js index b11dbd57..45ec1bcc 100644 --- a/themes/movie/components/MenuItemCollapse.js +++ b/themes/movie/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -32,7 +32,7 @@ export const MenuItemCollapse = props => { className='select-none w-full px-6 py-2 text-left ' onClick={toggleShow}> {!hasSubMenu && ( - @@ -40,7 +40,7 @@ export const MenuItemCollapse = props => { {link?.icon && } {link?.name} - + )} {hasSubMenu && (
    {
    - + {link?.icon && }{' '} {sLink.title} - +
    ) })} diff --git a/themes/movie/components/MenuItemDrop.js b/themes/movie/components/MenuItemDrop.js index 084c4424..45364e5f 100644 --- a/themes/movie/components/MenuItemDrop.js +++ b/themes/movie/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -14,13 +14,13 @@ export const MenuItemDrop = ({ link }) => { onMouseOver={() => changeShow(true)} onMouseOut={() => changeShow(false)}> {!hasSubMenu && ( - {link?.icon && } {link?.name} {hasSubMenu && } - + )} {hasSubMenu && ( @@ -43,12 +43,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/movie/components/NormalMenuItem.js b/themes/movie/components/NormalMenuItem.js index 2ed6f2e9..74af0f08 100644 --- a/themes/movie/components/NormalMenuItem.js +++ b/themes/movie/components/NormalMenuItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 旧的普通菜单 @@ -9,12 +9,12 @@ export const NormalMenuItem = props => { const { link } = props return ( link?.show && ( - {link.name} - + ) ) } diff --git a/themes/movie/components/PaginationNumber.js b/themes/movie/components/PaginationNumber.js index 64323b9c..d82ca8f3 100644 --- a/themes/movie/components/PaginationNumber.js +++ b/themes/movie/components/PaginationNumber.js @@ -1,6 +1,6 @@ import { ChevronDoubleRight } from '@/components/HeroIcons' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -49,7 +49,7 @@ const PaginationNumber = ({ page, totalPage }) => { {/* pc端分页按钮 */}
    {/* 上一页 */} - { {locale.PAGINATION.PREV}
    - + {/* 分页 */}
    @@ -86,7 +86,7 @@ const PaginationNumber = ({ page, totalPage }) => {
    {/* 下一页 */} - { {locale.PAGINATION.NEXT} - + {/* 移动端分页 */}
    {/* 上一页 */} - { rel='prev' className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}> {locale.PAGINATION.PREV} - + {showPrev && showNext &&
    } {/* 下一页 */} - { rel='next' className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}> {locale.PAGINATION.NEXT} - +
    ) @@ -149,7 +149,7 @@ function getPageElement(page, currentPage, pagePrefix) { return <> } return ( - {page} - + ) } diff --git a/themes/movie/components/SideBar.js b/themes/movie/components/SideBar.js index ea0531b7..70970f3a 100644 --- a/themes/movie/components/SideBar.js +++ b/themes/movie/components/SideBar.js @@ -1,7 +1,7 @@ import { siteConfig } from '@/lib/config' import Live2D from '@/components/Live2D' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import dynamic from 'next/dynamic' import Announcement from './Announcement' const ExampleRecentComments = dynamic(() => import('./ExampleRecentComments')) @@ -19,13 +19,13 @@ export const SideBar = (props) => { @@ -40,9 +40,9 @@ export const SideBar = (props) => {
      {latestPosts?.map(p => { return ( - +
    • {p.title}
    • - +
      ) })}
    diff --git a/themes/movie/components/TagGroups.js b/themes/movie/components/TagGroups.js index 597cddc1..68464cf3 100644 --- a/themes/movie/components/TagGroups.js +++ b/themes/movie/components/TagGroups.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -22,7 +22,7 @@ const TagGroups = ({ tagOptions, className }) => { {tagOptions.map((tag, index) => { const selected = currentTag === tag.name return ( - { <> )} - + ) })} diff --git a/themes/movie/components/TagItem.js b/themes/movie/components/TagItem.js index c608c8cb..2de99f65 100644 --- a/themes/movie/components/TagItem.js +++ b/themes/movie/components/TagItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 标签 @@ -8,7 +8,7 @@ import Link from 'next/link' export default function TagItem({ tag }) { return (
    - {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
    - + ) } diff --git a/themes/movie/components/TagItemMini.js b/themes/movie/components/TagItemMini.js index a4b7da1c..a60a3c65 100644 --- a/themes/movie/components/TagItemMini.js +++ b/themes/movie/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - { {selected && }{' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '} - + ) } diff --git a/themes/nav/components/ArticleAround.js b/themes/nav/components/ArticleAround.js index 58069682..98901ae8 100755 --- a/themes/nav/components/ArticleAround.js +++ b/themes/nav/components/ArticleAround.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 上一篇,下一篇文章 @@ -11,20 +11,20 @@ export default function ArticleAround({ prev, next }) { } return (
    - {prev.title} - - + {next.title} - +
    ) } diff --git a/themes/nav/components/BlogArchiveItem.js b/themes/nav/components/BlogArchiveItem.js index 7d7b5a1c..a6d77c51 100755 --- a/themes/nav/components/BlogArchiveItem.js +++ b/themes/nav/components/BlogArchiveItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 归档分组 @@ -20,12 +20,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
    {post.date?.start_date}{' '}   - {post.title} - +
    ) diff --git a/themes/nav/components/BlogPostCard.js b/themes/nav/components/BlogPostCard.js index 0f92a30a..ad7dbb13 100755 --- a/themes/nav/components/BlogPostCard.js +++ b/themes/nav/components/BlogPostCard.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' -import { checkStartWithHttp } from '@/lib/utils' -import Link from 'next/link' +import { isHttpLink } from '@/lib/utils' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import NotionIcon from './NotionIcon' @@ -21,9 +21,9 @@ const BlogPostCard = ({ post, className }) => { ? post.pageIcon + '&width=88' : post.pageIcon return ( -
    {
    - + ) } diff --git a/themes/nav/components/CategoryItem.js b/themes/nav/components/CategoryItem.js index 779488de..8b7cbcfc 100755 --- a/themes/nav/components/CategoryItem.js +++ b/themes/nav/components/CategoryItem.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function CategoryItem ({ selected, category, categoryCount }) { return ( - {category} {categoryCount && `(${categoryCount})`} - + ); } diff --git a/themes/nav/components/LeftMenuBar.js b/themes/nav/components/LeftMenuBar.js index 6bde6c51..6f9da093 100755 --- a/themes/nav/components/LeftMenuBar.js +++ b/themes/nav/components/LeftMenuBar.js @@ -1,14 +1,14 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function LeftMenuBar () { return (
    - +
    - +
    ); diff --git a/themes/nav/components/LogoBar.js b/themes/nav/components/LogoBar.js index c590a8a2..1d891f82 100755 --- a/themes/nav/components/LogoBar.js +++ b/themes/nav/components/LogoBar.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { siteConfig } from '@/lib/config' @@ -12,12 +12,12 @@ export default function LogoBar(props) { return (
    - + {/* eslint-disable-next-line @next/next/no-img-element */} {siteConfig('AUTHOR') {siteConfig('NAV_SHOW_TITLE_TEXT', null, CONFIG) && siteConfig('TITLE')} - +
    ) } diff --git a/themes/nav/components/MenuItem.js b/themes/nav/components/MenuItem.js index eb51c879..86febfb5 100644 --- a/themes/nav/components/MenuItem.js +++ b/themes/nav/components/MenuItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' import Collapse from './Collapse' @@ -43,14 +43,14 @@ export const MenuItem = ({ link }) => { ) : ( - {link?.title} - + )} @@ -63,14 +63,14 @@ export const MenuItem = ({ link }) => { const sUrl = sIsAnchor ? `#${sLink.name}` : sLink.href return (
    - + {sLink.title} - +
    ) })} diff --git a/themes/nav/components/MenuItemCollapse.js b/themes/nav/components/MenuItemCollapse.js index 065e9228..049d432c 100755 --- a/themes/nav/components/MenuItemCollapse.js +++ b/themes/nav/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -43,7 +43,7 @@ export const MenuItemCollapse = props => { } onClick={toggleShow}> {!hasSubMenu && ( - @@ -51,7 +51,7 @@ export const MenuItemCollapse = props => {
    {link.name}
    - + )} {hasSubMenu && ( @@ -84,14 +84,14 @@ export const MenuItemCollapse = props => { className=' py-2 px-14 cursor-pointer hover:bg-gray-100 dark:text-gray-400 dark:hover:text-white font-bold dark:bg-black text-left justify-start text-gray-600 bg-gray-50 bg-opacity-20 dark:hover:bg-gray-600 tracking-widest transition-all duration-200'> - +
    {sLink.title}
    - +
    ) })} diff --git a/themes/nav/components/MenuItemDrop.js b/themes/nav/components/MenuItemDrop.js index ec5b37f0..36ff8072 100755 --- a/themes/nav/components/MenuItemDrop.js +++ b/themes/nav/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -45,9 +45,9 @@ export const MenuItemDrop = ({ link }) => { ? 'bg-green-600 text-white hover:text-white' : 'hover:text-green-600') }> - + {link?.icon && } {link?.name} - + )} @@ -60,12 +60,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/nav/components/MenuItemMobileNormal.js b/themes/nav/components/MenuItemMobileNormal.js index 33569bfb..63e496af 100755 --- a/themes/nav/components/MenuItemMobileNormal.js +++ b/themes/nav/components/MenuItemMobileNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const NormalMenu = props => { @@ -12,7 +12,7 @@ export const NormalMenu = props => { const selected = router.pathname === link.href || router.asPath === link.href return ( - {
    {link.name}
    {link.slot} - +
    ) } diff --git a/themes/nav/components/MenuItemPCNormal.js b/themes/nav/components/MenuItemPCNormal.js index fad3307e..de8154c9 100755 --- a/themes/nav/components/MenuItemPCNormal.js +++ b/themes/nav/components/MenuItemPCNormal.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' export const MenuItemPCNormal = props => { @@ -10,7 +10,7 @@ export const MenuItemPCNormal = props => { } return ( - {
    {link.name}
    {link.slot} - + ) } diff --git a/themes/nav/components/NavPostList.js b/themes/nav/components/NavPostList.js index 7c382335..9683d497 100755 --- a/themes/nav/components/NavPostList.js +++ b/themes/nav/components/NavPostList.js @@ -1,5 +1,5 @@ import NavPostListEmpty from './NavPostListEmpty' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博客列表滚动分页 @@ -18,7 +18,7 @@ const NavPostList = (props) => { // const selected = currentCategory === category.name const selected = false return ( - {
    {category.name}({category.count})
    - + ) })} diff --git a/themes/nav/components/PaginationSimple.js b/themes/nav/components/PaginationSimple.js index b48259ea..90d6101b 100755 --- a/themes/nav/components/PaginationSimple.js +++ b/themes/nav/components/PaginationSimple.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' @@ -18,7 +18,7 @@ const PaginationSimple = ({ page, totalPage }) => { return (
    - { } text-center w-full duration-200 px-4 py-2 hover:border-green-500 border-b-2 hover:font-bold`}> ←{locale.PAGINATION.PREV} - - + { } text-center w-full duration-200 px-4 py-2 hover:border-green-500 border-b-2 hover:font-bold`}> {locale.PAGINATION.NEXT}→ - +
    ) } diff --git a/themes/nav/components/TagItemMini.js b/themes/nav/components/TagItemMini.js index 9922a069..e8fde285 100755 --- a/themes/nav/components/TagItemMini.js +++ b/themes/nav/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - {
    {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
    - + ) } diff --git a/themes/nav/index.js b/themes/nav/index.js index f2316aed..7b7cdc07 100755 --- a/themes/nav/index.js +++ b/themes/nav/index.js @@ -16,7 +16,7 @@ import { useGlobal } from '@/lib/global' import { isBrowser } from '@/lib/utils' import { Transition } from '@headlessui/react' import dynamic from 'next/dynamic' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useState } from 'react' import Announcement from './components/Announcement' @@ -408,7 +408,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {category.name}({category.count})
    - + ) })} diff --git a/themes/next/components/ArticleCopyright.js b/themes/next/components/ArticleCopyright.js index 236fb187..e151a505 100644 --- a/themes/next/components/ArticleCopyright.js +++ b/themes/next/components/ArticleCopyright.js @@ -1,25 +1,26 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { siteConfig } from '@/lib/config' +import NotByAI from '@/components/NotByAI' -export default function ArticleCopyright ({ author, url }) { +export default function ArticleCopyright({ author, url }) { const { locale } = useGlobal() if (!siteConfig('NEXT_ARTICLE_COPYRIGHT', null, CONFIG)) { return <> } return ( -
    -
      +
      +
      • {locale.COMMON.AUTHOR}: - + {author} - +
      • - {locale.COMMON.URL}: - + {locale.COMMON.URL}: + {url}
      • @@ -27,6 +28,11 @@ export default function ArticleCopyright ({ author, url }) { {locale.COMMON.COPYRIGHT}: {locale.COMMON.COPYRIGHT_NOTICE} + {siteConfig('NEXT_ARTICLE_NOT_BY_AI', false, CONFIG) && ( +
      • + +
      • + )}
      ) diff --git a/themes/next/components/ArticleDetail.js b/themes/next/components/ArticleDetail.js index 902cf6a6..da7fba24 100644 --- a/themes/next/components/ArticleDetail.js +++ b/themes/next/components/ArticleDetail.js @@ -7,7 +7,7 @@ import WWAds from '@/components/WWAds' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import CONFIG from '../config' import ArticleCopyright from './ArticleCopyright' @@ -69,7 +69,7 @@ export default function ArticleDetail(props) {
      {post?.type !== 'Page' && ( <> - @@ -77,7 +77,7 @@ export default function ArticleDetail(props) { {' '} {post?.publishDay}
      - + {' '} | @@ -127,12 +127,12 @@ export default function ArticleDetail(props) { {post.category && ( <> )} diff --git a/themes/next/components/BlogAround.js b/themes/next/components/BlogAround.js index 8dd93942..5fac6400 100644 --- a/themes/next/components/BlogAround.js +++ b/themes/next/components/BlogAround.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 上一篇,下一篇文章 @@ -11,22 +11,22 @@ export default function BlogAround ({ prev, next }) { } return (
      - {prev && {prev.title} - } - {next && } + {next && {next.title} - } + }
      ); } diff --git a/themes/next/components/BlogPostArchive.js b/themes/next/components/BlogPostArchive.js index 589e67b1..03ee090a 100644 --- a/themes/next/components/BlogPostArchive.js +++ b/themes/next/components/BlogPostArchive.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博客归档列表 @@ -27,12 +27,12 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
      {post.date?.start_date}{' '}   - {post.title} - +
      ) diff --git a/themes/next/components/BlogPostCard.js b/themes/next/components/BlogPostCard.js index 6189fff7..248c8099 100644 --- a/themes/next/components/BlogPostCard.js +++ b/themes/next/components/BlogPostCard.js @@ -5,7 +5,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' import Image from 'next/image' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import Card from './Card' import TagItemMini from './TagItemMini' @@ -32,7 +32,7 @@ const BlogPostCard = ({ post, index, showSummary }) => { className='flex flex-col-reverse justify-between duration-300'>
      {/* 文章标题 */} - { )}{' '} {post.title} - +
      {
      {post.category && ( <> - {post.category} - + | )} - {post.date?.start_date} - +
      { )}
      - {locale.COMMON.ARTICLE_DETAIL} - +
      {siteConfig('NEXT_POST_LIST_COVER', null, CONFIG) && post?.pageCoverThumbnail && ( - +
      { loading='lazy' />
      - +
      )}
      diff --git a/themes/next/components/CategoryGroup.js b/themes/next/components/CategoryGroup.js index c3d483be..48338c5a 100644 --- a/themes/next/components/CategoryGroup.js +++ b/themes/next/components/CategoryGroup.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const CategoryGroup = ({ currentCategory, categories }) => { if (!categories || categories.length === 0) return <> @@ -11,7 +11,7 @@ const CategoryGroup = ({ currentCategory, categories }) => { {categoryOptions.map(category => { const selected = currentCategory === category.name return ( - { className={`${selected ? 'text-white fa-folder-open ' : 'text-gray-500 fa-folder '} mr-2 fas`} /> {category.name}({category.count}) - + ) })} diff --git a/themes/next/components/CategoryList.js b/themes/next/components/CategoryList.js index af8e3b52..460c1705 100644 --- a/themes/next/components/CategoryList.js +++ b/themes/next/components/CategoryList.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useGlobal } from '@/lib/global' const CategoryList = ({ currentCategory, categoryOptions }) => { @@ -13,7 +13,7 @@ const CategoryList = ({ currentCategory, categoryOptions }) => { {categoryOptions?.map(category => { const selected = category.name === currentCategory return ( - { {`${category.name} (${category.count})`} - + ) })}
    diff --git a/themes/next/components/ContactButton.js b/themes/next/components/ContactButton.js index bc95ab25..3068403f 100644 --- a/themes/next/components/ContactButton.js +++ b/themes/next/components/ContactButton.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 悬浮在屏幕右下角,联系我的按钮 @@ -7,7 +7,7 @@ import Link from 'next/link' */ const ContactButton = () => { return ( - ( @@ -16,7 +16,7 @@ const ContactButton = () => { - ) + ) ); } diff --git a/themes/next/components/LatestPostsGroup.js b/themes/next/components/LatestPostsGroup.js index 9e612997..e235b0aa 100644 --- a/themes/next/components/LatestPostsGroup.js +++ b/themes/next/components/LatestPostsGroup.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -30,7 +30,7 @@ const LatestPostsGroup = ({ latestPosts }) => { const selected = currentPath === `${siteConfig('SUB_PATH', '')}/${post.slug}` return ( - { }>
  • {post.title}
  • - + ) })} diff --git a/themes/next/components/Live2DWaifu.js b/themes/next/components/Live2DWaifu.js index c21fc79a..edd2e120 100644 --- a/themes/next/components/Live2DWaifu.js +++ b/themes/next/components/Live2DWaifu.js @@ -7,7 +7,7 @@ export default function Live2DWife() { initLive2DWife() }, []) return <> - + } diff --git a/themes/next/components/Logo.js b/themes/next/components/Logo.js index e7c5f0e2..2a768d63 100644 --- a/themes/next/components/Logo.js +++ b/themes/next/components/Logo.js @@ -1,10 +1,10 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const Logo = props => { const { className } = props return ( - +
    { {siteConfig('DESCRIPTION')}
    - +
    ) } export default Logo diff --git a/themes/next/components/MenuItemCollapse.js b/themes/next/components/MenuItemCollapse.js index f0d079a5..91d1c799 100644 --- a/themes/next/components/MenuItemCollapse.js +++ b/themes/next/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -28,7 +28,7 @@ export const MenuItemCollapse = props => { className='px-5 py-2 w-full text-left duration-200 hover:bg-gray-700 hover:text-white not:last-child:border-b-0 border-b dark:bg-hexo-black-gray dark:border-black' onClick={toggleShow}> {!hasSubMenu && ( - @@ -36,7 +36,7 @@ export const MenuItemCollapse = props => {
    {link.name}
    - +
    )} {hasSubMenu && ( @@ -65,7 +65,7 @@ export const MenuItemCollapse = props => { className='whitespace-nowrap dark:text-gray-200 not:last-child:border-b-0 border-b dark:border-gray-800 py-2 px-14 cursor-pointer hover:bg-gray-100 font-extralight dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'> - +
    {sLink.icon && (
    { )} {sLink.title}
    - +
    ) })} diff --git a/themes/next/components/MenuItemDrop.js b/themes/next/components/MenuItemDrop.js index b4078e43..f1745a70 100644 --- a/themes/next/components/MenuItemDrop.js +++ b/themes/next/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -11,7 +11,7 @@ export const MenuItemDrop = ({ link }) => { onMouseOut={() => changeShow(false)} className='relative py-1.5 px-5 duration-300 text-base justify-between hover:bg-gray-700 hover:text-white hover:shadow-lg cursor-pointer font-light flex flex-nowrap items-center '> {!hasSubMenu && ( - @@ -20,7 +20,7 @@ export const MenuItemDrop = ({ link }) => { {link.name} {link.slot} - +
    )} {hasSubMenu && ( @@ -46,16 +46,16 @@ export const MenuItemDrop = ({ link }) => { {link?.subMenus?.map(sLink => { return (
  • - {sLink.icon && ( - + )} {sLink.name} {sLink.slot} - +
  • ) })} diff --git a/themes/next/components/NextRecentComments.js b/themes/next/components/NextRecentComments.js index 74123935..d459d5e3 100644 --- a/themes/next/components/NextRecentComments.js +++ b/themes/next/components/NextRecentComments.js @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' import { siteConfig } from '@/lib/config' @@ -26,7 +26,7 @@ const NextRecentComments = (props) => { {!onLoading && comments && comments.length === 0 &&
    No Comments
    } {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
    -
    --{comment.nick}
    +
    --{comment.nick}
    )} diff --git a/themes/next/components/PaginationNumber.js b/themes/next/components/PaginationNumber.js index 02c61693..e2d054f0 100644 --- a/themes/next/components/PaginationNumber.js +++ b/themes/next/components/PaginationNumber.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -28,7 +28,7 @@ const PaginationNumber = ({ page, totalPage }) => { data-aos-anchor-placement='top-bottom' className='mt-5 py-3 flex justify-center items-end font-medium text-black hover:shadow-xl duration-200 transition-all bg-white dark:bg-hexo-black-gray dark:text-gray-300 shadow space-x-2'> {/* 上一页 */} - { } hover:border-t-2 border-white hover:border-gray-400 dark:hover:border-gray-400 w-8 h-8 justify-center flex items-center cursor-pointer duration-200 transition-all hover:font-bold`}>
    - + {pages} {/* 下一页 */} - { } hover:border-t-2 border-white hover:border-gray-400 dark:hover:border-gray-400 w-8 h-8 justify-center flex items-center cursor-pointer duration-200 transition-all hover:font-bold`}> - + ) } @@ -129,7 +129,7 @@ function generatePages(pagePrefix, page, currentPage, totalPage) { */ function getPageElement(pagePrefix, page, currentPage) { return ( - {page} - + ) } diff --git a/themes/next/components/PaginationSimple.js b/themes/next/components/PaginationSimple.js index 65e21882..56b03fec 100644 --- a/themes/next/components/PaginationSimple.js +++ b/themes/next/components/PaginationSimple.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' @@ -22,7 +22,7 @@ const PaginationSimple = ({ page, showNext }) => { data-aos-once="false" data-aos-anchor-placement="top-bottom" className="my-10 flex justify-between font-medium text-black dark:text-gray-100 space-x-2"> - { > ← {locale.PAGINATION.PREV} - - + { > {locale.PAGINATION.NEXT} → - + ) } diff --git a/themes/next/components/RecommendPosts.js b/themes/next/components/RecommendPosts.js index 9be418da..a20ad4cf 100644 --- a/themes/next/components/RecommendPosts.js +++ b/themes/next/components/RecommendPosts.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useGlobal } from '@/lib/global' import CONFIG from '../config' import { siteConfig } from '@/lib/config' @@ -18,11 +18,11 @@ const RecommendPosts = ({ recommendPosts }) => {
      {recommendPosts.map(post => (
    • - + {post.title} - +
    • ))}
    diff --git a/themes/next/components/SideAreaRight.js b/themes/next/components/SideAreaRight.js index 9b72e72d..40fa2825 100644 --- a/themes/next/components/SideAreaRight.js +++ b/themes/next/components/SideAreaRight.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import Card from './Card' import CategoryGroup from './CategoryGroup' import TagGroups from './TagGroups' @@ -56,14 +56,14 @@ const SideAreaRight = (props) => {
    {locale.COMMON.CATEGORY}
    - {locale.COMMON.MORE} - +
    @@ -76,7 +76,7 @@ const SideAreaRight = (props) => { {locale.COMMON.TAGS} - @@ -84,7 +84,7 @@ const SideAreaRight = (props) => { {locale.COMMON.MORE}{' '} - +
    diff --git a/themes/next/components/SideBar.js b/themes/next/components/SideBar.js index d863c74a..9e23fbed 100644 --- a/themes/next/components/SideBar.js +++ b/themes/next/components/SideBar.js @@ -2,7 +2,7 @@ import CategoryGroup from './CategoryGroup' import InfoCard from './InfoCard' import TagGroups from './TagGroups' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 侧边栏 @@ -32,14 +32,14 @@ const SideBar = (props) => {
    {locale.COMMON.CATEGORY}
    - {locale.COMMON.MORE} - +
    @@ -50,14 +50,14 @@ const SideBar = (props) => {
    {locale.COMMON.TAGS}
    - {locale.COMMON.MORE} - +
    diff --git a/themes/next/components/TagItem.js b/themes/next/components/TagItem.js index bb40a2f1..2aa6a933 100644 --- a/themes/next/components/TagItem.js +++ b/themes/next/components/TagItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useGlobal } from '@/lib/global' const TagItem = ({ tag, selected }) => { @@ -7,7 +7,7 @@ const TagItem = ({ tag, selected }) => {
    { locale.COMMON.NOTAG }
    } return ( - @@ -19,7 +19,7 @@ const TagItem = ({ tag, selected }) => { {selected && } {`${tag.name} `} {tag.count ? `(${tag.count})` : ''}
    - + ); } diff --git a/themes/next/components/TagItemMini.js b/themes/next/components/TagItemMini.js index 72f12959..88498a28 100644 --- a/themes/next/components/TagItemMini.js +++ b/themes/next/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - {
    {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
    - + ); } diff --git a/themes/next/components/TopNav.js b/themes/next/components/TopNav.js index 1689fdfb..cf7662db 100644 --- a/themes/next/components/TopNav.js +++ b/themes/next/components/TopNav.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import throttle from 'lodash.throttle' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useCallback, useEffect, useRef, useState } from 'react' import CategoryGroup from './CategoryGroup' import Collapse from '@/components/Collapse' @@ -87,14 +87,14 @@ const TopNav = (props) => {
    {locale.COMMON.CATEGORY}
    - {locale.COMMON.MORE} - +
    @@ -104,14 +104,14 @@ const TopNav = (props) => {
    {locale.COMMON.TAGS}
    - {locale.COMMON.MORE} - +
    diff --git a/themes/next/config.js b/themes/next/config.js index f6f20559..330dedd2 100644 --- a/themes/next/config.js +++ b/themes/next/config.js @@ -38,6 +38,7 @@ const CONFIG = { NEXT_ARTICLE_RELATE_POSTS: true, // 相关文章推荐 NEXT_ARTICLE_COPYRIGHT: true, // 文章版权声明 + NEXT_ARTICLE_NOT_BY_AI: false, // 显示非AI写作 NEXT_ARTICLE_INFO: true // 显示文章信息 } diff --git a/themes/next/index.js b/themes/next/index.js index bb68834c..e3d199e9 100644 --- a/themes/next/index.js +++ b/themes/next/index.js @@ -3,7 +3,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { isBrowser } from '@/lib/utils' import dynamic from 'next/dynamic' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef, useState } from 'react' import Announcement from './components/Announcement' @@ -368,7 +368,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {category.name}({category.count})
    - + ) })}
    diff --git a/themes/nobelium/components/BlogArchiveItem.js b/themes/nobelium/components/BlogArchiveItem.js index 4a92959e..7a010961 100644 --- a/themes/nobelium/components/BlogArchiveItem.js +++ b/themes/nobelium/components/BlogArchiveItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 归档分组文章 @@ -21,12 +21,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
    {post.date?.start_date}{' '}   - {post.title} - +
    ) diff --git a/themes/nobelium/components/BlogListPage.js b/themes/nobelium/components/BlogListPage.js index ba1c2b4a..585aa665 100644 --- a/themes/nobelium/components/BlogListPage.js +++ b/themes/nobelium/components/BlogListPage.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import BlogPost from './BlogPost' @@ -30,7 +30,7 @@ export const BlogListPage = props => {
    - { - - + { - +
    ) diff --git a/themes/nobelium/components/BlogListScroll.js b/themes/nobelium/components/BlogListScroll.js index 73bdaba6..c6f10297 100644 --- a/themes/nobelium/components/BlogListScroll.js +++ b/themes/nobelium/components/BlogListScroll.js @@ -2,7 +2,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { deepClone } from '@/lib/utils' import throttle from 'lodash.throttle' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useCallback, useEffect, useRef, useState } from 'react' export const BlogListScroll = props => { @@ -62,11 +62,11 @@ export const BlogListScroll = props => { {postsToShow.map(p => (

    - {p.title} - +

    diff --git a/themes/nobelium/components/BlogPost.js b/themes/nobelium/components/BlogPost.js index 51354bd8..e33c3da2 100644 --- a/themes/nobelium/components/BlogPost.js +++ b/themes/nobelium/components/BlogPost.js @@ -2,7 +2,7 @@ import NotionIcon from '@/components/NotionIcon' import NotionPage from '@/components/NotionPage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const BlogPost = ({ post }) => { const { NOTION_CONFIG } = useGlobal() @@ -10,7 +10,7 @@ const BlogPost = ({ post }) => { siteConfig('POST_LIST_PREVIEW', false, NOTION_CONFIG) && post?.blockMap return ( - +

    @@ -37,7 +37,7 @@ const BlogPost = ({ post }) => { )}

    - + ) } diff --git a/themes/nobelium/components/ExampleRecentComments.js b/themes/nobelium/components/ExampleRecentComments.js index 9dbdfa7f..cf1f5bed 100644 --- a/themes/nobelium/components/ExampleRecentComments.js +++ b/themes/nobelium/components/ExampleRecentComments.js @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' /** @@ -26,7 +26,7 @@ const ExampleRecentComments = (props) => { {!onLoading && comments && comments.length === 0 &&
    No Comments
    } {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
    -
    --{comment.nick}
    +
    --{comment.nick}
    )} diff --git a/themes/nobelium/components/MenuItemCollapse.js b/themes/nobelium/components/MenuItemCollapse.js index f70ed8d1..d7fd1993 100644 --- a/themes/nobelium/components/MenuItemCollapse.js +++ b/themes/nobelium/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -32,7 +32,7 @@ export const MenuItemCollapse = props => { className='w-full px-4 py-2 text-left dark:bg-hexo-black-gray dark:border-black' onClick={toggleShow}> {!hasSubMenu && ( - @@ -44,7 +44,7 @@ export const MenuItemCollapse = props => { )} {link?.name} - + )} {hasSubMenu && (
    {
    - + {sLink.title} - +
    ) })} diff --git a/themes/nobelium/components/MenuItemDrop.js b/themes/nobelium/components/MenuItemDrop.js index 9099d8fd..110f5c15 100644 --- a/themes/nobelium/components/MenuItemDrop.js +++ b/themes/nobelium/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -19,9 +19,9 @@ export const MenuItemDrop = ({ link }) => { onMouseOut={() => changeShow(false)}> {!hasSubMenu && (
    - + {link?.icon && } {link?.name} - +
    )} @@ -42,12 +42,12 @@ export const MenuItemDrop = ({ link }) => {
    - + {link?.icon &&   } {sLink.title} - +
    ) })} diff --git a/themes/nobelium/components/Nav.js b/themes/nobelium/components/Nav.js index 899b7ea0..7f4de1f4 100644 --- a/themes/nobelium/components/Nav.js +++ b/themes/nobelium/components/Nav.js @@ -3,7 +3,7 @@ import DarkModeButton from '@/components/DarkModeButton' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useRef, useState } from 'react' import CONFIG from '../config' import { MenuItemCollapse } from './MenuItemCollapse' @@ -52,7 +52,7 @@ const Nav = props => { id='sticky-nav' ref={navRef}>
    - +
    {/* */} {siteConfig('NOBELIUM_NAV_NOTION_ICON') ? ( @@ -66,7 +66,7 @@ const Nav = props => { )}
    - +
    {post ? (

    {post?.title} diff --git a/themes/nobelium/components/SideBar.js b/themes/nobelium/components/SideBar.js index a4d1e060..5cc321ba 100644 --- a/themes/nobelium/components/SideBar.js +++ b/themes/nobelium/components/SideBar.js @@ -1,7 +1,7 @@ import { siteConfig } from '@/lib/config' import Live2D from '@/components/Live2D' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import dynamic from 'next/dynamic' const ExampleRecentComments = dynamic(() => import('./ExampleRecentComments')) @@ -18,13 +18,13 @@ export const SideBar = (props) => {

    @@ -39,9 +39,9 @@ export const SideBar = (props) => {
      {latestPosts?.map(p => { return ( - +
    • {p.title}
    • - +
      ); })}
    diff --git a/themes/nobelium/components/TagItem.js b/themes/nobelium/components/TagItem.js index 0364e3fc..2430e2bb 100644 --- a/themes/nobelium/components/TagItem.js +++ b/themes/nobelium/components/TagItem.js @@ -1,11 +1,11 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItem = ({ tag }) => ( - ( + (

    {tag}

    - ) +
    ) ) export default TagItem diff --git a/themes/nobelium/components/Tags.js b/themes/nobelium/components/Tags.js index bdab3ee5..db94dd93 100644 --- a/themes/nobelium/components/Tags.js +++ b/themes/nobelium/components/Tags.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const Tags = props => { const { tagOptions, tag } = props @@ -19,14 +19,14 @@ const Tags = props => { : 'bg-gray-100 border-gray-100 text-gray-400 dark:bg-night dark:border-gray-800' }`} > - {`${tag.name} (${tag.count})`} - + ) })} diff --git a/themes/nobelium/index.js b/themes/nobelium/index.js index 4455dd96..39180c35 100644 --- a/themes/nobelium/index.js +++ b/themes/nobelium/index.js @@ -8,7 +8,7 @@ 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 SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef, useState } from 'react' import Announcement from './components/Announcement' @@ -305,7 +305,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {category.name}({category.count})
    - + ) })}
    @@ -339,7 +339,7 @@ const LayoutTagIndex = props => { {tagOptions.map(tag => { return (
    - { {' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
    - +
    ) })} diff --git a/themes/photo/components/ArchiveDateList.js b/themes/photo/components/ArchiveDateList.js index cd389028..c6ece352 100644 --- a/themes/photo/components/ArchiveDateList.js +++ b/themes/photo/components/ArchiveDateList.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' export default function ArchiveDateList(props) { const postsSortByDate = Object.create(props.allNavPages) @@ -24,12 +24,12 @@ export default function ArchiveDateList(props) { {dates?.map((date, index) => { return (
    - {date} - +
    ) })} diff --git a/themes/photo/components/ArticleFooter.js b/themes/photo/components/ArticleFooter.js index 9a928cce..9b3a9f64 100644 --- a/themes/photo/components/ArticleFooter.js +++ b/themes/photo/components/ArticleFooter.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 文章页脚 @@ -18,12 +18,12 @@ export default function ArticleFooter(props) { {/* 分类标签(如果文章不是“页面”类型) */} {post?.type !== 'Page' && ( <> - {post?.category} - + )} @@ -37,12 +37,12 @@ export default function ArticleFooter(props) { {/* 显示所有标签 */} {post?.tags?.map(tag => { return ( - {tag} - + ) })}
    @@ -57,12 +57,12 @@ export default function ArticleFooter(props) { fontWeight: '300', // 设置字体粗细为细体 color: 'gray' // 设置文字颜色为灰色 }}> - {post?.publishDay} - + ) diff --git a/themes/photo/components/BlogListGroupByDate.js b/themes/photo/components/BlogListGroupByDate.js index ebc30aa5..da8e18ad 100644 --- a/themes/photo/components/BlogListGroupByDate.js +++ b/themes/photo/components/BlogListGroupByDate.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 按照日期将文章分组 @@ -21,11 +21,11 @@ export default function BlogListGroupByDate({ archiveTitle, archivePosts }) { className='border-l-2 p-1 text-xs md:text-base items-center hover:scale-x-105 hover:border-gray-500 dark:hover:border-gray-300 dark:border-gray-400 transform duration-500'>
    {post?.publishDay}   - {post.title} - +
    ) diff --git a/themes/photo/components/BlogPostCard.js b/themes/photo/components/BlogPostCard.js index fe44b8cd..e039edf7 100644 --- a/themes/photo/components/BlogPostCard.js +++ b/themes/photo/components/BlogPostCard.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import TagItemMini from './TagItemMini' const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { @@ -15,7 +15,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
    - + {/* 固定高度 ,空白用图片拉升填充 */}
    {/* 图片 填充卡片 */} @@ -54,7 +54,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
    - +
    ) } diff --git a/themes/photo/components/BlogRecommend.js b/themes/photo/components/BlogRecommend.js index a8337ffa..0788ac09 100644 --- a/themes/photo/components/BlogRecommend.js +++ b/themes/photo/components/BlogRecommend.js @@ -1,7 +1,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' /** @@ -35,7 +35,7 @@ export default function BlogRecommend(props) { : siteInfo?.pageCover return ( - - + ) })} diff --git a/themes/photo/components/CategoryGroup.js b/themes/photo/components/CategoryGroup.js index a144bce5..a1bb4ad6 100644 --- a/themes/photo/components/CategoryGroup.js +++ b/themes/photo/components/CategoryGroup.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const CategoryGroup = props => { const { currentCategory, categoryOptions } = props @@ -16,7 +16,7 @@ const CategoryGroup = props => { {categories.map(category => { const selected = currentCategory === category.name return ( - { className={`${selected ? 'text-white fa-folder-open ' : 'text-gray-500 fa-folder '} mr-2 fas`} /> {category.name}({category.count}) - + ) })} diff --git a/themes/photo/components/CategoryItem.js b/themes/photo/components/CategoryItem.js index 1190965b..635bd69e 100644 --- a/themes/photo/components/CategoryItem.js +++ b/themes/photo/components/CategoryItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 文章分类 @@ -7,7 +7,7 @@ import Link from 'next/link' */ export default function CategoryItem({ category }) { return ( - {category.name}({category.count}) - + ) } diff --git a/themes/photo/components/ExampleRecentComments.js b/themes/photo/components/ExampleRecentComments.js index 9dbdfa7f..cf1f5bed 100644 --- a/themes/photo/components/ExampleRecentComments.js +++ b/themes/photo/components/ExampleRecentComments.js @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' /** @@ -26,7 +26,7 @@ const ExampleRecentComments = (props) => { {!onLoading && comments && comments.length === 0 &&
    No Comments
    } {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
    -
    --{comment.nick}
    +
    --{comment.nick}
    )} diff --git a/themes/photo/components/Header.js b/themes/photo/components/Header.js index 29b7bee0..0f591f9b 100644 --- a/themes/photo/components/Header.js +++ b/themes/photo/components/Header.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import MenuHierarchical from './MenuHierarchical' /** @@ -11,11 +11,11 @@ export const Header = props => { <>
    {/* 左侧Logo */} - {siteConfig('TITLE')} - + {/* 右侧使用一个三级菜单 */}
    diff --git a/themes/photo/components/LatestPostsGroup.js b/themes/photo/components/LatestPostsGroup.js index 40366e37..49746e56 100644 --- a/themes/photo/components/LatestPostsGroup.js +++ b/themes/photo/components/LatestPostsGroup.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -32,7 +32,7 @@ const LatestPostsGroup = ({ latestPosts }) => { currentPath === `${siteConfig('SUB_PATH', '')}/${post.slug}` return ( - { }>
  • {post.title}
  • - + ) })}
    diff --git a/themes/photo/components/MenuItemCollapse.js b/themes/photo/components/MenuItemCollapse.js index 73458f13..dbe4c4a9 100644 --- a/themes/photo/components/MenuItemCollapse.js +++ b/themes/photo/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -30,7 +30,7 @@ export const MenuItemCollapse = props => { <>
    {!hasSubMenu && ( - @@ -38,7 +38,7 @@ export const MenuItemCollapse = props => { {link?.icon && } {link?.name} - + )} {hasSubMenu && (
    {
    - + {link?.icon && }{' '} {sLink.title} - +
    ) })} diff --git a/themes/photo/components/MenuItemDrop.js b/themes/photo/components/MenuItemDrop.js index 3b5cf813..89c7a86f 100644 --- a/themes/photo/components/MenuItemDrop.js +++ b/themes/photo/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -14,13 +14,13 @@ export const MenuItemDrop = ({ link }) => { onMouseOver={() => changeShow(true)} onMouseOut={() => changeShow(false)}> {!hasSubMenu && ( - {link?.icon && } {link?.name} {hasSubMenu && } - + )} {hasSubMenu && ( @@ -43,12 +43,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/photo/components/NormalMenuItem.js b/themes/photo/components/NormalMenuItem.js index 2ed6f2e9..74af0f08 100644 --- a/themes/photo/components/NormalMenuItem.js +++ b/themes/photo/components/NormalMenuItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 旧的普通菜单 @@ -9,12 +9,12 @@ export const NormalMenuItem = props => { const { link } = props return ( link?.show && ( - {link.name} - + ) ) } diff --git a/themes/photo/components/PaginationNumber.js b/themes/photo/components/PaginationNumber.js index 64323b9c..d82ca8f3 100644 --- a/themes/photo/components/PaginationNumber.js +++ b/themes/photo/components/PaginationNumber.js @@ -1,6 +1,6 @@ import { ChevronDoubleRight } from '@/components/HeroIcons' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -49,7 +49,7 @@ const PaginationNumber = ({ page, totalPage }) => { {/* pc端分页按钮 */}
    {/* 上一页 */} - { {locale.PAGINATION.PREV}
    - + {/* 分页 */}
    @@ -86,7 +86,7 @@ const PaginationNumber = ({ page, totalPage }) => {
    {/* 下一页 */} - { {locale.PAGINATION.NEXT}
    - + {/* 移动端分页 */}
    {/* 上一页 */} - { rel='prev' className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}> {locale.PAGINATION.PREV} - + {showPrev && showNext &&
    } {/* 下一页 */} - { rel='next' className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}> {locale.PAGINATION.NEXT} - +
    ) @@ -149,7 +149,7 @@ function getPageElement(page, currentPage, pagePrefix) { return <> } return ( - {page} - + ) } diff --git a/themes/photo/components/PostItemCard.js b/themes/photo/components/PostItemCard.js index 41b57f5b..ec384a35 100644 --- a/themes/photo/components/PostItemCard.js +++ b/themes/photo/components/PostItemCard.js @@ -3,7 +3,7 @@ import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 普通的博客卡牌 @@ -25,7 +25,7 @@ const PostItemCard = ({ post, className }) => {
    - { )} {post?.title} - + {/* 发布日期 */} - {formatDateFmt(post?.publishDate, 'yyyy-MM')} - +
    diff --git a/themes/photo/components/SideBar.js b/themes/photo/components/SideBar.js index ea0531b7..70970f3a 100644 --- a/themes/photo/components/SideBar.js +++ b/themes/photo/components/SideBar.js @@ -1,7 +1,7 @@ import { siteConfig } from '@/lib/config' import Live2D from '@/components/Live2D' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import dynamic from 'next/dynamic' import Announcement from './Announcement' const ExampleRecentComments = dynamic(() => import('./ExampleRecentComments')) @@ -19,13 +19,13 @@ export const SideBar = (props) => { @@ -40,9 +40,9 @@ export const SideBar = (props) => {
      {latestPosts?.map(p => { return ( - +
    • {p.title}
    • - +
      ) })}
    diff --git a/themes/photo/components/TagGroups.js b/themes/photo/components/TagGroups.js index 597cddc1..68464cf3 100644 --- a/themes/photo/components/TagGroups.js +++ b/themes/photo/components/TagGroups.js @@ -1,5 +1,5 @@ import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' /** @@ -22,7 +22,7 @@ const TagGroups = ({ tagOptions, className }) => { {tagOptions.map((tag, index) => { const selected = currentTag === tag.name return ( - { <> )} - + ) })} diff --git a/themes/photo/components/TagItem.js b/themes/photo/components/TagItem.js index c608c8cb..2de99f65 100644 --- a/themes/photo/components/TagItem.js +++ b/themes/photo/components/TagItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 标签 @@ -8,7 +8,7 @@ import Link from 'next/link' export default function TagItem({ tag }) { return (
    - {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
    - + ) } diff --git a/themes/photo/components/TagItemMini.js b/themes/photo/components/TagItemMini.js index a4b7da1c..a60a3c65 100644 --- a/themes/photo/components/TagItemMini.js +++ b/themes/photo/components/TagItemMini.js @@ -1,8 +1,8 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItemMini = ({ tag, selected = false }) => { return ( - { {selected && }{' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '} - + ) } diff --git a/themes/plog/components/BlogArchiveItem.js b/themes/plog/components/BlogArchiveItem.js index 4a92959e..7a010961 100644 --- a/themes/plog/components/BlogArchiveItem.js +++ b/themes/plog/components/BlogArchiveItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 归档分组文章 @@ -21,12 +21,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
    {post.date?.start_date}{' '}   - {post.title} - +
    ) diff --git a/themes/plog/components/BlogListPage.js b/themes/plog/components/BlogListPage.js index 658c2377..3df17a45 100644 --- a/themes/plog/components/BlogListPage.js +++ b/themes/plog/components/BlogListPage.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useEffect, useRef } from 'react' import BlogPost from './BlogPost' @@ -64,7 +64,7 @@ export const BlogListPage = props => {
    - { - - + { - +
    ) diff --git a/themes/plog/components/BlogListScroll.js b/themes/plog/components/BlogListScroll.js index 6410338d..457601e2 100644 --- a/themes/plog/components/BlogListScroll.js +++ b/themes/plog/components/BlogListScroll.js @@ -1,7 +1,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import throttle from 'lodash.throttle' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useCallback, useEffect, useRef, useState } from 'react' export const BlogListScroll = props => { @@ -59,11 +59,11 @@ export const BlogListScroll = props => { {postsToShow.map(p => (

    - {p.title} - +

    diff --git a/themes/plog/components/BlogPost.js b/themes/plog/components/BlogPost.js index d2058008..ce8dd56b 100644 --- a/themes/plog/components/BlogPost.js +++ b/themes/plog/components/BlogPost.js @@ -1,5 +1,5 @@ import { compressImage } from '@/lib/notion/mapImage' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { usePlogGlobal } from '..' import { isMobile } from '@/lib/utils' import LazyImage from '@/components/LazyImage' @@ -42,9 +42,9 @@ const BlogPost = (props) => { {siteConfig('POST_TITLE_ICON') && } {post?.title} {post?.category &&
    - + {post?.category} - +
    }
    diff --git a/themes/plog/components/ExampleRecentComments.js b/themes/plog/components/ExampleRecentComments.js index 055a2e38..02bd85a7 100644 --- a/themes/plog/components/ExampleRecentComments.js +++ b/themes/plog/components/ExampleRecentComments.js @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' import { siteConfig } from '@/lib/config' @@ -26,7 +26,7 @@ const ExampleRecentComments = (props) => { {!onLoading && comments && comments.length === 0 &&
    No Comments
    } {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
    -
    --{comment.nick}
    +
    --{comment.nick}
    )} diff --git a/themes/plog/components/LogoBar.js b/themes/plog/components/LogoBar.js index 46dd8555..1507b79d 100644 --- a/themes/plog/components/LogoBar.js +++ b/themes/plog/components/LogoBar.js @@ -1,5 +1,5 @@ import LazyImage from '@/components/LazyImage' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import { SvgIcon } from './SvgIcon' import { siteConfig } from '@/lib/config' @@ -13,24 +13,24 @@ export default function LogoBar(props) { const { navBarTitle, siteInfo } = props return
    - +
    {siteConfig('NOBELIUM_NAV_NOTION_ICON', null, CONFIG) ? : }
    - +
    {navBarTitle ? ( - +

    {navBarTitle}

    - +
    ) : (

    - {siteConfig('TITLE')} + {siteConfig('TITLE')} {' '}{siteConfig('DESCRIPTION')}

    )} diff --git a/themes/plog/components/MenuItemCollapse.js b/themes/plog/components/MenuItemCollapse.js index f70ed8d1..d7fd1993 100644 --- a/themes/plog/components/MenuItemCollapse.js +++ b/themes/plog/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -32,7 +32,7 @@ export const MenuItemCollapse = props => { className='w-full px-4 py-2 text-left dark:bg-hexo-black-gray dark:border-black' onClick={toggleShow}> {!hasSubMenu && ( - @@ -44,7 +44,7 @@ export const MenuItemCollapse = props => { )} {link?.name} - + )} {hasSubMenu && (
    {
    - + {sLink.title} - +
    ) })} diff --git a/themes/plog/components/MenuItemDrop.js b/themes/plog/components/MenuItemDrop.js index 8b2af918..7f72d91a 100644 --- a/themes/plog/components/MenuItemDrop.js +++ b/themes/plog/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -16,9 +16,9 @@ export const MenuItemDrop = ({ link }) => { onMouseLeave={() => changeShow(false)}> {!hasSubMenu && (
    - + {link?.icon && } {link?.name} - +
    )} @@ -39,12 +39,12 @@ export const MenuItemDrop = ({ link }) => {
  • - + {link?.icon &&   } {sLink.title} - +
  • ) })} diff --git a/themes/plog/components/Modal.js b/themes/plog/components/Modal.js index ba70b50c..6b492df1 100644 --- a/themes/plog/components/Modal.js +++ b/themes/plog/components/Modal.js @@ -2,7 +2,7 @@ import { ArrowPath, ChevronLeft, ChevronRight } from '@/components/HeroIcons' import LazyImage from '@/components/LazyImage' import { compressImage } from '@/lib/notion/mapImage' import { Dialog, Transition } from '@headlessui/react' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { Fragment, useRef, useState } from 'react' import { usePlogGlobal } from '..' @@ -105,7 +105,7 @@ export default function Modal(props) { {/*
    */} - + - + <>
    @@ -134,11 +134,11 @@ export default function Modal(props) { {modalContent?.category && (
    - {modalContent?.category} - +
    )}
    diff --git a/themes/plog/components/Nav.js b/themes/plog/components/Nav.js index 854667d6..b41ef79d 100644 --- a/themes/plog/components/Nav.js +++ b/themes/plog/components/Nav.js @@ -2,7 +2,7 @@ import Collapse from '@/components/Collapse' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRef, useState } from 'react' import CONFIG from '../config' import { MenuItemCollapse } from './MenuItemCollapse' @@ -21,7 +21,7 @@ const Header = props => { className={`sticky-nav m-auto w-full h-6 flex flex-row justify-between items-center mb-2 md:mb-12 py-8 glassmorphism ${ !fullWidth ? 'max-w-3xl px-4' : 'px-4 md:px-24' }`}> - @@ -44,7 +44,7 @@ const Header = props => { {/* ,{' '}{siteConfig('HOME_BANNER_IMAGE')} */}

    - +
    diff --git a/themes/plog/components/SideBar.js b/themes/plog/components/SideBar.js index 2779a64d..ce399bac 100644 --- a/themes/plog/components/SideBar.js +++ b/themes/plog/components/SideBar.js @@ -1,6 +1,6 @@ import Live2D from '@/components/Live2D' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import dynamic from 'next/dynamic' import { siteConfig } from '@/lib/config' @@ -19,13 +19,13 @@ export const SideBar = (props) => { @@ -40,9 +40,9 @@ export const SideBar = (props) => {
      {latestPosts?.map(p => { return ( - +
    • {p.title}
    • - +
      ); })}
    diff --git a/themes/plog/components/TagItem.js b/themes/plog/components/TagItem.js index 6c385b9b..711d4fee 100644 --- a/themes/plog/components/TagItem.js +++ b/themes/plog/components/TagItem.js @@ -1,13 +1,13 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const TagItem = ({ tag }) => ( - ( + (

    {tag}

    - ) +
    ) ) export default TagItem diff --git a/themes/plog/components/Tags.js b/themes/plog/components/Tags.js index bdab3ee5..db94dd93 100644 --- a/themes/plog/components/Tags.js +++ b/themes/plog/components/Tags.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' const Tags = props => { const { tagOptions, tag } = props @@ -19,14 +19,14 @@ const Tags = props => { : 'bg-gray-100 border-gray-100 text-gray-400 dark:bg-night dark:border-gray-800' }`} > - {`${tag.name} (${tag.count})`} - + ) })} diff --git a/themes/plog/index.js b/themes/plog/index.js index 3c9c7d62..721ae4ea 100644 --- a/themes/plog/index.js +++ b/themes/plog/index.js @@ -6,7 +6,7 @@ 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 SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useState } from 'react' import { ArticleFooter } from './components/ArticleFooter' @@ -260,7 +260,7 @@ const LayoutCategoryIndex = props => {
    {categoryOptions?.map(category => { return ( - { {category.name}({category.count})
    - + ) })}
    @@ -294,7 +294,7 @@ const LayoutTagIndex = props => { {tagOptions.map(tag => { return (
    - { {' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
    - + ) })} diff --git a/themes/proxio/components/Blog.js b/themes/proxio/components/Blog.js index 66d8231e..5fd92edb 100644 --- a/themes/proxio/components/Blog.js +++ b/themes/proxio/components/Blog.js @@ -1,7 +1,7 @@ /* eslint-disable @next/next/no-img-element */ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博文列表 @@ -15,10 +15,18 @@ export const Blog = ({ posts }) => { } // 博客列表默认显示summary文字,当鼠标指向时显示文章封面。这里可选把summary文字替换成图片占位符。 - const PROXIO_BLOG_PLACEHOLDER_IMG_URL_1 = siteConfig('PROXIO_BLOG_PLACEHOLDER_IMG_URL_1') - const PROXIO_BLOG_PLACEHOLDER_IMG_URL_2 = siteConfig('PROXIO_BLOG_PLACEHOLDER_IMG_URL_2') - const PROXIO_BLOG_PLACEHOLDER_IMG_URL_3 = siteConfig('PROXIO_BLOG_PLACEHOLDER_IMG_URL_3') - const PROXIO_BLOG_PLACEHOLDER_IMG_URL_4 = siteConfig('PROXIO_BLOG_PLACEHOLDER_IMG_URL_4') + const PROXIO_BLOG_PLACEHOLDER_IMG_URL_1 = siteConfig( + 'PROXIO_BLOG_PLACEHOLDER_IMG_URL_1' + ) + const PROXIO_BLOG_PLACEHOLDER_IMG_URL_2 = siteConfig( + 'PROXIO_BLOG_PLACEHOLDER_IMG_URL_2' + ) + const PROXIO_BLOG_PLACEHOLDER_IMG_URL_3 = siteConfig( + 'PROXIO_BLOG_PLACEHOLDER_IMG_URL_3' + ) + const PROXIO_BLOG_PLACEHOLDER_IMG_URL_4 = siteConfig( + 'PROXIO_BLOG_PLACEHOLDER_IMG_URL_4' + ) return ( <> @@ -26,7 +34,9 @@ export const Blog = ({ posts }) => {
    {/* 区块标题文字 */} -
    +
    @@ -59,25 +69,30 @@ export const Blog = ({ posts }) => { className='wow fadeInUp group mb-10 relative overflow-hidden blog' data-wow-delay='.1s'>
    - {item.pageCoverThumbnail && ( - - {/* 图片半透明 */} + + {item.pageCoverThumbnail && ( + // 图片半透明 - - )} - {/* 遮罩层,仅覆盖图片部分 */} -
    - {/* 鼠标悬停时显示的文字内容 */} -
    - {!coverImg &&

    - {item.summary} -

    } - -
    + )} + {/* 遮罩层,仅覆盖图片部分 */} +
    + {/* 鼠标悬停时显示的文字内容 */} +
    + {!coverImg && ( +

    + {item.summary} +

    + )} + +
    +
    {/* 内容部分 */}
    @@ -85,13 +100,12 @@ export const Blog = ({ posts }) => { {item.publishDay}

    - {item.title} - +

    -
    @@ -103,4 +117,4 @@ export const Blog = ({ posts }) => { {/* */} ) -} \ No newline at end of file +} diff --git a/themes/proxio/components/CTA.js b/themes/proxio/components/CTA.js index ce980329..88b8062d 100644 --- a/themes/proxio/components/CTA.js +++ b/themes/proxio/components/CTA.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * CTA,用于创建一个呼吁用户行动的部分(Call To Action,简称 CTA)。 @@ -36,11 +36,11 @@ export const CTA = () => {

    {siteConfig('PROXIO_CTA_BUTTON') && ( <> - {siteConfig('PROXIO_CTA_BUTTON_TEXT')} - + )}
    diff --git a/themes/proxio/components/Career.js b/themes/proxio/components/Career.js index 162abb40..88c1c129 100644 --- a/themes/proxio/components/Career.js +++ b/themes/proxio/components/Career.js @@ -1,7 +1,7 @@ /* eslint-disable @next/next/no-img-element */ /* eslint-disable react/no-unescaped-entities */ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 首页的生涯模块 diff --git a/themes/proxio/components/Features.js b/themes/proxio/components/Features.js index 6f932fd6..e17ccda2 100644 --- a/themes/proxio/components/Features.js +++ b/themes/proxio/components/Features.js @@ -3,7 +3,7 @@ import { SVGDesign } from './svg/SVGDesign' import { SVGEssential } from './svg/SVGEssential' import { SVGGifts } from './svg/SVGGifts' import { SVGTemplate } from './svg/SVGTemplate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import LazyImage from '@/components/LazyImage' /** * 产品特性相关,将显示在首页中 @@ -88,12 +88,12 @@ export const Features = () => {
    - {siteConfig('PROXIO_FEATURE_BUTTON_TEXT')} - +
    diff --git a/themes/proxio/components/Footer.js b/themes/proxio/components/Footer.js index 383d7894..0e7e6b5c 100644 --- a/themes/proxio/components/Footer.js +++ b/themes/proxio/components/Footer.js @@ -7,7 +7,7 @@ import LazyImage from '@/components/LazyImage' import PoweredBy from '@/components/PoweredBy' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import SocialButton from './SocialButton' @@ -55,9 +55,9 @@ export const Footer = ({ title }) => { {group?.menus?.map((menu, index) => { return (
    - + {menu.title} - +
    ) })} diff --git a/themes/proxio/components/Header.js b/themes/proxio/components/Header.js index ed8ca5b4..09f6e5f4 100644 --- a/themes/proxio/components/Header.js +++ b/themes/proxio/components/Header.js @@ -4,7 +4,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { SignedIn, SignedOut, UserButton } from '@clerk/nextjs' import throttle from 'lodash.throttle' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useCallback, useEffect, useState } from 'react' import { DarkModeButton } from './DarkModeButton' diff --git a/themes/proxio/components/Hero.js b/themes/proxio/components/Hero.js index 580ca70a..741db77d 100644 --- a/themes/proxio/components/Hero.js +++ b/themes/proxio/components/Hero.js @@ -2,7 +2,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import CONFIG from '../config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 英雄大图区块 @@ -52,11 +52,11 @@ export const Hero = props => {
      {siteConfig('PROXIO_HERO_BUTTON_1_TEXT', null, config) && (
    • - {siteConfig('PROXIO_HERO_BUTTON_1_TEXT', null, config)} - +
    • )} diff --git a/themes/proxio/components/MenuItem.js b/themes/proxio/components/MenuItem.js index ea2919ef..484bbb15 100644 --- a/themes/proxio/components/MenuItem.js +++ b/themes/proxio/components/MenuItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -23,7 +23,7 @@ export const MenuItem = ({ link }) => { {/* 普通 MenuItem */} {!hasSubMenu && (
    • - { } lg:group-hover:opacity-70`}> {link?.icon && } {link?.name} - +
    • )} @@ -71,7 +71,7 @@ export const MenuItem = ({ link }) => { : 'hidden opacity-0 invisible' }`}> {link.subMenus.map((sLink, index) => ( - { {link?.icon && }{' '} {sLink.title} - + ))} diff --git a/themes/proxio/components/Pricing.js b/themes/proxio/components/Pricing.js index c5800931..85be1d7b 100644 --- a/themes/proxio/components/Pricing.js +++ b/themes/proxio/components/Pricing.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 价格板块 @@ -66,11 +66,11 @@ export const Pricing = () => { })} - {siteConfig('PROXIO_PRICING_1_BUTTON_TEXT')} - + @@ -118,11 +118,11 @@ export const Pricing = () => { })} - {siteConfig('PROXIO_PRICING_2_BUTTON_TEXT')} - + @@ -162,11 +162,11 @@ export const Pricing = () => { })} - {siteConfig('PROXIO_PRICING_3_BUTTON_TEXT')} - + diff --git a/themes/proxio/components/Team.js b/themes/proxio/components/Team.js index 0f013b7a..49222cdf 100644 --- a/themes/proxio/components/Team.js +++ b/themes/proxio/components/Team.js @@ -1,7 +1,7 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' import LazyImage from '@/components/LazyImage' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 作者团队 * @returns @@ -46,12 +46,12 @@ export const Team = () => {
      - {siteConfig('PROXIO_ABOUT_BUTTON_TEXT')} - +
      diff --git a/themes/proxio/components/Testimonials.js b/themes/proxio/components/Testimonials.js index 4a22c3fd..736eaba6 100644 --- a/themes/proxio/components/Testimonials.js +++ b/themes/proxio/components/Testimonials.js @@ -1,7 +1,7 @@ /* eslint-disable react/no-unescaped-entities */ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useEffect, useRef } from 'react' /** @@ -60,12 +60,12 @@ export const Testimonials = () => {

      - {siteConfig('PROXIO_TESTIMONIALS_BUTTON_TEXT')} - +
      diff --git a/themes/proxio/index.js b/themes/proxio/index.js index db25f622..9766ff4f 100644 --- a/themes/proxio/index.js +++ b/themes/proxio/index.js @@ -31,7 +31,7 @@ import DashboardHeader from '@/components/ui/dashboard/DashboardHeader' import { useGlobal } from '@/lib/global' import { loadWowJS } from '@/lib/plugins/wow' import { SignIn, SignUp } from '@clerk/nextjs' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { ArticleLock } from './components/ArticleLock' import { Banner } from './components/Banner' import { CTA } from './components/CTA' @@ -106,10 +106,10 @@ const LayoutIndex = props => { {/* 更多文章按钮 */}
      - + {locale.COMMON.MORE} - +
      )} @@ -304,11 +304,11 @@ const Layout404 = props => {

      {siteConfig('PROXIO_404_TEXT')}

      - {siteConfig('PROXIO_404_BACK')} - + @@ -364,24 +364,24 @@ const LayoutPostList = props => { className='wow fadeInUp group mb-10' data-wow-delay='.1s'>
      - + {item.title} - +
      {item.publishDay}

      - {item.title} - +

      {item.summary} @@ -417,7 +417,7 @@ const LayoutCategoryIndex = props => { className='duration-200 flex flex-wrap justify-center items-center '> {categoryOptions?.map(category => { return ( - { {category.name}({category.count}) - + ) })}

      @@ -458,7 +458,7 @@ const LayoutTagIndex = props => { {tagOptions.map(tag => { return (
      - { {' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
      - + ) })} diff --git a/themes/simple/components/ArticleAround.js b/themes/simple/components/ArticleAround.js index b4cee232..a2f9c7d3 100644 --- a/themes/simple/components/ArticleAround.js +++ b/themes/simple/components/ArticleAround.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 上一篇,下一篇文章 @@ -11,22 +11,22 @@ export default function ArticleAround({ prev, next }) { } return (
      - {prev && {prev.title} - } - {next && } + {next && {next.title} - } + }
      ) } diff --git a/themes/simple/components/ArticleInfo.js b/themes/simple/components/ArticleInfo.js index e6408566..742aaf00 100644 --- a/themes/simple/components/ArticleInfo.js +++ b/themes/simple/components/ArticleInfo.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useGlobal } from '@/lib/global' import CONFIG from '../config' import { siteConfig } from '@/lib/config' @@ -28,17 +28,17 @@ export default function ArticleInfo (props) { {siteConfig('AUTHOR')} {post?.publishDay} {post?.category && {post?.category}} - {post?.tags && post?.tags?.length > 0 && post?.tags.map(t => / {t})} + {post?.tags && post?.tags?.length > 0 && post?.tags.map(t => / {t})} )} {post?.type !== 'Page' && (
      {locale.COMMON.POST_TIME}: - {post?.publishDay} - + | diff --git a/themes/simple/components/BlogArchiveItem.js b/themes/simple/components/BlogArchiveItem.js index 4a92959e..7a010961 100644 --- a/themes/simple/components/BlogArchiveItem.js +++ b/themes/simple/components/BlogArchiveItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 归档分组文章 @@ -21,12 +21,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
      {post.date?.start_date}{' '}   - {post.title} - +
      ) diff --git a/themes/simple/components/BlogItem.js b/themes/simple/components/BlogItem.js index b5b897d8..b7354fac 100644 --- a/themes/simple/components/BlogItem.js +++ b/themes/simple/components/BlogItem.js @@ -5,7 +5,7 @@ import TwikooCommentCount from '@/components/TwikooCommentCount' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { formatDateFmt } from '@/lib/utils/formatDate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' export const BlogItem = props => { @@ -26,26 +26,26 @@ export const BlogItem = props => { {/* 图片封面 */} {showPageCover && (
      - + - +
      )}

      - {siteConfig('POST_TITLE_ICON') && ( )} {post.title} - +

      {/* 文章信息 */} @@ -60,12 +60,12 @@ export const BlogItem = props => { - {' '} {post.date?.start_date || post.createdTime} - + @@ -74,23 +74,23 @@ export const BlogItem = props => {
      {post.category && ( - + {' '} {post.category} - + )} {post?.tags && post?.tags?.length > 0 && post?.tags.map(t => ( - /{t} - + ))}
      @@ -113,12 +113,12 @@ export const BlogItem = props => {
      - Continue Reading{' '} - +
      ) diff --git a/themes/simple/components/BlogListPage.js b/themes/simple/components/BlogListPage.js index f11d2cc2..f4625f57 100644 --- a/themes/simple/components/BlogListPage.js +++ b/themes/simple/components/BlogListPage.js @@ -1,7 +1,7 @@ import { AdSlot } from '@/components/GoogleAdsense' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import CONFIG from '../config' import { BlogItem } from './BlogItem' @@ -49,7 +49,7 @@ export default function BlogListPage(props) {
      - NEWER POSTS - - + OLDER POSTS - +
      ) diff --git a/themes/simple/components/ExampleRecentComments.js b/themes/simple/components/ExampleRecentComments.js index 93cde585..663151a1 100644 --- a/themes/simple/components/ExampleRecentComments.js +++ b/themes/simple/components/ExampleRecentComments.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { RecentComments } from '@waline/client' import { useEffect, useState } from 'react' import { siteConfig } from '@/lib/config' @@ -26,7 +26,7 @@ const ExampleRecentComments = (props) => { {!onLoading && comments && comments.length === 0 &&
      No Comments
      } {!onLoading && comments && comments.length > 0 && comments.map((comment) =>
      -
      --{comment.nick}
      +
      --{comment.nick}
      )} diff --git a/themes/simple/components/Header.js b/themes/simple/components/Header.js index e5d71756..ca799f19 100644 --- a/themes/simple/components/Header.js +++ b/themes/simple/components/Header.js @@ -1,6 +1,6 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import CONFIG from '../config' import SocialButton from './SocialButton' @@ -14,7 +14,7 @@ export default function Header(props) { return (
      - + {/* 可使用一张单图作为logo */}
      @@ -40,7 +40,7 @@ export default function Header(props) { />
      - +
      diff --git a/themes/simple/components/MenuItemCollapse.js b/themes/simple/components/MenuItemCollapse.js index 50174dc3..9de40a79 100644 --- a/themes/simple/components/MenuItemCollapse.js +++ b/themes/simple/components/MenuItemCollapse.js @@ -1,5 +1,5 @@ import Collapse from '@/components/Collapse' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' /** @@ -32,7 +32,7 @@ export const MenuItemCollapse = props => { className='w-full px-8 py-3 text-left border-b dark:bg-hexo-black-gray dark:border-black' onClick={toggleShow}> {!hasSubMenu && ( - @@ -44,7 +44,7 @@ export const MenuItemCollapse = props => { )} {link?.name} - + )} {hasSubMenu && (
      {
      - + {sLink?.icon && ( @@ -81,7 +81,7 @@ export const MenuItemCollapse = props => { )} {sLink.title} - +
      ) })} diff --git a/themes/simple/components/MenuItemDrop.js b/themes/simple/components/MenuItemDrop.js index 7a5bbff8..79f9567c 100644 --- a/themes/simple/components/MenuItemDrop.js +++ b/themes/simple/components/MenuItemDrop.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useState } from 'react' export const MenuItemDrop = ({ link }) => { @@ -14,7 +14,7 @@ export const MenuItemDrop = ({ link }) => { onMouseOver={() => changeShow(true)} onMouseOut={() => changeShow(false)}> {!hasSubMenu && ( - @@ -25,7 +25,7 @@ export const MenuItemDrop = ({ link }) => { )} {link?.name} {hasSubMenu && } - + )} {hasSubMenu && ( @@ -52,12 +52,12 @@ export const MenuItemDrop = ({ link }) => {
    • - + {sLink?.icon &&   } {sLink.title} - +
    • ) })} diff --git a/themes/simple/components/RecommendPosts.js b/themes/simple/components/RecommendPosts.js index fd214fa0..a6db15f6 100644 --- a/themes/simple/components/RecommendPosts.js +++ b/themes/simple/components/RecommendPosts.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useGlobal } from '@/lib/global' import CONFIG from '../config' import { siteConfig } from '@/lib/config' @@ -18,11 +18,11 @@ const RecommendPosts = ({ recommendPosts }) => {
        {recommendPosts.map(post => (
      • - + {post.title} - +
      • ))}
      diff --git a/themes/simple/index.js b/themes/simple/index.js index a2b98e64..40bc987b 100644 --- a/themes/simple/index.js +++ b/themes/simple/index.js @@ -6,7 +6,7 @@ import { useGlobal } from '@/lib/global' import { isBrowser } from '@/lib/utils' import { Transition } from '@headlessui/react' import dynamic from 'next/dynamic' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { createContext, useContext, useEffect, useRef } from 'react' import BlogPostBar from './components/BlogPostBar' @@ -301,7 +301,7 @@ const LayoutCategoryIndex = props => {
      {categoryOptions?.map(category => { return ( - { {category.name}({category.count})
      - + ) })}
      @@ -334,7 +334,7 @@ const LayoutTagIndex = props => { {tagOptions.map(tag => { return (
      - { {' '} {tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
      - +
      ) })} diff --git a/themes/starter/components/About.js b/themes/starter/components/About.js index 794349d3..bcadb4b7 100644 --- a/themes/starter/components/About.js +++ b/themes/starter/components/About.js @@ -1,7 +1,7 @@ /* eslint-disable @next/next/no-img-element */ /* eslint-disable react/no-unescaped-entities */ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 首页的关于模块 @@ -28,11 +28,11 @@ export const About = () => { __html: siteConfig('STARTER_ABOUT_TEXT') }}>

      - {siteConfig('STARTER_ABOUT_BUTTON_TEXT')} - +
      diff --git a/themes/starter/components/Blog.js b/themes/starter/components/Blog.js index b8f51267..0ee4acac 100644 --- a/themes/starter/components/Blog.js +++ b/themes/starter/components/Blog.js @@ -1,6 +1,6 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 博文列表 @@ -41,13 +41,13 @@ export const Blog = ({ posts }) => { data-wow-delay='.1s'>
      {item.pageCoverThumbnail && ( - + {item.title} - + )}
      @@ -55,11 +55,11 @@ export const Blog = ({ posts }) => { {item.publishDay}

      - {item.title} - +

      {item.summary} diff --git a/themes/starter/components/CTA.js b/themes/starter/components/CTA.js index 2bf97e76..2319d0e3 100644 --- a/themes/starter/components/CTA.js +++ b/themes/starter/components/CTA.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * CTA,用于创建一个呼吁用户行动的部分(Call To Action,简称 CTA)。 @@ -30,11 +30,11 @@ export const CTA = () => {

      {siteConfig('STARTER_CTA_BUTTON') && ( <> - {siteConfig('STARTER_CTA_BUTTON_TEXT')} - + )}
      diff --git a/themes/starter/components/Features.js b/themes/starter/components/Features.js index bc869049..e72bd7fe 100644 --- a/themes/starter/components/Features.js +++ b/themes/starter/components/Features.js @@ -3,7 +3,7 @@ import { SVGDesign } from './svg/SVGDesign' import { SVGEssential } from './svg/SVGEssential' import { SVGGifts } from './svg/SVGGifts' import { SVGTemplate } from './svg/SVGTemplate' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 产品特性相关,将显示在首页中 * @returns @@ -42,11 +42,11 @@ export const Features = () => {

      {siteConfig('STARTER_FEATURE_1_TEXT_1')}

      - {siteConfig('STARTER_FEATURE_1_BUTTON_TEXT')} - +
      @@ -61,11 +61,11 @@ export const Features = () => {

      {siteConfig('STARTER_FEATURE_2_TEXT_1')}

      - {siteConfig('STARTER_FEATURE_2_BUTTON_TEXT')} - +
      @@ -80,11 +80,11 @@ export const Features = () => {

      {siteConfig('STARTER_FEATURE_3_TEXT_1')}

      - {siteConfig('STARTER_FEATURE_3_BUTTON_TEXT')} - +
      @@ -99,11 +99,11 @@ export const Features = () => {

      {siteConfig('STARTER_FEATURE_4_TEXT_1')}

      - {siteConfig('STARTER_FEATURE_3_BUTTON_TEXT')} - +
      diff --git a/themes/starter/components/Footer.js b/themes/starter/components/Footer.js index efcc24cb..27bce8b4 100644 --- a/themes/starter/components/Footer.js +++ b/themes/starter/components/Footer.js @@ -2,7 +2,7 @@ import { siteConfig } from '@/lib/config' import SocialButton from '@/themes/fukasawa/components/SocialButton' import { Logo } from './Logo' import { SVGFooterCircleBG } from './svg/SVGFooterCircleBG' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /* eslint-disable @next/next/no-img-element */ export const Footer = props => { @@ -49,11 +49,11 @@ export const Footer = props => { {item?.LINK_GROUP?.map((l, i) => { return (
    • - {l.TITLE} - +
    • ) })} @@ -73,7 +73,7 @@ export const Footer = props => {
      {latestPosts?.map((item, index) => { return ( - @@ -88,7 +88,7 @@ export const Footer = props => { {item.title} - + ) })}
      @@ -105,19 +105,19 @@ export const Footer = props => {
      - {siteConfig('STARTER_FOOTER_PRIVACY_POLICY_TEXT')} - - + {siteConfig('STARTER_FOOTER_PRIVACY_LEGAL_NOTICE_TEXT')} - - + { {siteConfig( 'STARTER_FOOTER_PRIVACY_TERMS_OF_SERVICE_TEXT', '' )} - +
      diff --git a/themes/starter/components/Header.js b/themes/starter/components/Header.js index 0875062e..96ff166a 100644 --- a/themes/starter/components/Header.js +++ b/themes/starter/components/Header.js @@ -4,7 +4,7 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { SignedIn, SignedOut, UserButton } from '@clerk/nextjs' import throttle from 'lodash.throttle' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useCallback, useEffect, useState } from 'react' import { DarkModeButton } from './DarkModeButton' @@ -74,16 +74,16 @@ export const Header = props => { <>
      - {siteConfig('STARTER_NAV_BUTTON_1_TEXT')} - - + {siteConfig('STARTER_NAV_BUTTON_2_TEXT')} - +
      @@ -94,16 +94,16 @@ export const Header = props => { )} {!enableClerk && (
      - {siteConfig('STARTER_NAV_BUTTON_1_TEXT')} - - + {siteConfig('STARTER_NAV_BUTTON_2_TEXT')} - +
      )} diff --git a/themes/starter/components/Hero.js b/themes/starter/components/Hero.js index 42f124ac..46f07c58 100644 --- a/themes/starter/components/Hero.js +++ b/themes/starter/components/Hero.js @@ -2,7 +2,7 @@ import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import CONFIG from '../config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 英雄大图区块 @@ -33,16 +33,16 @@ export const Hero = props => {
        {siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, config) && (
      • - {siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, config)} - +
      • )} {siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, config) && (
      • - { /> )} {siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, config)} - +
      • )}
      diff --git a/themes/starter/components/MenuItem.js b/themes/starter/components/MenuItem.js index 95de15b2..f5a95a78 100644 --- a/themes/starter/components/MenuItem.js +++ b/themes/starter/components/MenuItem.js @@ -1,4 +1,4 @@ -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { useRouter } from 'next/router' import { useState } from 'react' @@ -23,7 +23,7 @@ export const MenuItem = ({ link }) => { {/* 普通 MenuItem */} {!hasSubMenu && (
    • - { } lg:group-hover:opacity-70`}> {link?.icon && } {link?.name} - +
    • )} @@ -71,7 +71,7 @@ export const MenuItem = ({ link }) => { : 'hidden opacity-0 invisible' }`}> {link.subMenus.map((sLink, index) => ( - { {link?.icon && }{' '} {sLink.title}
      - + ))} diff --git a/themes/starter/components/Pricing.js b/themes/starter/components/Pricing.js index 2519612d..443623c3 100644 --- a/themes/starter/components/Pricing.js +++ b/themes/starter/components/Pricing.js @@ -1,5 +1,5 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' /** * 价格板块 @@ -66,11 +66,11 @@ export const Pricing = () => { })} - {siteConfig('STARTER_PRICING_1_BUTTON_TEXT')} - + @@ -118,11 +118,11 @@ export const Pricing = () => { })} - {siteConfig('STARTER_PRICING_2_BUTTON_TEXT')} - + @@ -162,11 +162,11 @@ export const Pricing = () => { })} - {siteConfig('STARTER_PRICING_3_BUTTON_TEXT')} - + diff --git a/themes/starter/index.js b/themes/starter/index.js index c0311b77..ed08ea31 100644 --- a/themes/starter/index.js +++ b/themes/starter/index.js @@ -32,7 +32,7 @@ import DashboardHeader from '@/components/ui/dashboard/DashboardHeader' import { useGlobal } from '@/lib/global' import { loadWowJS } from '@/lib/plugins/wow' import { SignIn, SignUp } from '@clerk/nextjs' -import Link from 'next/link' +import SmartLink from '@/components/SmartLink' import { ArticleLock } from './components/ArticleLock' import { Banner } from './components/Banner' import { CTA } from './components/CTA' @@ -50,34 +50,49 @@ import { SVG404 } from './components/svg/SVG404' * @returns */ const LayoutBase = props => { - const { children } = props + const { children } = props + // 极简模式,会隐藏掉页头页脚等组件,便于嵌入网页等功能 + const { isLiteMode } = useGlobal() + const router = useRouter() - // 加载wow动画 - useEffect(() => { - loadWowJS() - }, []) + // 加载wow动画 + useEffect(() => { + loadWowJS() + }, []) - return ( -
      - + ) +} + +export { Style }