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 (
+
}/Written-By-Human-Not-By-AI-Badge-${isDarkMode)
+ )
+}
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.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
} 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 => {
))}
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'>
-
+
-
+
)
})}
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}
{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 && (
{
-
+
{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}
-
+
{/* 分页 */}
{/* 移动端 */}
-
@@ -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 }) {
-
{locale.COMMON.NEXT_POST}
{next?.title}
-
+
)
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() {
{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 (
- {
<>>
)}
-
+
)
})}
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 (
-