mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-31 15:10:11 +00:00
@@ -1,5 +1,5 @@
|
|||||||
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
|
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
|
||||||
NEXT_PUBLIC_VERSION=4.4.5
|
NEXT_PUBLIC_VERSION=4.4.6
|
||||||
|
|
||||||
|
|
||||||
# 可在此添加环境变量,去掉最左边的(# )注释即可
|
# 可在此添加环境变量,去掉最左边的(# )注释即可
|
||||||
|
|||||||
@@ -152,12 +152,16 @@ const ExternalPlugin = props => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// 异步渲染谷歌广告
|
||||||
if (ADSENSE_GOOGLE_ID) {
|
if (ADSENSE_GOOGLE_ID) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 异步渲染谷歌广告
|
|
||||||
initGoogleAdsense()
|
initGoogleAdsense()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 执行注入脚本
|
||||||
|
// eslint-disable-next-line no-eval
|
||||||
|
eval(GLOBAL_JS)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
if (DISABLE_PLUGIN) {
|
if (DISABLE_PLUGIN) {
|
||||||
@@ -206,16 +210,6 @@ const ExternalPlugin = props => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 注入JS脚本 */}
|
|
||||||
{GLOBAL_JS && (
|
|
||||||
<script
|
|
||||||
async
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: GLOBAL_JS
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{CHATBASE_ID && (
|
{CHATBASE_ID && (
|
||||||
<>
|
<>
|
||||||
<script
|
<script
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { useEffect } from 'react'
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const GlobalHead = props => {
|
const GlobalHead = props => {
|
||||||
const { children, siteInfo } = props
|
const { children, siteInfo, post } = props
|
||||||
let url = siteConfig('PATH')?.length
|
let url = siteConfig('PATH')?.length
|
||||||
? `${siteConfig('LINK')}/${siteConfig('SUB_PATH', '')}`
|
? `${siteConfig('LINK')}/${siteConfig('SUB_PATH', '')}`
|
||||||
: siteConfig('LINK')
|
: siteConfig('LINK')
|
||||||
@@ -25,12 +25,17 @@ const GlobalHead = props => {
|
|||||||
const title = meta?.title || siteConfig('TITLE')
|
const title = meta?.title || siteConfig('TITLE')
|
||||||
const description = meta?.description || `${siteInfo?.description}`
|
const description = meta?.description || `${siteInfo?.description}`
|
||||||
const type = meta?.type || 'website'
|
const type = meta?.type || 'website'
|
||||||
const keywords = meta?.tags || siteConfig('KEYWORDS')
|
|
||||||
const lang = siteConfig('LANG').replace('-', '_') // Facebook OpenGraph 要 zh_CN 這樣的格式才抓得到語言
|
const lang = siteConfig('LANG').replace('-', '_') // Facebook OpenGraph 要 zh_CN 這樣的格式才抓得到語言
|
||||||
const category = meta?.category || siteConfig('KEYWORDS') // section 主要是像是 category 這樣的分類,Facebook 用這個來抓連結的分類
|
const category = meta?.category || siteConfig('KEYWORDS') // section 主要是像是 category 這樣的分類,Facebook 用這個來抓連結的分類
|
||||||
const favicon = siteConfig('BLOG_FAVICON')
|
const favicon = siteConfig('BLOG_FAVICON')
|
||||||
const webFontUrl = siteConfig('FONT_URL')
|
const webFontUrl = siteConfig('FONT_URL')
|
||||||
|
|
||||||
|
// SEO关键词
|
||||||
|
let keywords = meta?.tags || siteConfig('KEYWORDS')
|
||||||
|
if (post?.tags && post?.tags?.length > 0) {
|
||||||
|
keywords = post?.tags?.join(',')
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// 使用WebFontLoader字体加载
|
// 使用WebFontLoader字体加载
|
||||||
loadExternalResource(
|
loadExternalResource(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "notion-next",
|
"name": "notion-next",
|
||||||
"version": "4.4.5",
|
"version": "4.4.6",
|
||||||
"homepage": "https://github.com/tangly1024/NotionNext.git",
|
"homepage": "https://github.com/tangly1024/NotionNext.git",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user