mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Merge remote-tracking branch 'origin/main' into pr/1208nn/1626
This commit is contained in:
171
.env.local
171
.env.local
@@ -1,2 +1,173 @@
|
||||
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
|
||||
NEXT_PUBLIC_VERSION=4.1.0
|
||||
|
||||
# 可在此添加环境变量,去掉最左边的(# )注释即可
|
||||
# Notion页面ID,必须
|
||||
# NOTION_PAGE_ID=
|
||||
|
||||
# 非必须
|
||||
# NEXT_PUBLIC_PSEUDO_STATIC=
|
||||
# NEXT_PUBLIC_REVALIDATE_SECOND=
|
||||
# NEXT_PUBLIC_THEME=
|
||||
# NEXT_PUBLIC_THEME_SWITCH=
|
||||
# NEXT_PUBLIC_LANG=
|
||||
# NEXT_PUBLIC_APPEARANCE=
|
||||
# NEXT_PUBLIC_APPEARANCE_DARK_TIME=
|
||||
# NEXT_PUBLIC_GREETING_WORDS=
|
||||
# NEXT_PUBLIC_CUSTOM_MENU=
|
||||
# NEXT_PUBLIC_AUTHOR=
|
||||
# NEXT_PUBLIC_BIO=
|
||||
# NEXT_PUBLIC_LINK=
|
||||
# NEXT_PUBLIC_KEYWORD=
|
||||
# NEXT_PUBLIC_CONTACT_EMAIL=
|
||||
# NEXT_PUBLIC_CONTACT_WEIBO=
|
||||
# NEXT_PUBLIC_CONTACT_TWITTER=
|
||||
# NEXT_PUBLIC_CONTACT_GITHUB=
|
||||
# NEXT_PUBLIC_CONTACT_TELEGRAM=
|
||||
# NEXT_PUBLIC_CONTACT_LINKEDIN=
|
||||
# NEXT_PUBLIC_CONTACT_INSTAGRAM=
|
||||
# NEXT_PUBLIC_CONTACT_BILIBILI=
|
||||
# NEXT_PUBLIC_CONTACT_YOUTUBE=
|
||||
# NEXT_PUBLIC_FAVICON=
|
||||
# NEXT_PUBLIC_FONT_STYLE=
|
||||
# NEXT_PUBLIC_FONT_URL=
|
||||
# NEXT_PUBLIC_FONT_SANS=
|
||||
# NEXT_PUBLIC_FONT_SERIF=
|
||||
# NEXT_PUBLIC_FONT_AWESOME_PATH=
|
||||
# NEXT_PUBLIC_PRISM_THEME_PREFIX_PATH=
|
||||
# NEXT_PUBLIC_PRISM_THEME_SWITCH=
|
||||
# NEXT_PUBLIC_PRISM_THEME_LIGHT_PATH=
|
||||
# NEXT_PUBLIC_PRISM_THEME_DARK_PATH=
|
||||
# NEXT_PUBLIC_CODE_MAC_BAR=
|
||||
# NEXT_PUBLIC_CODE_LINE_NUMBERS=
|
||||
# NEXT_PUBLIC_CODE_COLLAPSE=
|
||||
# NEXT_PUBLIC_CODE_COLLAPSE_EXPAND_DEFAULT=
|
||||
# NEXT_PUBLIC_MERMAID_CDN=
|
||||
# NEXT_PUBLIC_QR_CODE_CDN=
|
||||
# NEXT_PUBLIC_BACKGROUND_LIGHT=
|
||||
# NEXT_PUBLIC_BACKGROUND_DARK=
|
||||
# NEXT_PUBLIC_SUB_PATH=
|
||||
# NEXT_PUBLIC_POST_SHARE_BAR=
|
||||
# NEXT_PUBLIC_POST_SHARE_SERVICES=
|
||||
# NEXT_PUBLIC_POST_URL_PREFIX=
|
||||
# NEXT_PUBLIC_POST_LIST_STYLE=
|
||||
# NEXT_PUBLIC_POST_PREVIEW=
|
||||
# NEXT_PUBLIC_POST_RECOMMEND_COUNT=
|
||||
# NEXT_PUBLIC_POSTS_PER_PAGE=
|
||||
# NEXT_PUBLIC_POST_SORT_BY=
|
||||
# NEXT_PUBLIC_ALGOLIA_APP_ID=
|
||||
# ALGOLIA_ADMIN_APP_KEY=
|
||||
# NEXT_PUBLIC_ALGOLIA_SEARCH_ONLY_APP_KEY=
|
||||
# NEXT_PUBLIC_ALGOLIA_INDEX=
|
||||
# NEXT_PUBLIC_PREVIEW_CATEGORY_COUNT=
|
||||
# NEXT_PUBLIC_PREVIEW_TAG_COUNT=
|
||||
# NEXT_PUBLIC_POST_DISABLE_GALLERY_CLICK=
|
||||
# NEXT_PUBLIC_FIREWORKS=
|
||||
# NEXT_PUBLIC_FIREWORKS_COLOR=
|
||||
# NEXT_PUBLIC_SAKURA=
|
||||
# NEXT_PUBLIC_NEST=
|
||||
# NEXT_PUBLIC_FLUTTERINGRIBBON=
|
||||
# NEXT_PUBLIC_RIBBON=
|
||||
# NEXT_PUBLIC_STARRY_SKY=
|
||||
# NEXT_PUBLIC_CHATBASE_ID=
|
||||
# NEXT_PUBLIC_WEB_WHIZ_ENABLED=
|
||||
# NEXT_PUBLIC_WEB_WHIZ_BASE_URL=
|
||||
# NEXT_PUBLIC_WEB_WHIZ_CHAT_BOT_ID=
|
||||
# NEXT_PUBLIC_WIDGET_PET=
|
||||
# NEXT_PUBLIC_WIDGET_PET_LINK=
|
||||
# NEXT_PUBLIC_WIDGET_PET_SWITCH_THEME=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_VISIBLE=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_AUTO_PLAY=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_LRC_TYPE=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_CDN_URL=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_ORDER=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_AUDIO_LIST=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_METING=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_METING_SERVER=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_METING_ID=
|
||||
# NEXT_PUBLIC_MUSIC_PLAYER_METING_LRC_TYPE=
|
||||
# NEXT_PUBLIC_COMMENT_ARTALK_SERVER=
|
||||
# NEXT_PUBLIC_COMMENT_ARTALK_JS=
|
||||
# NEXT_PUBLIC_COMMENT_ARTALK_CSS=
|
||||
# NEXT_PUBLIC_COMMENT_ENV_ID=
|
||||
# NEXT_PUBLIC_COMMENT_TWIKOO_COUNT_ENABLE=
|
||||
# NEXT_PUBLIC_COMMENT_TWIKOO_CDN_URL=
|
||||
# NEXT_PUBLIC_COMMENT_UTTERRANCES_REPO=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_REPO=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_REPO_ID=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_CATEGORY_ID=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_MAPPING=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_REACTIONS_ENABLED=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_EMIT_METADATA=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_INPUT_POSITION=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_LANG=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_LOADING=
|
||||
# NEXT_PUBLIC_COMMENT_GISCUS_CROSSORIGIN=
|
||||
# NEXT_PUBLIC_COMMENT_CUSDIS_APP_ID=
|
||||
# NEXT_PUBLIC_COMMENT_CUSDIS_HOST=
|
||||
# NEXT_PUBLIC_COMMENT_CUSDIS_SCRIPT_SRC=
|
||||
# NEXT_PUBLIC_COMMENT_GITALK_REPO=
|
||||
# NEXT_PUBLIC_COMMENT_GITALK_OWNER=
|
||||
# NEXT_PUBLIC_COMMENT_GITALK_ADMIN=
|
||||
# NEXT_PUBLIC_COMMENT_GITALK_CLIENT_ID=
|
||||
# NEXT_PUBLIC_COMMENT_GITALK_CLIENT_SECRET=
|
||||
# NEXT_PUBLIC_COMMENT_GITALK_JS_CDN_URL=
|
||||
# NEXT_PUBLIC_COMMENT_GITALK_CSS_CDN_URL=
|
||||
# NEXT_PUBLIC_COMMENT_GITTER_ROOM=
|
||||
# NEXT_PUBLIC_COMMENT_DAO_VOICE_ID=
|
||||
# NEXT_PUBLIC_COMMENT_TIDIO_ID=
|
||||
# NEXT_PUBLIC_VALINE_CDN=
|
||||
# NEXT_PUBLIC_VALINE_ID=
|
||||
# NEXT_PUBLIC_VALINE_KEY=
|
||||
# NEXT_PUBLIC_VALINE_SERVER_URLS=
|
||||
# NEXT_PUBLIC_VALINE_PLACEHOLDER=
|
||||
# NEXT_PUBLIC_WALINE_SERVER_URL=
|
||||
# NEXT_PUBLIC_WALINE_RECENT=
|
||||
# NEXT_PUBLIC_WEBMENTION_ENABLE=
|
||||
# NEXT_PUBLIC_WEBMENTION_AUTH=
|
||||
# NEXT_PUBLIC_WEBMENTION_HOSTNAME=
|
||||
# NEXT_PUBLIC_TWITTER_USERNAME=
|
||||
# NEXT_PUBLIC_WEBMENTION_TOKEN=
|
||||
# NEXT_PUBLIC_ANALYTICS_VERCEL=
|
||||
# NEXT_PUBLIC_ANALYTICS_BUSUANZI_ENABLE=
|
||||
# NEXT_PUBLIC_ANALYTICS_BAIDU_ID=
|
||||
# NEXT_PUBLIC_ANALYTICS_CNZZ_ID=
|
||||
# NEXT_PUBLIC_ANALYTICS_GOOGLE_ID=
|
||||
# NEXT_PUBLIC_ANALYTICS_ACKEE_TRACKER=
|
||||
# NEXT_PUBLIC_ANALYTICS_ACKEE_DATA_SERVER=
|
||||
# NEXT_PUBLIC_ANALYTICS_ACKEE_DOMAIN_ID=
|
||||
# NEXT_PUBLIC_SEO_GOOGLE_SITE_VERIFICATION=
|
||||
# NEXT_PUBLIC_SEO_BAIDU_SITE_VERIFICATION=
|
||||
# NEXT_PUBLIC_ADSENSE_GOOGLE_ID=
|
||||
# NEXT_PUBLIC_ADSENSE_GOOGLE_TEST=
|
||||
# NEXT_PUBLIC_ADSENSE_GOOGLE_SLOT_IN_ARTICLE=
|
||||
# NEXT_PUBLIC_ADSENSE_GOOGLE_SLOT_FLOW=
|
||||
# NEXT_PUBLIC_ADSENSE_GOOGLE_SLOT_NATIVE=
|
||||
# NEXT_PUBLIC_ADSENSE_GOOGLE_SLOT_AUTO=
|
||||
# NEXT_PUBLIC_WWAD_ID=
|
||||
# NEXT_PUBLIC_WWADS_AD_BLOCK_DETECT=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_PASSWORD=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_TYPE=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_TYPE_POST=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_TYPE_PAGE=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_TYPE_NOTICE=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_TYPE_MENU=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_TYPE_SUB_MENU=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_TITLE=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_STATUS=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_STATUS_PUBLISH=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_STATUS_INVISIBLE=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_SUMMARY=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_SLUG=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_CATEGORY=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_DATE=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_TAGS=
|
||||
# NEXT_PUBLIC_NOTION_PROPERTY_ICON=
|
||||
# NEXT_PUBLIC_ENABLE_RSS=
|
||||
# MAILCHIMP_LIST_ID=
|
||||
# MAILCHIMP_API_KEY=
|
||||
# NEXT_PUBLIC_DEBUG=
|
||||
# ENABLE_CACHE=
|
||||
# VERCEL_ENV=
|
||||
# NEXT_PUBLIC_VERSION=
|
||||
|
||||
18
.github/ISSUE_TEMPLATE/bug_report.md
vendored
18
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -12,23 +12,23 @@ assignees: tangly1024
|
||||
-->
|
||||
|
||||
**描述bug**
|
||||
简单说明bug的现象、相关的错误提示、日志等
|
||||
【此项必填】简单说明bug的现象、相关的错误提示、日志等
|
||||
|
||||
**复现步骤**
|
||||
出现这个bug的操作步骤
|
||||
【此项必填】出现这个bug的操作步骤
|
||||
|
||||
**期望的正常结果**
|
||||
希望按这个步骤,正常操作结果是什么
|
||||
【此项必填】希望按这个步骤,正常操作结果是什么
|
||||
|
||||
**截图**
|
||||
相关的页面,应该的结果
|
||||
【可选】相关的页面,应该的结果
|
||||
|
||||
**环境**
|
||||
|
||||
- 操作系统: [例如. iOS, Android, macOS, windows]
|
||||
- 浏览器 [例如. chrome, safari, firefox]
|
||||
- NotionNext版本 [e.g. 3.13.6]
|
||||
- 主题 [例如. hexo]
|
||||
- 【必填】NotionNext版本 [例如. 4.0.18]
|
||||
- 【必填】主题 [例如. hexo]
|
||||
- 【可选】操作系统: [例如. iOS, Android, macOS, windows]
|
||||
- 【可选】浏览器 [例如. chrome, safari, firefox]
|
||||
|
||||
**补充说明**
|
||||
与问题相关的其它说明
|
||||
【可选】与问题相关的其它说明
|
||||
@@ -37,6 +37,11 @@ const BLOG = {
|
||||
|
||||
BLOG_FAVICON: process.env.NEXT_PUBLIC_FAVICON || '/favicon.ico', // blog favicon 配置, 默认使用 /public/favicon.ico,支持在线图片,如 https://img.imesong.com/favicon.png
|
||||
|
||||
RANDOM_IMAGE_URL: process.env.NEXT_PUBLIC_RANDOM_IMAGE_URL || '', // 随机图片API,如果未配置下面的关键字,主页封面,头像,文章封面图都会被替换为随机图片
|
||||
RANDOM_IMAGE_REPLACE_TEXT: process.env.NEXT_PUBLIC_RANDOM_IMAGE_NOT_REPLACE_TEXT || 'images.unsplash.com', // 触发替换图片的 url 关键字(多个支持用英文逗号分开),只有图片地址中包含此关键字才会替换为上方随机图片url
|
||||
// eg: images.unsplash.com(notion图床的所有图片都会替换),如果你在 notion 里已经添加了一个随机图片 url,恰巧那个服务跑路或者挂掉,想一键切换所有配图可以将该 url 配置在这里
|
||||
// 默认下会将你上传到 notion的主页封面图和头像也给替换,建议将主页封面图和头像放在其他图床,在 notion 里配置 link 即可。
|
||||
|
||||
// START ************网站字体*****************
|
||||
|
||||
FONT_STYLE: process.env.NEXT_PUBLIC_FONT_STYLE || 'font-sans', // ['font-serif','font-sans'] 两种可选,分别是衬线和无衬线: 参考 https://www.jianshu.com/p/55e410bd2115
|
||||
@@ -319,6 +324,9 @@ const BLOG = {
|
||||
ANALYTICS_CNZZ_ID: process.env.NEXT_PUBLIC_ANALYTICS_CNZZ_ID || '', // 只需要填写站长统计的id, [cnzz_id] -> https://s9.cnzz.com/z_stat.php?id=[cnzz_id]&web_id=[cnzz_id]
|
||||
ANALYTICS_GOOGLE_ID: process.env.NEXT_PUBLIC_ANALYTICS_GOOGLE_ID || '', // 谷歌Analytics的id e.g: G-XXXXXXXXXX
|
||||
|
||||
// Matomo 网站统计
|
||||
MATOMO_HOST_URL: process.env.NEXT_PUBLIC_MATOMO_HOST_URL || '', // Matomo服务器地址,不带斜杠
|
||||
MATOMO_SITE_ID: process.env.NEXT_PUBLIC_MATOMO_SITE_ID || '', // Matomo网站ID
|
||||
// ACKEE网站访客统计工具
|
||||
ANALYTICS_ACKEE_TRACKER: process.env.NEXT_PUBLIC_ANALYTICS_ACKEE_TRACKER || '', // e.g 'https://ackee.tangly1024.com/tracker.js'
|
||||
ANALYTICS_ACKEE_DATA_SERVER: process.env.NEXT_PUBLIC_ANALYTICS_ACKEE_DATA_SERVER || '', // e.g https://ackee.tangly1024.com , don't end with a slash
|
||||
|
||||
@@ -102,43 +102,74 @@ export default function AlgoliaSearchModal({ cRef }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div id='search-wrapper' className={`${isModalOpen ? 'opacity-100' : 'invisible opacity-0 pointer-events-none'} z-30 fixed h-screen w-screen left-0 top-0 mt-12 flex items-start justify-center`}>
|
||||
|
||||
{/* 模态框 */}
|
||||
<div className={`${isModalOpen ? 'opacity-100' : 'invisible opacity-0 translate-y-10'} flex flex-col justify-between w-full min-h-[10rem] max-w-xl dark:bg-hexo-black-gray dark:border-gray-800 bg-white dark:bg- p-5 rounded-lg z-50 shadow border hover:border-blue-600 duration-300 transition-all `}>
|
||||
|
||||
<div className='flex justify-between items-center'>
|
||||
<div className='text-2xl text-blue-600 font-bold'>搜索</div>
|
||||
<div><i className="text-gray-600 fa-solid fa-xmark p-1 cursor-pointer hover:text-blue-600" onClick={closeModal} ></i></div>
|
||||
</div>
|
||||
|
||||
<input type="text" placeholder="在这里输入搜索关键词..." onChange={(e) => handleInputChange(e)}
|
||||
className="text-black dark:text-gray-200 bg-gray-50 dark:bg-gray-600 outline-blue-500 w-full px-4 my-2 py-1 mb-4 border rounded-md" />
|
||||
|
||||
{/* 标签组 */}
|
||||
<div className='mb-4'>
|
||||
<TagGroups/>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
{searchResults.map((result) => (
|
||||
<li key={result.objectID} className="replace my-2">
|
||||
<a href={`${siteConfig('SUB_PATH')}/${result.slug}`} className="font-bold hover:text-blue-600 text-black dark:text-gray-200">
|
||||
{result.title}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<Pagination totalPage={totalPage} page={page} switchPage={switchPage}/>
|
||||
<div>{totalHit > 0 && <div>共搜索到 {totalHit} 条结果,用时 {useTime} 毫秒</div> }</div>
|
||||
<div className='text-gray-600 mt-2'><span><i className="fa-brands fa-algolia"></i> Algolia 提供搜索服务</span> </div>
|
||||
</div>
|
||||
|
||||
{/* 遮罩 */}
|
||||
<div onClick={closeModal} className="z-30 fixed top-0 left-0 w-full h-full flex items-center justify-center glassmorphism" />
|
||||
|
||||
<div
|
||||
id="search-wrapper"
|
||||
className={`${
|
||||
isModalOpen ? 'opacity-100' : 'invisible opacity-0 pointer-events-none'
|
||||
} z-30 fixed h-screen w-screen left-0 top-0 mt-12 flex items-start justify-center`}
|
||||
>
|
||||
{/* 模态框 */}
|
||||
<div
|
||||
className={`${
|
||||
isModalOpen ? 'opacity-100' : 'invisible opacity-0 translate-y-10'
|
||||
} flex flex-col justify-between w-full min-h-[10rem] max-w-xl dark:bg-hexo-black-gray dark:border-gray-800 bg-white dark:bg- p-5 rounded-lg z-50 shadow border hover:border-blue-600 duration-300 transition-all `}
|
||||
>
|
||||
<div className="flex justify-between items-center">
|
||||
<div className="text-2xl text-blue-600 font-bold">搜索</div>
|
||||
<div>
|
||||
<i
|
||||
className="text-gray-600 fa-solid fa-xmark p-1 cursor-pointer hover:text-blue-600"
|
||||
onClick={closeModal}
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
placeholder="在这里输入搜索关键词..."
|
||||
onChange={e => handleInputChange(e)}
|
||||
className="text-black dark:text-gray-200 bg-gray-50 dark:bg-gray-600 outline-blue-500 w-full px-4 my-2 py-1 mb-4 border rounded-md"
|
||||
/>
|
||||
|
||||
{/* 标签组 */}
|
||||
<div className="mb-4">
|
||||
<TagGroups />
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
{searchResults.map(result => (
|
||||
<li key={result.objectID} className="replace my-2">
|
||||
<a
|
||||
href={`${siteConfig('SUB_PATH', '')}/${result.slug}`}
|
||||
className="font-bold hover:text-blue-600 text-black dark:text-gray-200"
|
||||
>
|
||||
{result.title}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<Pagination totalPage={totalPage} page={page} switchPage={switchPage} />
|
||||
<div>
|
||||
{totalHit > 0 && (
|
||||
<div>
|
||||
共搜索到 {totalHit} 条结果,用时 {useTime} 毫秒
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="text-gray-600 mt-2">
|
||||
<span>
|
||||
<i className="fa-brands fa-algolia"></i> Algolia 提供搜索服务
|
||||
</span>{' '}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 遮罩 */}
|
||||
<div
|
||||
onClick={closeModal}
|
||||
className="z-30 fixed top-0 left-0 w-full h-full flex items-center justify-center glassmorphism"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -149,6 +149,24 @@ const ExternalPlugin = (props) => {
|
||||
/>
|
||||
</>)}
|
||||
|
||||
{/* Matomo 统计 */}
|
||||
{siteConfig('MATOMO_HOST_URL') && siteConfig('MATOMO_SITE_ID') && (
|
||||
<script async dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
var _paq = window._paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//${siteConfig('MATOMO_HOST_URL')}/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '${siteConfig('MATOMO_SITE_ID')}']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
`
|
||||
}}/>
|
||||
)}
|
||||
|
||||
</>
|
||||
}
|
||||
|
||||
|
||||
@@ -14,16 +14,18 @@ export default function QrCode({ value }) {
|
||||
return
|
||||
}
|
||||
loadExternalResource(qrCodeCDN, 'js').then(url => {
|
||||
const QRCode = window.QRCode
|
||||
qrcode = new QRCode(document.getElementById('qrcode'), {
|
||||
text: value,
|
||||
width: 256,
|
||||
height: 256,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff',
|
||||
correctLevel: QRCode.CorrectLevel.H
|
||||
})
|
||||
// console.log('二维码', qrcode, value)
|
||||
const QRCode = window?.QRCode
|
||||
if (typeof QRCode !== 'undefined') {
|
||||
qrcode = new QRCode(document.getElementById('qrcode'), {
|
||||
text: value,
|
||||
width: 256,
|
||||
height: 256,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff',
|
||||
correctLevel: QRCode.CorrectLevel.H
|
||||
})
|
||||
// console.log('二维码', qrcode, value)
|
||||
}
|
||||
})
|
||||
return () => {
|
||||
if (qrcode) {
|
||||
|
||||
@@ -15,13 +15,16 @@ const Twikoo = ({ isDarkMode }) => {
|
||||
|
||||
const lang = siteConfig('LANG')
|
||||
useEffect(() => {
|
||||
window?.twikoo?.init({
|
||||
envId: envId, // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
|
||||
el: el, // 容器元素
|
||||
lang: lang // 用于手动设定评论区语言,支持的语言列表 https://github.com/imaegoo/twikoo/blob/main/src/client/utils/i18n/index.js
|
||||
// region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填
|
||||
// path: location.pathname, // 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数
|
||||
})
|
||||
const twikoo = window?.twikoo
|
||||
if (typeof twikoo !== 'undefined' && twikoo && typeof twikoo.init === 'function') {
|
||||
twikoo.init({
|
||||
envId: envId, // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
|
||||
el: el, // 容器元素
|
||||
lang: lang // 用于手动设定评论区语言,支持的语言列表 https://github.com/imaegoo/twikoo/blob/main/src/client/utils/i18n/index.js
|
||||
// region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填
|
||||
// path: location.pathname, // 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数
|
||||
})
|
||||
}
|
||||
}, [isDarkMode])
|
||||
return (
|
||||
<div id="twikoo"></div>
|
||||
|
||||
@@ -42,7 +42,7 @@ const uploadDataToAlgolia = async(post) => {
|
||||
if (!existed || !existed?.lastEditedDate || !existed?.lastIndexDate) {
|
||||
needUpdateIndex = true
|
||||
} else {
|
||||
const lastEditedDate = new Date(existed.lastEditedDate)
|
||||
const lastEditedDate = new Date(post.lastEditedDate)
|
||||
const lastIndexDate = new Date(existed.lastIndexDate)
|
||||
if (lastEditedDate.getTime() > lastIndexDate.getTime()) {
|
||||
needUpdateIndex = true
|
||||
|
||||
@@ -68,6 +68,25 @@ const mapImgUrl = (img, block, type = 'block', from) => {
|
||||
}
|
||||
|
||||
if (!isEmoji(ret) && ret.indexOf('notion.so/images/page-cover') < 0) {
|
||||
if (BLOG.RANDOM_IMAGE_URL) {
|
||||
// 只有配置了随机图片接口,才会替换图片
|
||||
const texts = BLOG.RANDOM_IMAGE_REPLACE_TEXT
|
||||
let isReplace = false;
|
||||
if (texts) {
|
||||
const textArr = texts.split(',')
|
||||
// 判断是否包含替换的文本
|
||||
textArr.forEach(text => {
|
||||
if (ret.indexOf(text) > -1) {
|
||||
isReplace = true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
isReplace = true
|
||||
}
|
||||
if (isReplace) {
|
||||
ret = BLOG.RANDOM_IMAGE_URL
|
||||
}
|
||||
}
|
||||
// 随机图片接口优化 防止因url一致而随机结果相同
|
||||
const separator = ret.includes('?') ? '&' : '?'
|
||||
// 拼接唯一识别参数,防止请求的图片被缓存
|
||||
|
||||
@@ -31,7 +31,7 @@ const ArchiveIndex = props => {
|
||||
|
||||
const meta = {
|
||||
title: `${locale.NAV.ARCHIVE} | ${siteConfig('TITLE')}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
image: siteInfo?.pageCover,
|
||||
slug: 'archive',
|
||||
type: 'website'
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function Category(props) {
|
||||
title: `${props.category} | ${locale.COMMON.CATEGORY} | ${
|
||||
siteConfig('TITLE') || ''
|
||||
}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
slug: 'category/' + props.category,
|
||||
image: siteInfo?.pageCover,
|
||||
type: 'website'
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function Category(props) {
|
||||
title: `${props.category} | ${locale.COMMON.CATEGORY} | ${
|
||||
siteConfig('TITLE') || ''
|
||||
}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
slug: 'category/' + props.category,
|
||||
image: siteInfo?.pageCover,
|
||||
type: 'website'
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function Category(props) {
|
||||
|
||||
const meta = {
|
||||
title: `${locale.COMMON.CATEGORY} | ${siteConfig('TITLE')}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
image: siteInfo?.pageCover,
|
||||
slug: 'category',
|
||||
type: 'website'
|
||||
|
||||
@@ -18,7 +18,7 @@ const Page = props => {
|
||||
|
||||
const meta = {
|
||||
title: `${props?.page} | Page | ${siteConfig('TITLE')}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
image: siteInfo?.pageCover,
|
||||
slug: 'page/' + props.page,
|
||||
type: 'website'
|
||||
|
||||
@@ -36,7 +36,7 @@ const Search = props => {
|
||||
|
||||
const meta = {
|
||||
title: `${keyword || ''}${keyword ? ' | ' : ''}${locale.NAV.SEARCH} | ${siteConfig('TITLE')}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
image: siteInfo?.pageCover,
|
||||
slug: 'search',
|
||||
type: 'website'
|
||||
|
||||
@@ -19,7 +19,7 @@ const Tag = props => {
|
||||
|
||||
const meta = {
|
||||
title: `${tag} | ${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
image: siteInfo?.pageCover,
|
||||
slug: 'tag/' + tag,
|
||||
type: 'website'
|
||||
|
||||
@@ -14,7 +14,7 @@ const Tag = props => {
|
||||
|
||||
const meta = {
|
||||
title: `${tag} | ${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
image: siteInfo?.pageCover,
|
||||
slug: 'tag/' + tag,
|
||||
type: 'website'
|
||||
|
||||
@@ -19,7 +19,7 @@ const TagIndex = props => {
|
||||
|
||||
const meta = {
|
||||
title: `${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`,
|
||||
description: siteConfig('HOME_BANNER_IMAGE'),
|
||||
description: siteConfig('DESCRIPTION'),
|
||||
image: siteInfo?.pageCover,
|
||||
slug: 'tag',
|
||||
type: 'website'
|
||||
|
||||
@@ -8,8 +8,10 @@ import { siteConfig } from '@/lib/config'
|
||||
* 通知横幅
|
||||
*/
|
||||
export function NoticeBar() {
|
||||
const notices = siteConfig('HEO_NOTICE_BAR', null, CONFIG)
|
||||
|
||||
let notices = siteConfig('HEO_NOTICE_BAR', null, CONFIG)
|
||||
if (typeof notices === 'string') {
|
||||
notices = JSON.parse(notices)
|
||||
}
|
||||
if (!notices || notices?.length === 0) {
|
||||
return <></>
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ const SideBar = (props) => {
|
||||
<div className='mx-5 pt-6 pb-2'>
|
||||
<LazyImage src={siteInfo?.icon} className='cursor-pointer rounded-full' width={80} alt={siteConfig('AUTHOR')} />
|
||||
<div className='text-white text-xl my-1'>{siteConfig('TITLE')}</div>
|
||||
<div className='text-xs my-1 text-gray-300'>{siteConfig('HOME_BANNER_IMAGE')}</div>
|
||||
<div className='text-xs my-1 text-gray-300'>{siteConfig('DESCRIPTION')}</div>
|
||||
</div>
|
||||
</div>
|
||||
<MenuListSide {...props} />
|
||||
|
||||
@@ -63,7 +63,7 @@ const Nav = props => {
|
||||
: (
|
||||
<p className="ml-2 font-medium text-gray-800 dark:text-gray-300 header-name whitespace-nowrap">
|
||||
{siteConfig('TITLE')}
|
||||
{/* ,{' '}<span className="font-normal">{siteConfig('HOME_BANNER_IMAGE')}</span> */}
|
||||
{/* ,{' '}<span className="font-normal">{siteConfig('DESCRIPTION')}</span> */}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { siteConfig } from '@/lib/config'
|
||||
*/
|
||||
export const Title = (props) => {
|
||||
const { post } = props
|
||||
const title = post?.title || siteConfig('HOME_BANNER_IMAGE')
|
||||
const title = post?.title || siteConfig('DESCRIPTION')
|
||||
const description = post?.description || siteConfig('AUTHOR')
|
||||
|
||||
return <div className="text-center px-6 py-12 mb-6 bg-gray-100 dark:bg-hexo-black-gray dark:border-hexo-black-gray border-b">
|
||||
|
||||
@@ -30,8 +30,8 @@ export default function LogoBar(props) {
|
||||
)
|
||||
: (
|
||||
<p className="ml-2 font-medium text-gray-800 dark:text-gray-300 header-name">
|
||||
<Link href="/" aria-label={siteConfig('title')}> {siteConfig('TITLE')}</Link>
|
||||
{' '}<span className="font-normal text-sm text-gray-00 dark:text-gray-400">{siteConfig('HOME_BANNER_IMAGE')}</span>
|
||||
<Link href="/" aria-label={siteConfig('TITLE')}> {siteConfig('TITLE')}</Link>
|
||||
{' '}<span className="font-normal text-sm text-gray-00 dark:text-gray-400">{siteConfig('DESCRIPTION')}</span>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { siteConfig } from '@/lib/config'
|
||||
*/
|
||||
export const Title = (props) => {
|
||||
const { post } = props
|
||||
const title = post?.title || siteConfig('HOME_BANNER_IMAGE')
|
||||
const title = post?.title || siteConfig('DESCRIPTION')
|
||||
const description = post?.description || siteConfig('AUTHOR')
|
||||
|
||||
return <div className="text-center px-6 py-12 mb-6 bg-gray-100 dark:bg-hexo-black-gray dark:border-hexo-black-gray border-b">
|
||||
|
||||
@@ -32,7 +32,7 @@ export const Header = (props) => {
|
||||
<div className='flex justify-center'>
|
||||
<SocialButton />
|
||||
</div>
|
||||
<div className='text-xs mt-4 text-gray-500 dark:text-gray-300'>{siteConfig('HOME_BANNER_IMAGE')}</div>
|
||||
<div className='text-xs mt-4 text-gray-500 dark:text-gray-300'>{siteConfig('DESCRIPTION')}</div>
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ import { siteConfig } from '@/lib/config'
|
||||
*/
|
||||
export const Title = (props) => {
|
||||
const { post } = props
|
||||
const title = post?.title || siteConfig('HOME_BANNER_IMAGE')
|
||||
const title = post?.title || siteConfig('DESCRIPTION')
|
||||
const description = post?.description || siteConfig('AUTHOR')
|
||||
|
||||
return <div className="text-center px-6 py-12 mb-6 bg-gray-100 dark:bg-hexo-black-gray dark:border-hexo-black-gray border-b">
|
||||
|
||||
Reference in New Issue
Block a user