From 722aa2daface07931a47d897047ad543d447c31d Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 00:21:29 +0800
Subject: [PATCH 01/33] feat(getPageContentText): refactor content text
extraction logic
- add special case handling for various block types
- maintain same functionality while improving structure
Close #2151
---
pages/search/[keyword]/index.js | 160 +++++++++++++++++++++++---------
1 file changed, 114 insertions(+), 46 deletions(-)
diff --git a/pages/search/[keyword]/index.js b/pages/search/[keyword]/index.js
index 4116e689..f0e63668 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 { checkStrIsUuid } from '@/lib/utils'
const Index = props => {
const theme = siteConfig('THEME', BLOG.THEME, props.NOTION_CONFIG)
@@ -58,42 +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
@@ -124,12 +89,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
}
@@ -152,17 +117,120 @@ async function filterByMemCache(allPosts, keyword) {
}
export function getPageContentText(post, pageBlockMap) {
- let indexContent = []
+ /**
+ * 将对象的指定字段拼接到字符串
+ * @param sourceTextArray
+ * @param targetObj
+ * @param key
+ * @returns string
+ */
+ function getText(targetObj) {
+ if (!targetObj) {
+ return ''
+ }
+ const textArray = targetObj['title'] || targetObj['caption']
+ return getTextArray(textArray)
+ }
+
+ function getTextArray(textArray) {
+ const text = textArray ? getTextContent(textArray) : ''
+ if (text && text !== 'Untitled') {
+ return text
+ }
+ return ''
+ }
+
+ const removeTypeFlag = ['a', 'p', '‣']
+
+ /**
+ * 递归获取层层嵌套的数组
+ * @param {*} textArray
+ * @returns string
+ */
+ function getTextContent(textArray) {
+ if (typeof textArray === 'object' && isIterable(textArray)) {
+ let result = ''
+ for (const textObj of textArray) {
+ if (textArray.length > 1 && removeTypeFlag.includes(textArray[0])) {
+ return result
+ }
+ result = result + getTextContent(textObj)
+ }
+ return result
+ } else if (typeof textArray === 'string') {
+ if (checkStrIsUuid(textArray) && pageBlockMap.block[textArray]) {
+ return getBlockContentText(textArray)
+ } else if (textArray === pageBlockMap.block[postId].value.space_id) {
+ return ''
+ }
+ return textArray
+ }
+ }
+
+ function getTransclusionReference(block) {
+ const result = []
+ const blockPointer = block.format.transclusion_reference_pointer
+ const blockPointerId = blockPointer.id
+ if (blockPointer) {
+ 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
+ const blockType = block.type
+ switch (blockType) {
+ case 'transclusion_reference':
+ return getTransclusionReference(block)
+ case 'table':
+ return getTableText(block.content)
+ case 'page':
+ if (id !== postId) {
+ return getText(block.properties)
+ }
+ return ''
+ case 'breadcrumb':
+ case 'divider':
+ return ''
+ case 'quote':
+ default:
+ const properties = block?.properties
+ return getText(properties)
+ }
+ }
+
+ 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
+ let contentTextList = []
// 防止搜到加密文章的内容
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')
- })
+ for (const id of contentIds) {
+ const blockContentText = getBlockContentText(id)
+ if (blockContentText) {
+ contentTextList.push(blockContentText)
+ }
+ }
}
- return indexContent.join('')
+ console.log(contentTextList.join(''))
+ return contentTextList.join('')
}
export default Index
From b4ba7d8f23a41294421c307e4633755ac421c907 Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 00:28:58 +0800
Subject: [PATCH 02/33] refactor(getPageContentText): Relocate
getPageContentText to a dedicated file and eliminate the redundant isIterable
function.
---
lib/notion/getPageContentText.js | 118 ++++++++++++++++++++++++++++
lib/plugins/algolia.js | 2 +-
lib/utils/post.js | 2 +-
pages/search/[keyword]/index.js | 127 +------------------------------
4 files changed, 121 insertions(+), 128 deletions(-)
create mode 100644 lib/notion/getPageContentText.js
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
new file mode 100644
index 00000000..e636fab4
--- /dev/null
+++ b/lib/notion/getPageContentText.js
@@ -0,0 +1,118 @@
+import { checkStrIsUuid, isIterable } from '@/lib/utils'
+
+export function getPageContentText(post, pageBlockMap) {
+ /**
+ * 将对象的指定字段拼接到字符串
+ * @param sourceTextArray
+ * @param targetObj
+ * @param key
+ * @returns string
+ */
+ function getText(targetObj) {
+ if (!targetObj) {
+ return ''
+ }
+ const textArray = targetObj['title'] || targetObj['caption']
+ return getTextArray(textArray)
+ }
+
+ function getTextArray(textArray) {
+ const text = textArray ? getTextContent(textArray) : ''
+ if (text && text !== 'Untitled') {
+ return text
+ }
+ return ''
+ }
+
+ const removeTypeFlag = ['a', 'p', '‣']
+
+ /**
+ * 递归获取层层嵌套的数组
+ * @param {*} textArray
+ * @returns string
+ */
+ function getTextContent(textArray) {
+ if (typeof textArray === 'object' && isIterable(textArray)) {
+ let result = ''
+ for (const textObj of textArray) {
+ if (textArray.length > 1 && removeTypeFlag.includes(textArray[0])) {
+ return result
+ }
+ result = result + getTextContent(textObj)
+ }
+ return result
+ } else if (typeof textArray === 'string') {
+ if (checkStrIsUuid(textArray) && pageBlockMap.block[textArray]) {
+ return getBlockContentText(textArray)
+ } else if (textArray === pageBlockMap.block[postId].value.space_id) {
+ return ''
+ }
+ return textArray
+ }
+ }
+
+ function getTransclusionReference(block) {
+ const result = []
+ const blockPointer = block.format.transclusion_reference_pointer
+ const blockPointerId = blockPointer.id
+ if (blockPointer) {
+ 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
+ const blockType = block.type
+ switch (blockType) {
+ case 'transclusion_reference':
+ return getTransclusionReference(block)
+ case 'table':
+ return getTableText(block.content)
+ case 'page':
+ if (id !== postId) {
+ return getText(block.properties)
+ }
+ return ''
+ case 'breadcrumb':
+ case 'divider':
+ return ''
+ case 'quote':
+ default:
+ const properties = block?.properties
+ return getText(properties)
+ }
+ }
+
+ 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
+ let contentTextList = []
+ // 防止搜到加密文章的内容
+ if (pageBlockMap && pageBlockMap.block && !post.password) {
+ const contentIds = Object.keys(pageBlockMap.block)
+ for (const id of contentIds) {
+ const blockContentText = getBlockContentText(id)
+ if (blockContentText) {
+ contentTextList.push(blockContentText)
+ }
+ }
+ }
+ console.log(contentTextList.join(''))
+ return contentTextList.join('')
+}
diff --git a/lib/plugins/algolia.js b/lib/plugins/algolia.js
index e6c76422..fceb7acc 100644
--- a/lib/plugins/algolia.js
+++ b/lib/plugins/algolia.js
@@ -1,6 +1,6 @@
import BLOG from '@/blog.config'
-import { getPageContentText } from '@/pages/search/[keyword]'
import algoliasearch from 'algoliasearch'
+import { getPageContentText } from '@/lib/notion/getPageContentText'
/**
* 生成全文索引
diff --git a/lib/utils/post.js b/lib/utils/post.js
index a3ee0f91..e4a22d2e 100644
--- a/lib/utils/post.js
+++ b/lib/utils/post.js
@@ -6,11 +6,11 @@ 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'
/**
* 获取文章的关联推荐文章列表,目前根据标签关联性筛选
diff --git a/pages/search/[keyword]/index.js b/pages/search/[keyword]/index.js
index f0e63668..cb486895 100644
--- a/pages/search/[keyword]/index.js
+++ b/pages/search/[keyword]/index.js
@@ -3,7 +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 { checkStrIsUuid } from '@/lib/utils'
+import { getPageContentText } from '@/lib/notion/getPageContentText'
const Index = props => {
const theme = siteConfig('THEME', BLOG.THEME, props.NOTION_CONFIG)
@@ -59,14 +59,6 @@ export function getStaticPaths() {
}
}
-/**
- * 对象是否可以遍历
- * @param {*} obj
- * @returns
- */
-const isIterable = obj =>
- obj != null && typeof obj[Symbol.iterator] === 'function'
-
/**
* 在内存缓存中进行全文索引
* @param {*} allPosts
@@ -116,121 +108,4 @@ async function filterByMemCache(allPosts, keyword) {
return filterPosts
}
-export function getPageContentText(post, pageBlockMap) {
- /**
- * 将对象的指定字段拼接到字符串
- * @param sourceTextArray
- * @param targetObj
- * @param key
- * @returns string
- */
- function getText(targetObj) {
- if (!targetObj) {
- return ''
- }
- const textArray = targetObj['title'] || targetObj['caption']
- return getTextArray(textArray)
- }
-
- function getTextArray(textArray) {
- const text = textArray ? getTextContent(textArray) : ''
- if (text && text !== 'Untitled') {
- return text
- }
- return ''
- }
-
- const removeTypeFlag = ['a', 'p', '‣']
-
- /**
- * 递归获取层层嵌套的数组
- * @param {*} textArray
- * @returns string
- */
- function getTextContent(textArray) {
- if (typeof textArray === 'object' && isIterable(textArray)) {
- let result = ''
- for (const textObj of textArray) {
- if (textArray.length > 1 && removeTypeFlag.includes(textArray[0])) {
- return result
- }
- result = result + getTextContent(textObj)
- }
- return result
- } else if (typeof textArray === 'string') {
- if (checkStrIsUuid(textArray) && pageBlockMap.block[textArray]) {
- return getBlockContentText(textArray)
- } else if (textArray === pageBlockMap.block[postId].value.space_id) {
- return ''
- }
- return textArray
- }
- }
-
- function getTransclusionReference(block) {
- const result = []
- const blockPointer = block.format.transclusion_reference_pointer
- const blockPointerId = blockPointer.id
- if (blockPointer) {
- 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
- const blockType = block.type
- switch (blockType) {
- case 'transclusion_reference':
- return getTransclusionReference(block)
- case 'table':
- return getTableText(block.content)
- case 'page':
- if (id !== postId) {
- return getText(block.properties)
- }
- return ''
- case 'breadcrumb':
- case 'divider':
- return ''
- case 'quote':
- default:
- const properties = block?.properties
- return getText(properties)
- }
- }
-
- 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
- let contentTextList = []
- // 防止搜到加密文章的内容
- if (pageBlockMap && pageBlockMap.block && !post.password) {
- const contentIds = Object.keys(pageBlockMap.block)
- for (const id of contentIds) {
- const blockContentText = getBlockContentText(id)
- if (blockContentText) {
- contentTextList.push(blockContentText)
- }
- }
- }
- console.log(contentTextList.join(''))
- return contentTextList.join('')
-}
-
export default Index
From 2a89027bb6c26d4164d1015f4ec036b1438ae046 Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 00:32:16 +0800
Subject: [PATCH 03/33] chore(getPageContentText): add todo comments for future
improvements
- Add todo comment for cleaning up more useless tags
- Add todo comment for handling more block types
---
lib/notion/getPageContentText.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index e636fab4..9c29cc44 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -24,6 +24,7 @@ export function getPageContentText(post, pageBlockMap) {
return ''
}
+ // todo: 清除更多无用标签
const removeTypeFlag = ['a', 'p', '‣']
/**
@@ -67,6 +68,7 @@ export function getPageContentText(post, pageBlockMap) {
function getBlockContentText(id) {
const block = pageBlockMap?.block[id].value
const blockType = block.type
+ // todo: 处理更多类型
switch (blockType) {
case 'transclusion_reference':
return getTransclusionReference(block)
From 7ce6ad0c2f77a91c42ffacb6d43619f17f0139fb Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 01:13:09 +0800
Subject: [PATCH 04/33] feat(algolia): add data deletion functionality and
execute in index.js
- Add `checkDataFromAlgolia` function to identify and delete unused data
- Implement `deletePostDataFromAlgolia` helper function
- Execute Algolia data check during homepage generation
- Handle password-protected and draft pages deletion
Fixes 1526
---
lib/plugins/algolia.js | 53 ++++++++++++++++++++++++++++++++++++++++++
pages/index.js | 3 +++
2 files changed, 56 insertions(+)
diff --git a/lib/plugins/algolia.js b/lib/plugins/algolia.js
index e6c76422..fecec3a1 100644
--- a/lib/plugins/algolia.js
+++ b/lib/plugins/algolia.js
@@ -15,6 +15,59 @@ 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 => {
+ // 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
+ }
+
+ // 检查是否有索引
+ let existed
+ try {
+ existed = await index.getObject(post.id)
+ } catch (error) {
+ // 通常是不存在索引
+ }
+
+ if (existed) {
+ await index
+ .deleteObject(post.id)
+ .wait()
+ .then(r => {
+ console.log('Algolia索引更新', r)
+ })
+ .catch(err => {
+ console.log('Algolia异常', err)
+ })
+ }
+}
+
/**
* 上传数据
* 根据上次修改文章日期和上次更新索引数据判断是否需要更新algolia索引
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)
From 8d200120fc21c23605f6c00f1aaa77c2c0247720 Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 01:14:20 +0800
Subject: [PATCH 05/33] feat(algolia): add data deletion functionality and
execute in index.js
- Add `checkDataFromAlgolia` function to identify and delete unused data
- Implement `deletePostDataFromAlgolia` helper function
- Execute Algolia data check during homepage generation
- Handle password-protected and draft pages deletion
---
lib/plugins/algolia.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/plugins/algolia.js b/lib/plugins/algolia.js
index fecec3a1..f3485ab7 100644
--- a/lib/plugins/algolia.js
+++ b/lib/plugins/algolia.js
@@ -60,7 +60,7 @@ const deletePostDataFromAlgolia = async post => {
.deleteObject(post.id)
.wait()
.then(r => {
- console.log('Algolia索引更新', r)
+ console.log('Algolia索引删除成功', r)
})
.catch(err => {
console.log('Algolia异常', err)
From 55c39cbab8a45d90dc402b6b8163adb318ae6128 Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 01:41:50 +0800
Subject: [PATCH 06/33] feat(algolia): implement global client initialization
and reuse
- Add global Algolia client and index initialization
- Initialize client once and reuse across functions
- Remove redundant client initialization in individual functions
- Add configuration validation during initialization
---
lib/plugins/algolia.js | 46 ++++++++++++++++++++++++++----------------
1 file changed, 29 insertions(+), 17 deletions(-)
diff --git a/lib/plugins/algolia.js b/lib/plugins/algolia.js
index f3485ab7..439451f1 100644
--- a/lib/plugins/algolia.js
+++ b/lib/plugins/algolia.js
@@ -2,6 +2,31 @@ import BLOG from '@/blog.config'
import { getPageContentText } from '@/pages/search/[keyword]'
import algoliasearch from 'algoliasearch'
+// 全局初始化 Algolia 客户端和索引
+let algoliaClient
+let algoliaIndex
+
+const initAlgolia = () => {
+ if (!algoliaClient) {
+ if (
+ !BLOG.ALGOLIA_APP_ID ||
+ !BLOG.ALGOLIA_ADMIN_APP_KEY ||
+ !BLOG.ALGOLIA_INDEX
+ ) {
+ throw new 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()
+
/**
* 生成全文索引
* @param {*} allPages
@@ -15,7 +40,6 @@ const generateAlgoliaSearch = ({ allPages, force = false }) => {
})
}
-
/**
* 检查数据是否需要从algolia删除
* @param {*} props
@@ -37,12 +61,6 @@ export const checkDataFromAlgolia = async props => {
* @param post
*/
const deletePostDataFromAlgolia = 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
}
@@ -50,13 +68,13 @@ const deletePostDataFromAlgolia = async post => {
// 检查是否有索引
let existed
try {
- existed = await index.getObject(post.id)
+ existed = await algoliaIndex.getObject(post.id)
} catch (error) {
// 通常是不存在索引
}
if (existed) {
- await index
+ await algoliaIndex
.deleteObject(post.id)
.wait()
.then(r => {
@@ -73,12 +91,6 @@ const deletePostDataFromAlgolia = async post => {
* 根据上次修改文章日期和上次更新索引数据判断是否需要更新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
}
@@ -87,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) {
// 通常是不存在索引
}
@@ -117,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 => {
From 93df743559a95f0bf9599fb2d94f8c4b5d9bd248 Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 15:37:59 +0800
Subject: [PATCH 07/33] feat(algolia): replace error throw with console.error
for missing config
Change error handling from throwing an exception to logging an error when
Algolia configuration is missing. This provides better error reporting
without breaking the application flow.
---
lib/plugins/algolia.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/plugins/algolia.js b/lib/plugins/algolia.js
index 439451f1..2421d142 100644
--- a/lib/plugins/algolia.js
+++ b/lib/plugins/algolia.js
@@ -13,7 +13,7 @@ const initAlgolia = () => {
!BLOG.ALGOLIA_ADMIN_APP_KEY ||
!BLOG.ALGOLIA_INDEX
) {
- throw new Error('Algolia configuration is missing')
+ console.error('Algolia configuration is missing')
}
algoliaClient = algoliasearch(
BLOG.ALGOLIA_APP_ID,
From d22e8bb177f2a48b616f4b25b97ca4cdfa3fed3d Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 15:50:54 +0800
Subject: [PATCH 08/33] feat(getPageContentText): add null checks for block
references
- Add validation for transclusion reference pointer existence
- Return empty string when block is not found
- Prevent potential errors from undefined block references
---
lib/notion/getPageContentText.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index 9c29cc44..20c5a451 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -56,7 +56,7 @@ export function getPageContentText(post, pageBlockMap) {
const result = []
const blockPointer = block.format.transclusion_reference_pointer
const blockPointerId = blockPointer.id
- if (blockPointer) {
+ if (blockPointer && pageBlockMap.block[blockPointerId].value) {
const blockContentList = pageBlockMap.block[blockPointerId].value.content
for (const blockContent of blockContentList) {
result.push(getBlockContentText(blockContent))
@@ -67,6 +67,9 @@ export function getPageContentText(post, pageBlockMap) {
function getBlockContentText(id) {
const block = pageBlockMap?.block[id].value
+ if (!block) {
+ return ''
+ }
const blockType = block.type
// todo: 处理更多类型
switch (blockType) {
From 645edd7eaddf060707ee064ced931b0437848ed4 Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 22:59:08 +0800
Subject: [PATCH 09/33] feat: enhance mailto/tel link handling and streamline
imports
- Introduced isMailOrTelLink utility function to validate mailto/tel links.
- Updated getPageProperties to properly handle mailto/tel links with target=_self, preventing unintended conversion to internal links by avoiding the addition of slashes.
Closes #3485
---
lib/notion/getPageProperties.js | 12 ++++++------
lib/utils/index.js | 9 +++++++++
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js
index 571c1b8c..963607d1 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 { checkStartWithHttp, convertUrlStartWithOneSlash, getLastSegmentFromUrl, 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]]
+ }
})
}
@@ -193,6 +190,9 @@ export function adjustPageProperties(properties, NOTION_CONFIG) {
if (checkStartWithHttp(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
diff --git a/lib/utils/index.js b/lib/utils/index.js
index e12f2f85..fe49c942 100644
--- a/lib/utils/index.js
+++ b/lib/utils/index.js
@@ -104,6 +104,15 @@ export function checkStartWithHttp(str) {
}
}
+/**
+ * 检查是否是邮件或电话链接
+ * @param href
+ * @returns {boolean}
+ */
+export function isMailOrTelLink(href) {
+ return /^(mailto:|tel:)/i.test(href)
+}
+
// 检查一个字符串是否UUID https://ihateregex.io/expr/uuid/
export function checkStrIsUuid(str) {
if (!str) {
From b16512ac9aff156760a11c40a9e4f0f616d367cd Mon Sep 17 00:00:00 2001
From: anime
Date: Tue, 8 Jul 2025 23:04:41 +0800
Subject: [PATCH 10/33] refactor: rename checkStartWithHttp to isHttpLink
- Update function name and implementation in utils/index.js
- Replace all occurrences in getPageProperties.js, post.js, and BlogPostCard.js
- Improve function documentation and use regex for better URL matching
---
lib/notion/getPageProperties.js | 6 +++---
lib/utils/index.js | 19 ++++++++-----------
lib/utils/post.js | 8 ++++----
themes/nav/components/BlogPostCard.js | 4 ++--
4 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js
index 963607d1..29bb5472 100644
--- a/lib/notion/getPageProperties.js
+++ b/lib/notion/getPageProperties.js
@@ -4,7 +4,7 @@ import formatDate from '../utils/formatDate'
// import { createHash } from 'crypto'
import md5 from 'js-md5'
import { siteConfig } from '../config'
-import { checkStartWithHttp, convertUrlStartWithOneSlash, getLastSegmentFromUrl, isMailOrTelLink } from '../utils'
+import { convertUrlStartWithOneSlash, getLastSegmentFromUrl, isHttpLink, isMailOrTelLink } from '../utils'
import { extractLangPrefix } from '../utils/pageId'
import { mapImgUrl } from './mapImage'
import notionAPI from '@/lib/notion/getNotionAPI'
@@ -187,7 +187,7 @@ 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)) {
@@ -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/utils/index.js b/lib/utils/index.js
index fe49c942..bfef0f46 100644
--- a/lib/utils/index.js
+++ b/lib/utils/index.js
@@ -89,19 +89,16 @@ export function isUrl(str) {
return false
}
- return str?.indexOf('/') === 0 || checkStartWithHttp(str)
+ return str?.indexOf('/') === 0 || 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)
}
/**
diff --git a/lib/utils/post.js b/lib/utils/post.js
index a3ee0f91..5cb769f2 100644
--- a/lib/utils/post.js
+++ b/lib/utils/post.js
@@ -1,7 +1,7 @@
/**
* 文章相关工具
*/
-import { checkStartWithHttp } from '.'
+import { isHttpLink } from '.'
import { getPostBlocks } from '@/lib/db/getSiteData'
import { getPageTableOfContents } from '@/lib/notion/getPageTableOfContents'
import { siteConfig } from '@/lib/config'
@@ -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/themes/nav/components/BlogPostCard.js b/themes/nav/components/BlogPostCard.js
index 0f92a30a..cdff4d55 100755
--- a/themes/nav/components/BlogPostCard.js
+++ b/themes/nav/components/BlogPostCard.js
@@ -1,5 +1,5 @@
import { siteConfig } from '@/lib/config'
-import { checkStartWithHttp } from '@/lib/utils'
+import { isHttpLink } from '@/lib/utils'
import Link from 'next/link'
import { useRouter } from 'next/router'
import NotionIcon from './NotionIcon'
@@ -23,7 +23,7 @@ const BlogPostCard = ({ post, className }) => {
return (
Date: Tue, 8 Jul 2025 23:06:07 +0800
Subject: [PATCH 11/33] refactor(utils): rename and improve isUrl to
isUrlLikePath
- Rename isUrl function to isUrlLikePath for better clarity
- Simplify function logic and add type checking
- Update all references to use the new function name
- Improve function documentation and parameter typing
---
lib/config.js | 4 ++--
lib/utils/index.js | 15 ++++++---------
2 files changed, 8 insertions(+), 11 deletions(-)
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/utils/index.js b/lib/utils/index.js
index bfef0f46..b0e0c77e 100644
--- a/lib/utils/index.js
+++ b/lib/utils/index.js
@@ -80,16 +80,13 @@ 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 || isHttpLink(str)
+export function isUrlLikePath(str) {
+ return typeof str === 'string' && (str.startsWith('/') || isHttpLink(str))
}
/**
From b52f81815461bd428ce8759978da79ebc12205e6 Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 13:11:52 +0800
Subject: [PATCH 12/33] feat(getPageContentText): replace custom text
extraction with notion-utils
The getTextContent function was removed and replaced with an import from
notion-utils, simplifying the text extraction logic for Notion page
content. This change removes the custom recursive implementation and
uses the standardized utility function instead.
---
lib/notion/getPageContentText.js | 30 +-----------------------------
1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index 20c5a451..fa93c9a8 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -1,4 +1,4 @@
-import { checkStrIsUuid, isIterable } from '@/lib/utils'
+import { getTextContent } from 'notion-utils'
export function getPageContentText(post, pageBlockMap) {
/**
@@ -24,34 +24,6 @@ export function getPageContentText(post, pageBlockMap) {
return ''
}
- // todo: 清除更多无用标签
- const removeTypeFlag = ['a', 'p', '‣']
-
- /**
- * 递归获取层层嵌套的数组
- * @param {*} textArray
- * @returns string
- */
- function getTextContent(textArray) {
- if (typeof textArray === 'object' && isIterable(textArray)) {
- let result = ''
- for (const textObj of textArray) {
- if (textArray.length > 1 && removeTypeFlag.includes(textArray[0])) {
- return result
- }
- result = result + getTextContent(textObj)
- }
- return result
- } else if (typeof textArray === 'string') {
- if (checkStrIsUuid(textArray) && pageBlockMap.block[textArray]) {
- return getBlockContentText(textArray)
- } else if (textArray === pageBlockMap.block[postId].value.space_id) {
- return ''
- }
- return textArray
- }
- }
-
function getTransclusionReference(block) {
const result = []
const blockPointer = block.format.transclusion_reference_pointer
From 44ff4bcb230a6f1145df8b934727062e72f22028 Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 13:14:41 +0800
Subject: [PATCH 13/33] feat(getPageContentText): remove debug console.log from
getPageContentText
Commented out console.log statement in getPageContentText.js
to remove debug output while maintaining the functionality.
---
lib/notion/getPageContentText.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index fa93c9a8..19130991 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -90,6 +90,6 @@ export function getPageContentText(post, pageBlockMap) {
}
}
}
- console.log(contentTextList.join(''))
+ // console.log(contentTextList.join(''))
return contentTextList.join('')
}
From 72d64d7184db69bb9b01f82bf585d38ac541935f Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 13:51:43 +0800
Subject: [PATCH 14/33] feat(getPageContentText): enhance getPageContentText to
handle nested block content
- refactor getText function to process block properties and content
- add support for recursive processing of nested block content
- improve null checks and error handling in block processing
- update getBlockContentText to handle block value safely
---
lib/notion/getPageContentText.js | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index 19130991..e4b79b37 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -3,17 +3,23 @@ import { getTextContent } from 'notion-utils'
export function getPageContentText(post, pageBlockMap) {
/**
* 将对象的指定字段拼接到字符串
- * @param sourceTextArray
- * @param targetObj
- * @param key
+ * @param block
* @returns string
*/
- function getText(targetObj) {
- if (!targetObj) {
+ function getText(block) {
+ const result = []
+ const properties = block.properties
+ if (!properties) {
return ''
}
- const textArray = targetObj['title'] || targetObj['caption']
- return getTextArray(textArray)
+ const textArray = properties['title'] || properties['caption']
+ result.push(getTextArray(textArray))
+ if (block['content']?.length > 0) {
+ for (const blockContent of block.content) {
+ result.push(getBlockContentText(blockContent))
+ }
+ }
+ return result.join('')
}
function getTextArray(textArray) {
@@ -38,7 +44,7 @@ export function getPageContentText(post, pageBlockMap) {
}
function getBlockContentText(id) {
- const block = pageBlockMap?.block[id].value
+ const block = pageBlockMap?.block[id]?.value
if (!block) {
return ''
}
@@ -51,7 +57,7 @@ export function getPageContentText(post, pageBlockMap) {
return getTableText(block.content)
case 'page':
if (id !== postId) {
- return getText(block.properties)
+ return getText(block)
}
return ''
case 'breadcrumb':
@@ -59,8 +65,7 @@ export function getPageContentText(post, pageBlockMap) {
return ''
case 'quote':
default:
- const properties = block?.properties
- return getText(properties)
+ return getText(block)
}
}
From 2a0f4fd49c086d92f3f98284dd45ff019621e4df Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 13:58:48 +0800
Subject: [PATCH 15/33] feat(getPageContentText): ensure proper spacing in
concatenated text content
Modify getPageContentText.js to use space delimiter when joining text
blocks instead of empty string. This change affects three functions:
getPageContentText, getTextArray, and getBlockContentText to improve
text readability and proper spacing between concatenated content blocks.
---
lib/notion/getPageContentText.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index e4b79b37..79fe5689 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -19,7 +19,7 @@ export function getPageContentText(post, pageBlockMap) {
result.push(getBlockContentText(blockContent))
}
}
- return result.join('')
+ return result.join(' ')
}
function getTextArray(textArray) {
@@ -40,7 +40,7 @@ export function getPageContentText(post, pageBlockMap) {
result.push(getBlockContentText(blockContent))
}
}
- return result.join('')
+ return result.join(' ')
}
function getBlockContentText(id) {
@@ -80,7 +80,7 @@ export function getPageContentText(post, pageBlockMap) {
}
}
}
- return result.join('')
+ return result.join(' ')
}
const postId = post.id
From 3ad7605abe0551d3a583fb52c34517728a76639d Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 14:09:37 +0800
Subject: [PATCH 16/33] fix: prevent processing content for page type blocks
- Skip content processing when block type is 'page'
- Update debug log message for content text concatenation
---
lib/notion/getPageContentText.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index 79fe5689..18672cc0 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -14,7 +14,7 @@ export function getPageContentText(post, pageBlockMap) {
}
const textArray = properties['title'] || properties['caption']
result.push(getTextArray(textArray))
- if (block['content']?.length > 0) {
+ if (block.type !== 'page' && block['content']?.length > 0) {
for (const blockContent of block.content) {
result.push(getBlockContentText(blockContent))
}
@@ -95,6 +95,6 @@ export function getPageContentText(post, pageBlockMap) {
}
}
}
- // console.log(contentTextList.join(''))
+ console.log('开始', contentTextList.join(''), '结束')
return contentTextList.join('')
}
From 9321b2dfaed30d631784472c91d05ae2eaa3d273 Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 14:39:47 +0800
Subject: [PATCH 17/33] feat(getPageContentText): update getPageContentText to
use post.content array
- modify content extraction logic to use post.content array
- avoid extra but wrong result by checking pageBlockMap.block
---
lib/notion/getPageContentText.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index 18672cc0..94f791a5 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -84,12 +84,12 @@ export function getPageContentText(post, pageBlockMap) {
}
const postId = post.id
+ const postContent = post.content
let contentTextList = []
// 防止搜到加密文章的内容
- if (pageBlockMap && pageBlockMap.block && !post.password) {
- const contentIds = Object.keys(pageBlockMap.block)
- for (const id of contentIds) {
- const blockContentText = getBlockContentText(id)
+ if (postContent.length > 0 && !post.password) {
+ for (const postContentId of postContent) {
+ const blockContentText = getBlockContentText(postContentId)
if (blockContentText) {
contentTextList.push(blockContentText)
}
From 23550a61d3580d593a98e0b6bf886311e133d6ea Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 15:19:47 +0800
Subject: [PATCH 18/33] feat(getPageContentText): add flexible property value
retrieval and support for more block types
- Add getPropertyValue helper function for flexible property retrieval
- Enhance getText function to accept custom keys for property lookup
- Add support for additional block types: image, bookmark, callout, header
- Improve documentation with JSDoc comments for better code understanding
---
lib/notion/getPageContentText.js | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index 94f791a5..dc94c8fc 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -1,18 +1,34 @@
import { getTextContent } from 'notion-utils'
+/**
+ * 获取属性值,优先从 overrides 中读取,否则按顺序从 properties 中读取,最后返回默认值
+ * @param {Object} properties 原始属性对象
+ * @param {Array} keys 优先级字段名列表
+ * @param {Object} overrides 自定义覆盖对象(可选)
+ * @param {string} defaultValue 默认值(可选)
+ */
+function getPropertyValue(properties, keys, overrides = {}, defaultValue = '') {
+ for (const key of keys) {
+ if (overrides[key]) return overrides[key]
+ if (properties[key]) return properties[key]
+ }
+ return defaultValue
+}
+
export function getPageContentText(post, pageBlockMap) {
/**
* 将对象的指定字段拼接到字符串
* @param block
+ * @param customKeys 优先级字段名列表
* @returns string
*/
- function getText(block) {
+ function getText(block, customKeys = ['title', 'caption']) {
const result = []
const properties = block.properties
if (!properties) {
return ''
}
- const textArray = properties['title'] || properties['caption']
+ const textArray = getPropertyValue(properties, customKeys)
result.push(getTextArray(textArray))
if (block.type !== 'page' && block['content']?.length > 0) {
for (const blockContent of block.content) {
@@ -61,9 +77,20 @@ export function getPageContentText(post, pageBlockMap) {
}
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)
}
From f9ac624498832b0d1b661b2bd158e1d92c9483f6 Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 16:00:15 +0800
Subject: [PATCH 19/33] feat(getPageContentText): implement getFullTextContent
for enhanced text extraction
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Add new getFullTextContent function to handle various Notion text formats
- Support equation extraction from decorated text
- Handle special characters like '⁍' and '‣' with proper content resolution
- Process date mentions, link mentions, and other reference types
- Replace getTextContent with getFullTextContent in getTextArray function
- Maintain backward compatibility with existing text processing
---
lib/notion/getPageContentText.js | 60 ++++++++++++++++++++++++++++++--
1 file changed, 57 insertions(+), 3 deletions(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index dc94c8fc..d8095588 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -1,5 +1,3 @@
-import { getTextContent } from 'notion-utils'
-
/**
* 获取属性值,优先从 overrides 中读取,否则按顺序从 properties 中读取,最后返回默认值
* @param {Object} properties 原始属性对象
@@ -15,6 +13,62 @@ function getPropertyValue(properties, keys, overrides = {}, defaultValue = '') {
return defaultValue
}
+/**
+ * 提取 Notion 装饰文本的纯文本内容。
+ * 可选传入 resolveRef 来解析引用(例如 '‣' 指向的页面标题)
+ *
+ * @param {Array} text - Notion Decoration[] 格式的文本数组
+ * @returns {string}
+ */
+function getFullTextContent(text) {
+ if (!text) return ''
+
+ if (!Array.isArray(text)) return String(text)
+
+ return text.reduce((result, item) => {
+ 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]
+
+ 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) {
/**
* 将对象的指定字段拼接到字符串
@@ -39,7 +93,7 @@ export function getPageContentText(post, pageBlockMap) {
}
function getTextArray(textArray) {
- const text = textArray ? getTextContent(textArray) : ''
+ const text = textArray ? getFullTextContent(textArray) : ''
if (text && text !== 'Untitled') {
return text
}
From 9886e4d146cf7270d7b833e7dc847bde797192c6 Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 16:12:12 +0800
Subject: [PATCH 20/33] feat(getPageContentText): add references to NotionX
types and comment out debug log
- Add reference links to NotionX type definitions for better documentation
- Comment out debug console.log statement to clean up output
- Maintain existing functionality while improving code clarity
---
lib/notion/getPageContentText.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index d8095588..06a11f7f 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -42,7 +42,7 @@ function getFullTextContent(text) {
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':
// 日期字符串
@@ -119,7 +119,7 @@ export function getPageContentText(post, pageBlockMap) {
return ''
}
const blockType = block.type
- // todo: 处理更多类型
+ // 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)
@@ -176,6 +176,6 @@ export function getPageContentText(post, pageBlockMap) {
}
}
}
- console.log('开始', contentTextList.join(''), '结束')
+ // console.log('开始', contentTextList.join(''), '结束')
return contentTextList.join('')
}
From ea1b76f5b7c2f10ce80efea85e022a64d8d9ca06 Mon Sep 17 00:00:00 2001
From: anime
Date: Wed, 9 Jul 2025 16:22:38 +0800
Subject: [PATCH 21/33] fix(getPageContentText): add null check for postContent
before accessing length property
Ensure postContent exists before checking its length property to prevent
potential runtime errors when postContent is null or undefined.
---
lib/notion/getPageContentText.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/notion/getPageContentText.js b/lib/notion/getPageContentText.js
index 06a11f7f..0e52083b 100644
--- a/lib/notion/getPageContentText.js
+++ b/lib/notion/getPageContentText.js
@@ -168,7 +168,7 @@ export function getPageContentText(post, pageBlockMap) {
const postContent = post.content
let contentTextList = []
// 防止搜到加密文章的内容
- if (postContent.length > 0 && !post.password) {
+ if (postContent && postContent.length > 0 && !post.password) {
for (const postContentId of postContent) {
const blockContentText = getBlockContentText(postContentId)
if (blockContentText) {
From c6b3d0a10838ccb723552ec955499bbbc888bef8 Mon Sep 17 00:00:00 2001
From: yucui
Date: Fri, 11 Jul 2025 13:38:58 +0800
Subject: [PATCH 22/33] =?UTF-8?q?Feat=20typography=20=E5=8D=9A=E5=AE=A2?=
=?UTF-8?q?=E8=8B=B1=E6=96=87=E6=A0=87=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
themes/typography/config.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/themes/typography/config.js b/themes/typography/config.js
index c496beb4..1f7d0957 100644
--- a/themes/typography/config.js
+++ b/themes/typography/config.js
@@ -1,7 +1,7 @@
const CONFIG = {
// 博客標題 雙語言
TYPOGRAPHY_BLOG_NAME: process.env.NEXT_PUBLIC_TYPOGRAPHY_BLOG_NAME || '活字印刷',
- TYPOGRAPHY_BLOG_NAME_EN: process.env.NEXT_PUBLIC_TYPOGRAPHY_BLOG_NAME || 'Typography',
+ TYPOGRAPHY_BLOG_NAME_EN: process.env.NEXT_PUBLIC_TYPOGRAPHY_BLOG_NAME_EN || process.env.NEXT_PUBLIC_TYPOGRAPHY_BLOG_NAME || 'Typography',
TYPOGRAPHY_POST_AD_ENABLE: process.env.NEXT_PUBLIC_TYPOGRAPHY_POST_AD_ENABLE || false, // 文章列表是否插入广告
From b2c9ed50148e19898609a83f922f01d2583ee154 Mon Sep 17 00:00:00 2001
From: tangly1024
Date: Fri, 11 Jul 2025 17:29:38 +0800
Subject: [PATCH 23/33] =?UTF-8?q?starter=E4=B8=BB=E9=A2=98=E6=96=B0?=
=?UTF-8?q?=E5=A2=9Elite=E6=A8=A1=E5=BC=8F=EF=BC=8C=E9=9A=90=E8=97=8F?=
=?UTF-8?q?=E9=A1=B5=E5=A4=B4=E9=A1=B5=E8=84=9A=E4=BE=BF=E4=BA=8E=E5=B5=8C?=
=?UTF-8?q?=E5=85=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/global.js | 5 ++++
themes/starter/index.js | 59 ++++++++++++++++++++++++++---------------
2 files changed, 42 insertions(+), 22 deletions(-)
diff --git a/lib/global.js b/lib/global.js
index b5d76d83..5039b9f2 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') // 默认深色模式
@@ -107,6 +108,9 @@ export function GlobalContextProvider(props) {
const newUrl = `${url}${url.includes('?') ? '&' : '?'}theme=${themeStr}`
router.push(newUrl)
}
+ if (router.query.lite && router.query.lite==='true') {
+ setLiteMode(true)
+ }
if (!onLoading) {
setOnLoading(true)
}
@@ -134,6 +138,7 @@ export function GlobalContextProvider(props) {
return (
{
- const { children } = props
+ const { children } = props
+ // 极简模式,会隐藏掉页头页脚等组件,便于嵌入网页等功能
+ const { isLiteMode } = useGlobal()
+ const router = useRouter()
- // 加载wow动画
- useEffect(() => {
- loadWowJS()
- }, [])
+ // 加载wow动画
+ useEffect(() => {
+ loadWowJS()
+ }, [])
- return (
-
-
- {/* 页头 */}
-
+ // 特殊简化布局,如果识别到路由中有 ?lite=true,则给网页添加一些自定义的css样式,例如背景改成黑色
+ useEffect(() => {
+ const isLiteMode = router.query.lite === 'true'
+ console.log(router.query.lite, isLiteMode)
+ if (isLiteMode) {
+ document.body.style.backgroundColor = 'black'
+ document.body.style.color = 'white'
+ }
+ }, [])
-
- {children}
-
+ return (
+
+
- {/* 页脚 */}
-
+ {/* 页头 */}
+ {isLiteMode ? <>> :
}
- {/* 悬浮按钮 */}
-
+
+ {children}
+
- {/*
*/}
-
- )
+ {/* 页脚 */}
+
+ {isLiteMode ? <>> :
}
+
+ {/* 悬浮按钮 */}
+ {isLiteMode ? <>> :
}
+
+ {/*
*/}
+
+ )
}
/**
From 2248625b06bc0a86118f5441ebf056fef3975fa0 Mon Sep 17 00:00:00 2001
From: tangly1024
Date: Fri, 11 Jul 2025 17:46:00 +0800
Subject: [PATCH 24/33] =?UTF-8?q?=E5=BE=AE=E8=B0=83lite=E6=A8=A1=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/global.js | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/lib/global.js b/lib/global.js
index 5039b9f2..3298fa4d 100644
--- a/lib/global.js
+++ b/lib/global.js
@@ -86,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)
@@ -108,9 +115,7 @@ export function GlobalContextProvider(props) {
const newUrl = `${url}${url.includes('?') ? '&' : '?'}theme=${themeStr}`
router.push(newUrl)
}
- if (router.query.lite && router.query.lite==='true') {
- setLiteMode(true)
- }
+
if (!onLoading) {
setOnLoading(true)
}
From c68dcb34e2d564c026e54f512565a73025ab32c0 Mon Sep 17 00:00:00 2001
From: tangly1024
Date: Sun, 13 Jul 2025 12:39:14 +0800
Subject: [PATCH 25/33] =?UTF-8?q?fix=20next=E4=B8=BB=E9=A2=98=E4=BA=8C?=
=?UTF-8?q?=E7=BA=A7=E8=8F=9C=E5=8D=95=E5=9B=BE=E6=A0=87=E9=97=B4=E9=9A=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
themes/next/components/MenuItemDrop.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/themes/next/components/MenuItemDrop.js b/themes/next/components/MenuItemDrop.js
index b4078e43..f6299273 100644
--- a/themes/next/components/MenuItemDrop.js
+++ b/themes/next/components/MenuItemDrop.js
@@ -8,7 +8,7 @@ export const MenuItemDrop = ({ link }) => {
return (
changeShow(true)}
- onMouseOut={() => changeShow(false)}
+ // 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 && (
{
target={link?.target}
className='my-auto h-9 pl-4 items-center justify-start flex not:last-child:border-b-0 border-b text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 dark:border-gray-800 '>
{sLink.icon && (
-
+
)}
{sLink.name}
{sLink.slot}
From 288bbbb89b8ffa1a08c3ce0abcd749dec74e0f82 Mon Sep 17 00:00:00 2001
From: tangly1024
Date: Sat, 19 Jul 2025 21:15:01 +0800
Subject: [PATCH 26/33] fix next theme menu drop
---
themes/next/components/MenuItemDrop.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/themes/next/components/MenuItemDrop.js b/themes/next/components/MenuItemDrop.js
index f6299273..97f382d7 100644
--- a/themes/next/components/MenuItemDrop.js
+++ b/themes/next/components/MenuItemDrop.js
@@ -8,7 +8,7 @@ export const MenuItemDrop = ({ link }) => {
return (
changeShow(true)}
- // onMouseOut={() => changeShow(false)}
+ 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 && (
Date: Wed, 23 Jul 2025 23:06:56 +0800
Subject: [PATCH 27/33] fix: correct logo ratio in Gitbook theme
Resolves #3511
---
themes/gitbook/components/LogoBar.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/themes/gitbook/components/LogoBar.js b/themes/gitbook/components/LogoBar.js
index b3f96cdf..a2f77f5c 100644
--- a/themes/gitbook/components/LogoBar.js
+++ b/themes/gitbook/components/LogoBar.js
@@ -14,7 +14,7 @@ export default function LogoBar(props) {
+ className='flex text-lg font-bold md:text-2xl dark:text-gray-200 items-center'>
Date: Thu, 24 Jul 2025 15:03:03 +0800
Subject: [PATCH 28/33] feat: add SmartLink component for internal and external
links
The component automatically detects link type and applies appropriate
rendering with proper attributes for external links.
---
components/SmartLink.js | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 components/SmartLink.js
diff --git a/components/SmartLink.js b/components/SmartLink.js
new file mode 100644
index 00000000..f2abbc83
--- /dev/null
+++ b/components/SmartLink.js
@@ -0,0 +1,27 @@
+import Link from 'next/link'
+import { siteConfig } from '@/lib/config'
+
+const SmartLink = ({ href, children, ...rest }) => {
+ const LINK = siteConfig('LINK')
+ const isExternal = href.startsWith('http') && !href.startsWith(LINK)
+
+ if (isExternal) {
+ return (
+
+ {children}
+
+ )
+ }
+
+ return (
+
+ {children}
+
+ )
+}
+
+export default SmartLink
From ba951cd2aa9e8aa32f53fe2e33e1a7c1ac168c79 Mon Sep 17 00:00:00 2001
From: anime
Date: Thu, 24 Jul 2025 15:06:39 +0800
Subject: [PATCH 29/33] feat: change all Link component to SmartLink
Close #3512
---
components/AlgoliaSearchModal.js | 6 ++---
components/CustomContextMenu.js | 10 +++----
components/ui/dashboard/DashboardButton.js | 4 +--
components/ui/dashboard/DashboardHeader.js | 6 ++---
.../ui/dashboard/DashboardItemAffliate.js | 6 ++---
components/ui/dashboard/DashboardMenuList.js | 6 ++---
themes/commerce/components/ArticleAdjacent.js | 10 +++----
.../commerce/components/ArticleCopyright.js | 6 ++---
.../commerce/components/ArticleRecommend.js | 6 ++---
themes/commerce/components/BlogPostArchive.js | 6 ++---
.../commerce/components/BlogPostCardInfo.js | 14 +++++-----
themes/commerce/components/CategoryGroup.js | 6 ++---
themes/commerce/components/Footer.js | 10 +++----
.../commerce/components/HexoRecentComments.js | 4 +--
.../commerce/components/LatestPostsGroup.js | 6 ++---
themes/commerce/components/LogoBar.js | 6 ++---
themes/commerce/components/MenuGroupCard.js | 6 ++---
.../commerce/components/MenuItemCollapse.js | 10 +++----
themes/commerce/components/MenuItemDrop.js | 10 +++----
themes/commerce/components/NavButtonGroup.js | 6 ++---
.../commerce/components/PaginationNumber.js | 14 +++++-----
themes/commerce/components/PostHeader.js | 6 ++---
themes/commerce/components/ProductCard.js | 6 ++---
.../commerce/components/ProductCategories.js | 6 ++---
themes/commerce/components/SearchNav.js | 6 ++---
themes/commerce/components/SlotBar.js | 6 ++---
themes/commerce/components/TagItemMini.js | 6 ++---
themes/commerce/index.js | 6 ++---
themes/example/components/BlogItem.js | 14 +++++-----
themes/example/components/BlogListArchive.js | 6 ++---
themes/example/components/BlogListPage.js | 10 +++----
themes/example/components/Header.js | 6 ++---
themes/example/components/MenuItemDrop.js | 10 +++----
themes/example/components/PostMeta.js | 10 +++----
.../components/RecentCommentListForExample.js | 6 ++---
themes/example/components/SideBar.js | 10 +++----
themes/example/index.js | 10 +++----
themes/fukasawa/components/ArticleAround.js | 10 +++----
themes/fukasawa/components/ArticleDetail.js | 10 +++----
themes/fukasawa/components/BlogCard.js | 14 +++++-----
themes/fukasawa/components/BlogPostArchive.js | 6 ++---
themes/fukasawa/components/GroupCategory.js | 6 ++---
themes/fukasawa/components/Logo.js | 6 ++---
.../fukasawa/components/MenuItemCollapse.js | 10 +++----
themes/fukasawa/components/MenuItemDrop.js | 10 +++----
themes/fukasawa/components/MenuItemNormal.js | 6 ++---
.../fukasawa/components/PaginationSimple.js | 10 +++----
themes/fukasawa/components/TagItem.js | 6 ++---
themes/fukasawa/components/TagItemMini.js | 6 ++---
themes/fukasawa/index.js | 6 ++---
themes/game/components/BlogArchiveItem.js | 6 ++---
themes/game/components/BlogPost.js | 6 ++---
.../game/components/ExampleRecentComments.js | 4 +--
themes/game/components/GameEmbed.js | 6 ++---
.../game/components/GameListIndexCombine.js | 6 ++---
themes/game/components/GameListNormal.js | 6 ++---
themes/game/components/GameListRealate.js | 6 ++---
themes/game/components/GroupCategory.js | 10 +++----
themes/game/components/GroupTag.js | 6 ++---
themes/game/components/Logo.js | 6 ++---
themes/game/components/LogoMini.js | 6 ++---
themes/game/components/MenuItemCollapse.js | 10 +++----
themes/game/components/MenuItemDrop.js | 10 +++----
themes/game/components/PaginationSimple.js | 10 +++----
themes/game/components/PostInfo.js | 6 ++---
themes/game/components/SideBar.js | 10 +++----
themes/game/components/TagItem.js | 6 ++---
themes/game/components/TagItemMini.js | 6 ++---
themes/game/components/Tags.js | 6 ++---
themes/game/index.js | 10 +++----
themes/gitbook/components/ArticleAround.js | 10 +++----
themes/gitbook/components/BlogArchiveItem.js | 6 ++---
themes/gitbook/components/BlogPostCard.js | 6 ++---
themes/gitbook/components/CategoryItem.js | 6 ++---
themes/gitbook/components/LeftMenuBar.js | 6 ++---
themes/gitbook/components/LogoBar.js | 6 ++---
themes/gitbook/components/MenuItemCollapse.js | 10 +++----
themes/gitbook/components/MenuItemDrop.js | 10 +++----
.../components/MenuItemMobileNormal.js | 6 ++---
themes/gitbook/components/MenuItemPCNormal.js | 6 ++---
themes/gitbook/components/PaginationSimple.js | 10 +++----
themes/gitbook/components/TagItemMini.js | 6 ++---
themes/gitbook/index.js | 6 ++---
themes/heo/components/BlogPostArchive.js | 14 +++++-----
themes/heo/components/BlogPostCard.js | 14 +++++-----
themes/heo/components/CategoryBar.js | 8 +++---
themes/heo/components/CategoryGroup.js | 6 ++---
themes/heo/components/Hero.js | 18 ++++++-------
themes/heo/components/HexoRecentComments.js | 6 ++---
themes/heo/components/InfoCard.js | 14 +++++-----
themes/heo/components/LatestPostsGroup.js | 6 ++---
themes/heo/components/LatestPostsGroupMini.js | 6 ++---
themes/heo/components/Logo.js | 6 ++---
themes/heo/components/MenuGroupCard.js | 6 ++---
themes/heo/components/MenuItemCollapse.js | 10 +++----
themes/heo/components/MenuItemDrop.js | 10 +++----
themes/heo/components/NavButtonGroup.js | 6 ++---
themes/heo/components/PaginationNumber.js | 22 ++++++++--------
themes/heo/components/PostAdjacent.js | 14 +++++-----
themes/heo/components/PostCopyright.js | 6 ++---
themes/heo/components/PostHeader.js | 14 +++++-----
themes/heo/components/PostRecommend.js | 6 ++---
themes/heo/components/SearchNav.js | 6 ++---
themes/heo/components/SlideOver.js | 6 ++---
themes/heo/components/TagGroups.js | 6 ++---
themes/heo/components/TagItemMini.js | 6 ++---
themes/heo/components/TouchMeCard.js | 6 ++---
themes/heo/index.js | 14 +++++-----
themes/hexo/components/ArticleAdjacent.js | 10 +++----
themes/hexo/components/ArticleCopyright.js | 6 ++---
themes/hexo/components/ArticleRecommend.js | 6 ++---
themes/hexo/components/BlogPostArchive.js | 6 ++---
themes/hexo/components/BlogPostCard.js | 6 ++---
themes/hexo/components/BlogPostCardInfo.js | 14 +++++-----
themes/hexo/components/CategoryGroup.js | 6 ++---
themes/hexo/components/Header.js | 10 +++----
themes/hexo/components/HexoRecentComments.js | 4 +--
themes/hexo/components/LatestPostsGroup.js | 6 ++---
themes/hexo/components/Logo.js | 6 ++---
themes/hexo/components/MenuGroupCard.js | 6 ++---
themes/hexo/components/MenuItemCollapse.js | 10 +++----
themes/hexo/components/MenuItemDrop.js | 10 +++----
themes/hexo/components/NavButtonGroup.js | 6 ++---
themes/hexo/components/PaginationNumber.js | 14 +++++-----
themes/hexo/components/PostHero.js | 10 +++----
themes/hexo/components/SearchNav.js | 6 ++---
themes/hexo/components/SlotBar.js | 6 ++---
themes/hexo/components/TagItemMini.js | 6 ++---
themes/hexo/index.js | 6 ++---
themes/landing/components/Footer.js | 4 +--
themes/landing/components/Header.js | 10 +++----
themes/landing/components/Logo.js | 6 ++---
themes/landing/components/MobileMenu.js | 10 +++----
themes/landing/components/Pricing.js | 14 +++++-----
themes/magzine/components/BannerItem.js | 4 +--
themes/magzine/components/CategoryGroup.js | 6 ++---
themes/magzine/components/CategoryItem.js | 6 ++---
themes/magzine/components/Footer.js | 6 ++---
themes/magzine/components/LeftMenuBar.js | 6 ++---
themes/magzine/components/LogoBar.js | 6 ++---
themes/magzine/components/MenuItemCollapse.js | 10 +++----
themes/magzine/components/MenuItemDrop.js | 10 +++----
.../components/MenuItemMobileNormal.js | 6 ++---
themes/magzine/components/MenuItemPCNormal.js | 6 ++---
themes/magzine/components/PaginationSimple.js | 10 +++----
themes/magzine/components/PostGroupLatest.js | 6 ++---
themes/magzine/components/PostItemCard.js | 10 +++----
.../magzine/components/PostItemCardSimple.js | 6 ++---
themes/magzine/components/PostItemCardTop.js | 14 +++++-----
themes/magzine/components/PostItemCardWide.js | 10 +++----
.../magzine/components/PostListHorizontal.js | 10 +++----
.../components/PostListSimpleHorizontal.js | 10 +++----
themes/magzine/components/PostNavAround.js | 14 +++++-----
themes/magzine/components/TagItemMini.js | 6 ++---
themes/magzine/components/TouchMeCard.js | 6 ++---
themes/magzine/index.js | 6 ++---
themes/matery/components/ArticleCopyright.js | 6 ++---
themes/matery/components/ArticleInfo.js | 6 ++---
themes/matery/components/ArticleRecommend.js | 6 ++---
themes/matery/components/BlogListBar.js | 6 ++---
themes/matery/components/BlogPostArchive.js | 6 ++---
themes/matery/components/BlogPostCard.js | 14 +++++-----
themes/matery/components/CategoryGroup.js | 6 ++---
themes/matery/components/Header.js | 10 +++----
.../matery/components/HexoRecentComments.js | 4 +--
themes/matery/components/Logo.js | 6 ++---
themes/matery/components/MenuGroupCard.js | 6 ++---
themes/matery/components/MenuItemCollapse.js | 10 +++----
themes/matery/components/MenuItemDrop.js | 10 +++----
themes/matery/components/MenuItemNormal.js | 6 ++---
themes/matery/components/MenuList.js | 6 ++---
themes/matery/components/NavButtonGroup.js | 6 ++---
themes/matery/components/PaginationNumber.js | 14 +++++-----
themes/matery/components/PaginationSimple.js | 10 +++----
themes/matery/components/SearchNav.js | 6 ++---
themes/matery/components/TagItemMiddle.js | 6 ++---
themes/matery/components/TagItemMini.js | 6 ++---
themes/matery/index.js | 6 ++---
themes/medium/components/ArticleAround.js | 10 +++----
themes/medium/components/ArticleInfo.js | 6 ++---
themes/medium/components/BlogArchiveItem.js | 6 ++---
themes/medium/components/BlogPostCard.js | 10 +++----
themes/medium/components/BottomMenuBar.js | 10 +++----
themes/medium/components/CategoryItem.js | 6 ++---
themes/medium/components/LeftMenuBar.js | 6 ++---
themes/medium/components/LogoBar.js | 6 ++---
themes/medium/components/MenuItemCollapse.js | 10 +++----
themes/medium/components/MenuItemDrop.js | 10 +++----
.../medium/components/MenuItemMobileNormal.js | 6 ++---
themes/medium/components/MenuItemPCNormal.js | 6 ++---
themes/medium/components/PaginationSimple.js | 10 +++----
themes/medium/components/TagItemMini.js | 6 ++---
themes/medium/index.js | 6 ++---
themes/movie/components/ArchiveDateList.js | 6 ++---
themes/movie/components/ArticleInfo.js | 14 +++++-----
.../movie/components/BlogListGroupByDate.js | 6 ++---
themes/movie/components/BlogPostCard.js | 6 ++---
themes/movie/components/BlogRecommend.js | 6 ++---
themes/movie/components/CategoryGroup.js | 6 ++---
themes/movie/components/CategoryItem.js | 6 ++---
.../movie/components/ExampleRecentComments.js | 4 +--
themes/movie/components/Header.js | 6 ++---
themes/movie/components/LatestPostsGroup.js | 6 ++---
themes/movie/components/MenuItemCollapse.js | 10 +++----
themes/movie/components/MenuItemDrop.js | 10 +++----
themes/movie/components/NormalMenuItem.js | 6 ++---
themes/movie/components/PaginationNumber.js | 22 ++++++++--------
themes/movie/components/SideBar.js | 10 +++----
themes/movie/components/TagGroups.js | 6 ++---
themes/movie/components/TagItem.js | 6 ++---
themes/movie/components/TagItemMini.js | 6 ++---
themes/nav/components/ArticleAround.js | 10 +++----
themes/nav/components/BlogArchiveItem.js | 6 ++---
themes/nav/components/BlogPostCard.js | 6 ++---
themes/nav/components/CategoryItem.js | 6 ++---
themes/nav/components/LeftMenuBar.js | 6 ++---
themes/nav/components/LogoBar.js | 6 ++---
themes/nav/components/MenuItem.js | 10 +++----
themes/nav/components/MenuItemCollapse.js | 10 +++----
themes/nav/components/MenuItemDrop.js | 10 +++----
themes/nav/components/MenuItemMobileNormal.js | 6 ++---
themes/nav/components/MenuItemPCNormal.js | 6 ++---
themes/nav/components/NavPostList.js | 6 ++---
themes/nav/components/PaginationSimple.js | 10 +++----
themes/nav/components/TagItemMini.js | 6 ++---
themes/nav/index.js | 6 ++---
themes/next/components/ArticleCopyright.js | 6 ++---
themes/next/components/ArticleDetail.js | 10 +++----
themes/next/components/BlogAround.js | 10 +++----
themes/next/components/BlogPostArchive.js | 6 ++---
themes/next/components/BlogPostCard.js | 22 ++++++++--------
themes/next/components/CategoryGroup.js | 6 ++---
themes/next/components/CategoryList.js | 6 ++---
themes/next/components/ContactButton.js | 6 ++---
themes/next/components/LatestPostsGroup.js | 6 ++---
themes/next/components/Live2DWaifu.js | 2 +-
themes/next/components/Logo.js | 6 ++---
themes/next/components/MenuItemCollapse.js | 10 +++----
themes/next/components/MenuItemDrop.js | 10 +++----
themes/next/components/NextRecentComments.js | 4 +--
themes/next/components/PaginationNumber.js | 14 +++++-----
themes/next/components/PaginationSimple.js | 10 +++----
themes/next/components/RecommendPosts.js | 6 ++---
themes/next/components/SideAreaRight.js | 10 +++----
themes/next/components/SideBar.js | 10 +++----
themes/next/components/TagItem.js | 6 ++---
themes/next/components/TagItemMini.js | 6 ++---
themes/next/components/TopNav.js | 10 +++----
themes/next/index.js | 6 ++---
themes/nobelium/components/BlogArchiveItem.js | 6 ++---
themes/nobelium/components/BlogListPage.js | 10 +++----
themes/nobelium/components/BlogListScroll.js | 6 ++---
themes/nobelium/components/BlogPost.js | 6 ++---
.../components/ExampleRecentComments.js | 4 +--
.../nobelium/components/MenuItemCollapse.js | 10 +++----
themes/nobelium/components/MenuItemDrop.js | 10 +++----
themes/nobelium/components/Nav.js | 6 ++---
themes/nobelium/components/SideBar.js | 10 +++----
themes/nobelium/components/TagItem.js | 6 ++---
themes/nobelium/components/Tags.js | 6 ++---
themes/nobelium/index.js | 10 +++----
themes/photo/components/ArchiveDateList.js | 6 ++---
themes/photo/components/ArticleFooter.js | 14 +++++-----
.../photo/components/BlogListGroupByDate.js | 6 ++---
themes/photo/components/BlogPostCard.js | 6 ++---
themes/photo/components/BlogRecommend.js | 6 ++---
themes/photo/components/CategoryGroup.js | 6 ++---
themes/photo/components/CategoryItem.js | 6 ++---
.../photo/components/ExampleRecentComments.js | 4 +--
themes/photo/components/Header.js | 6 ++---
themes/photo/components/LatestPostsGroup.js | 6 ++---
themes/photo/components/MenuItemCollapse.js | 10 +++----
themes/photo/components/MenuItemDrop.js | 10 +++----
themes/photo/components/NormalMenuItem.js | 6 ++---
themes/photo/components/PaginationNumber.js | 22 ++++++++--------
themes/photo/components/PostItemCard.js | 10 +++----
themes/photo/components/SideBar.js | 10 +++----
themes/photo/components/TagGroups.js | 6 ++---
themes/photo/components/TagItem.js | 6 ++---
themes/photo/components/TagItemMini.js | 6 ++---
themes/plog/components/BlogArchiveItem.js | 6 ++---
themes/plog/components/BlogListPage.js | 10 +++----
themes/plog/components/BlogListScroll.js | 6 ++---
themes/plog/components/BlogPost.js | 6 ++---
.../plog/components/ExampleRecentComments.js | 4 +--
themes/plog/components/LogoBar.js | 12 ++++-----
themes/plog/components/MenuItemCollapse.js | 10 +++----
themes/plog/components/MenuItemDrop.js | 10 +++----
themes/plog/components/Modal.js | 10 +++----
themes/plog/components/Nav.js | 6 ++---
themes/plog/components/SideBar.js | 10 +++----
themes/plog/components/TagItem.js | 6 ++---
themes/plog/components/Tags.js | 6 ++---
themes/plog/index.js | 10 +++----
themes/proxio/components/Blog.js | 10 +++----
themes/proxio/components/CTA.js | 6 ++---
themes/proxio/components/Career.js | 2 +-
themes/proxio/components/Features.js | 6 ++---
themes/proxio/components/Footer.js | 6 ++---
themes/proxio/components/Header.js | 2 +-
themes/proxio/components/Hero.js | 6 ++---
themes/proxio/components/MenuItem.js | 10 +++----
themes/proxio/components/Pricing.js | 14 +++++-----
themes/proxio/components/Team.js | 6 ++---
themes/proxio/components/Testimonials.js | 6 ++---
themes/proxio/index.js | 26 +++++++++----------
themes/simple/components/ArticleAround.js | 10 +++----
themes/simple/components/ArticleInfo.js | 8 +++---
themes/simple/components/BlogArchiveItem.js | 6 ++---
themes/simple/components/BlogItem.js | 26 +++++++++----------
themes/simple/components/BlogListPage.js | 10 +++----
.../components/ExampleRecentComments.js | 4 +--
themes/simple/components/Header.js | 6 ++---
themes/simple/components/MenuItemCollapse.js | 10 +++----
themes/simple/components/MenuItemDrop.js | 10 +++----
themes/simple/components/RecommendPosts.js | 6 ++---
themes/simple/index.js | 10 +++----
themes/starter/components/About.js | 6 ++---
themes/starter/components/Blog.js | 10 +++----
themes/starter/components/CTA.js | 6 ++---
themes/starter/components/Features.js | 18 ++++++-------
themes/starter/components/Footer.js | 22 ++++++++--------
themes/starter/components/Header.js | 18 ++++++-------
themes/starter/components/Hero.js | 10 +++----
themes/starter/components/MenuItem.js | 10 +++----
themes/starter/components/Pricing.js | 14 +++++-----
themes/starter/index.js | 26 +++++++++----------
themes/typography/components/ArticleAround.js | 10 +++----
themes/typography/components/ArticleInfo.js | 14 +++++-----
.../typography/components/BlogArchiveItem.js | 6 ++---
themes/typography/components/BlogItem.js | 22 ++++++++--------
themes/typography/components/BlogListPage.js | 10 +++----
.../components/ExampleRecentComments.js | 4 +--
.../typography/components/MenuItemCollapse.js | 10 +++----
themes/typography/components/MenuItemDrop.js | 10 +++----
themes/typography/components/NavBar.js | 6 ++---
.../typography/components/RecommendPosts.js | 6 ++---
themes/typography/index.js | 10 +++----
338 files changed, 1381 insertions(+), 1381 deletions(-)
diff --git a/components/AlgoliaSearchModal.js b/components/AlgoliaSearchModal.js
index f398c461..175b5eb6 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,
@@ -356,7 +356,7 @@ function TagGroups() {
{firstTenTags?.map((tag, index) => {
return (
- >
)}
-
+
)
})}
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/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/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 b418a655..be56f052 100644
--- a/themes/commerce/components/ArticleCopyright.js
+++ b/themes/commerce/components/ArticleCopyright.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'
import { useEffect, useState } from 'react'
import CONFIG from '../config'
@@ -24,9 +24,9 @@ export default function ArticleCopyright() {
-
{locale.COMMON.AUTHOR}:
-
+
{siteConfig('AUTHOR')}
-
+
-
{locale.COMMON.URL}:
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 3411773c..ba36e511 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'
/**
@@ -40,13 +40,13 @@ const Footer = props => {
className={'flex flex-col space-y-2 text-start'}>
{categoryOptions?.map(category => {
return (
-
{category.name}
-
+
)
})}
@@ -62,13 +62,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/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}
-
+
)
}
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..0ca4f479 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,7 +12,7 @@ export default function LogoBar(props) {
const { siteInfo } = props
return (
-
{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'>
-
+
-
+
)
})}
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.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.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 }) {
-
{locale.COMMON.NEXT_POST}
{next?.title}
-
+
)
diff --git a/themes/heo/components/PostCopyright.js b/themes/heo/components/PostCopyright.js
index 4fb1eb25..22775d4c 100644
--- a/themes/heo/components/PostCopyright.js
+++ b/themes/heo/components/PostCopyright.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'
@@ -28,9 +28,9 @@ export default function PostCopyright() {
-
{locale.COMMON.AUTHOR}:
-
+
{siteConfig('AUTHOR')}
-
+
-
{locale.COMMON.URL}:
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/index.js b/themes/heo/index.js
index ab779940..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'
@@ -397,11 +397,11 @@ const Layout404 = props => {
404
请尝试站内搜索寻找文章
-
+
-
+
@@ -435,7 +435,7 @@ const LayoutCategoryIndex = props => {
className='duration-200 flex flex-wrap m-10 justify-center'>
{categoryOptions?.map(category => {
return (
- {
{category.count}
-
+
)
})}
@@ -477,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 a7be768d..2115453e 100644
--- a/themes/hexo/components/ArticleCopyright.js
+++ b/themes/hexo/components/ArticleCopyright.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'
import { useEffect, useState } from 'react'
import CONFIG from '../config'
@@ -24,9 +24,9 @@ export default function ArticleCopyright() {
-
{locale.COMMON.AUTHOR}:
-
+
{siteConfig('AUTHOR')}
-
+
-
{locale.COMMON.URL}:
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
} 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/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'>
-
+
-
+
)
})}
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 }) {
-
{locale.COMMON.NEXT_POST}
{next?.title}
-
+
)
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 64fe19e5..b3c15b9f 100644
--- a/themes/matery/components/ArticleCopyright.js
+++ b/themes/matery/components/ArticleCopyright.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'
import { useEffect, useState } from 'react'
import CONFIG from '../config'
@@ -24,9 +24,9 @@ export default function ArticleCopyright() {
-
{locale.COMMON.AUTHOR}:
-
+
{siteConfig('AUTHOR')}
-
+
-
{locale.COMMON.URL}:
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/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'>
-
+
-
+
)
})}
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..0a3dbffe 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 SmartLink from '@/components/SmartLink'
import { useRouter } from 'next/router'
import NotionIcon from './NotionIcon'
@@ -21,7 +21,7 @@ const BlogPostCard = ({ post, className }) => {
? post.pageIcon + '&width=88'
: post.pageIcon
return (
-
@@ -44,7 +44,7 @@ const BlogPostCard = ({ post, className }) => {
-
+
)
}
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('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'>
-
+
-
+
)
})}
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 6626713c..e151a505 100644
--- a/themes/next/components/ArticleCopyright.js
+++ b/themes/next/components/ArticleCopyright.js
@@ -1,5 +1,5 @@
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'
@@ -14,9 +14,9 @@ export default function ArticleCopyright({ author, url }) {
-
{locale.COMMON.AUTHOR}:
-
+
{author}
-
+
-
{locale.COMMON.URL}:
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 97f382d7..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,7 +46,7 @@ export const MenuItemDrop = ({ link }) => {
{link?.subMenus?.map(sLink => {
return (
-
-
@@ -55,7 +55,7 @@ export const MenuItemDrop = ({ link }) => {
)}
{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/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 6476e14a..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'
/**
* 博文列表
@@ -69,7 +69,7 @@ export const Blog = ({ posts }) => {
className='wow fadeInUp group mb-10 relative overflow-hidden blog'
data-wow-delay='.1s'>
-
+
{item.pageCoverThumbnail && (
// 图片半透明
{
className='absolute max-h-full object-cover'
/>
-
+
{/* 内容部分 */}
@@ -100,11 +100,11 @@ export const Blog = ({ posts }) => {
{item.publishDay}
-
{item.title}
-
+
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.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 && (
-
+
-
+
)}
@@ -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 0f731451..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'
@@ -129,10 +129,10 @@ const LayoutIndex = props => {
<>
-
+
{locale.COMMON.MORE}
-
+
>
)}
@@ -298,11 +298,11 @@ const Layout404 = props => {
{siteConfig('STARTER_404_TEXT')}
-
{siteConfig('STARTER_404_BACK')}
-
+
@@ -362,24 +362,24 @@ const LayoutPostList = props => {
className='wow fadeInUp group mb-10'
data-wow-delay='.1s'>
-
+
-
+
{item.publishDay}
-
{item.title}
-
+
{item.summary}
@@ -415,7 +415,7 @@ const LayoutCategoryIndex = props => {
className='duration-200 flex flex-wrap justify-center items-center '>
{categoryOptions?.map(category => {
return (
- {
{category.name}({category.count})
-
+
)
})}
@@ -456,7 +456,7 @@ const LayoutTagIndex = props => {
{tagOptions.map(tag => {
return (
- {
{' '}
{tag.name + (tag.count ? `(${tag.count})` : '')}{' '}
-
+
)
})}
diff --git a/themes/typography/components/ArticleAround.js b/themes/typography/components/ArticleAround.js
index b4cee232..a2f9c7d3 100644
--- a/themes/typography/components/ArticleAround.js
+++ b/themes/typography/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/typography/components/ArticleInfo.js b/themes/typography/components/ArticleInfo.js
index ed1d39a9..00655004 100644
--- a/themes/typography/components/ArticleInfo.js
+++ b/themes/typography/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,33 +28,33 @@ export default function ArticleInfo(props) {
发布于
-
{post.date?.start_date || post.createdTime}
-
+
{/* {post.category && (
-
+
{' '}
{post.category}
-
+
)} */}
{post?.tags &&
post?.tags?.length > 0 &&
post?.tags.map(t => (
-
#{t}
-
+
))}
diff --git a/themes/typography/components/BlogArchiveItem.js b/themes/typography/components/BlogArchiveItem.js
index 4f849906..28bab810 100644
--- a/themes/typography/components/BlogArchiveItem.js
+++ b/themes/typography/components/BlogArchiveItem.js
@@ -1,4 +1,4 @@
-import Link from 'next/link'
+import SmartLink from '@/components/SmartLink'
/**
* 归档分组文章
@@ -19,12 +19,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
key={post.id}
className='p-1 pl-0 text-base items-center mb-3'>
-
{post.title}
-
+
{post.date?.start_date}
diff --git a/themes/typography/components/BlogItem.js b/themes/typography/components/BlogItem.js
index aed75761..be2ac0ef 100644
--- a/themes/typography/components/BlogItem.js
+++ b/themes/typography/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 => {
@@ -23,26 +23,26 @@ export const BlogItem = props => {
{/* 图片封面 */}
{showPageCover && (
-
+
-
+
)}
-
{siteConfig('POST_TITLE_ICON') && (
)}
{post.title}
-
+
{/* 文章信息 */}
@@ -50,33 +50,33 @@ export const BlogItem = props => {
发布于
-
{post.date?.start_date || post.createdTime}
-
+
{/* {post.category && (
-
+
{' '}
{post.category}
-
+
)} */}
{post?.tags &&
post?.tags?.length > 0 &&
post?.tags.map(t => (
-
#{t}
-
+
))}
diff --git a/themes/typography/components/BlogListPage.js b/themes/typography/components/BlogListPage.js
index d7def141..333bbb8c 100644
--- a/themes/typography/components/BlogListPage.js
+++ b/themes/typography/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/typography/components/ExampleRecentComments.js b/themes/typography/components/ExampleRecentComments.js
index 93cde585..663151a1 100644
--- a/themes/typography/components/ExampleRecentComments.js
+++ b/themes/typography/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/typography/components/MenuItemCollapse.js b/themes/typography/components/MenuItemCollapse.js
index 50174dc3..9de40a79 100644
--- a/themes/typography/components/MenuItemCollapse.js
+++ b/themes/typography/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/typography/components/MenuItemDrop.js b/themes/typography/components/MenuItemDrop.js
index a5effb13..fa718f13 100644
--- a/themes/typography/components/MenuItemDrop.js
+++ b/themes/typography/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'
@@ -18,12 +18,12 @@ export const MenuItemDrop = ({ link }) => {
return (
{!hasSubMenu && (
-
{link?.name}
-
+
)
}
@@ -57,12 +57,12 @@ export const MenuItemDrop = ({ link }) => {
-
-
+
{link?.icon && }
{sLink.title}
-
+
)
})}
diff --git a/themes/typography/components/NavBar.js b/themes/typography/components/NavBar.js
index 53ab0b8c..e13a7209 100644
--- a/themes/typography/components/NavBar.js
+++ b/themes/typography/components/NavBar.js
@@ -4,7 +4,7 @@ import { useState } from 'react'
import { useSimpleGlobal } from '..'
import { MenuList } from './MenuList'
import SocialButton from './SocialButton'
-import Link from 'next/link'
+import SmartLink from '@/components/SmartLink'
/**
* 菜单导航
@@ -15,7 +15,7 @@ export default function NavBar(props) {
return (
-
+
{siteConfig('TYPOGRAPHY_BLOG_NAME')}
@@ -24,7 +24,7 @@ export default function NavBar(props) {
{siteConfig('TYPOGRAPHY_BLOG_NAME_EN')}
-
+
)
})}
From 7f43846e33846abd23801e7601e20014fb91cb7b Mon Sep 17 00:00:00 2001
From: anime
Date: Thu, 24 Jul 2025 15:49:36 +0800
Subject: [PATCH 30/33] feat: add DOM props filtering for SmartLink component
- Introduce filterDOMProps utility to exclude Next.js specific props
- Apply filtering to external links to ensure clean DOM attributes
- Maintain consistent prop passing for internal Next.js links
---
components/SmartLink.js | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/components/SmartLink.js b/components/SmartLink.js
index f2abbc83..c0a6ec79 100644
--- a/components/SmartLink.js
+++ b/components/SmartLink.js
@@ -1,6 +1,15 @@
import Link from 'next/link'
import { siteConfig } from '@/lib/config'
+// 保留允许传给 的属性
+const filterDOMProps = (props) => {
+ const {
+ passHref,
+ legacyBehavior,
+ ...rest
+ } = props;
+ return rest;
+};
const SmartLink = ({ href, children, ...rest }) => {
const LINK = siteConfig('LINK')
const isExternal = href.startsWith('http') && !href.startsWith(LINK)
@@ -11,14 +20,14 @@ const SmartLink = ({ href, children, ...rest }) => {
href={href}
target='_blank'
rel='noopener noreferrer'
- {...rest}>
+ {...filterDOMProps(rest)}>
{children}
)
}
return (
-
+
{children}
)
From 57d6a1779dfb4122a18654a9fc82b93f8dd43833 Mon Sep 17 00:00:00 2001
From: anime
Date: Thu, 24 Jul 2025 17:05:38 +0800
Subject: [PATCH 31/33] feat: enhance SmartLink component for better external
link handling
- support object format of href
- improve URL string extraction logic
- add proper type checking for href prop
- ensure external links use string format
---
components/SmartLink.js | 40 ++++++++++++++++++++++++++++------------
1 file changed, 28 insertions(+), 12 deletions(-)
diff --git a/components/SmartLink.js b/components/SmartLink.js
index c0a6ec79..3fedfeaf 100644
--- a/components/SmartLink.js
+++ b/components/SmartLink.js
@@ -1,23 +1,38 @@
import Link from 'next/link'
import { siteConfig } from '@/lib/config'
-// 保留允许传给 的属性
-const filterDOMProps = (props) => {
- const {
- passHref,
- legacyBehavior,
- ...rest
- } = props;
- return rest;
-};
+// 过滤 标签不能识别的 props
+const filterDOMProps = props => {
+ const { passHref, legacyBehavior, ...rest } = props
+ return rest
+}
+
const SmartLink = ({ href, children, ...rest }) => {
const LINK = siteConfig('LINK')
- const isExternal = href.startsWith('http') && !href.startsWith(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 (
@@ -26,8 +41,9 @@ const SmartLink = ({ href, children, ...rest }) => {
)
}
+ // 内部链接(可为对象形式)
return (
-
+
{children}
)
From 4fca5cec7483fe0c2cf8b672cfa6055391c8aced Mon Sep 17 00:00:00 2001
From: Redhair Hambagu
Date: Sun, 27 Jul 2025 10:14:55 +0000
Subject: [PATCH 32/33] fix: APlayer url update
---
components/Player.js | 2 +-
conf/widget.config.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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 ? (
Date: Sun, 27 Jul 2025 21:01:43 +0800
Subject: [PATCH 33/33] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=AF=BC=E8=87=B4=E7=AB=99=E7=82=B9=E5=B4=A9?=
=?UTF-8?q?=E6=BA=83=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/notion/mapImage.js | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
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 (