Skip to content

Commit

Permalink
Merge pull request #2345 from tangly1024/release/v4.4.6
Browse files Browse the repository at this point in the history
V4.4.6
  • Loading branch information
tangly1024 committed Apr 28, 2024
2 parents b7a8587 + 6993469 commit dbe1a4e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .env.local
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
NEXT_PUBLIC_VERSION=4.4.5
NEXT_PUBLIC_VERSION=4.4.6


# 可在此添加环境变量,去掉最左边的(# )注释即可
Expand Down
16 changes: 5 additions & 11 deletions components/ExternalPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,16 @@ const ExternalPlugin = props => {
}

useEffect(() => {
// 异步渲染谷歌广告
if (ADSENSE_GOOGLE_ID) {
setTimeout(() => {
// 异步渲染谷歌广告
initGoogleAdsense()
}, 1000)
}

// 执行注入脚本
// eslint-disable-next-line no-eval
eval(GLOBAL_JS)
}, [])

if (DISABLE_PLUGIN) {
Expand Down Expand Up @@ -206,16 +210,6 @@ const ExternalPlugin = props => {
</>
)}

{/* 注入JS脚本 */}
{GLOBAL_JS && (
<script
async
dangerouslySetInnerHTML={{
__html: GLOBAL_JS
}}
/>
)}

{CHATBASE_ID && (
<>
<script
Expand Down
9 changes: 7 additions & 2 deletions components/GlobalHead.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useEffect } from 'react'
* @returns
*/
const GlobalHead = props => {
const { children, siteInfo } = props
const { children, siteInfo, post } = props
let url = siteConfig('PATH')?.length
? `${siteConfig('LINK')}/${siteConfig('SUB_PATH', '')}`
: siteConfig('LINK')
Expand All @@ -25,12 +25,17 @@ const GlobalHead = props => {
const title = meta?.title || siteConfig('TITLE')
const description = meta?.description || `${siteInfo?.description}`
const type = meta?.type || 'website'
const keywords = meta?.tags || siteConfig('KEYWORDS')
const lang = siteConfig('LANG').replace('-', '_') // Facebook OpenGraph 要 zh_CN 這樣的格式才抓得到語言
const category = meta?.category || siteConfig('KEYWORDS') // section 主要是像是 category 這樣的分類,Facebook 用這個來抓連結的分類
const favicon = siteConfig('BLOG_FAVICON')
const webFontUrl = siteConfig('FONT_URL')

// SEO关键词
let keywords = meta?.tags || siteConfig('KEYWORDS')
if (post?.tags && post?.tags?.length > 0) {
keywords = post?.tags?.join(',')
}

useEffect(() => {
// 使用WebFontLoader字体加载
loadExternalResource(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-next",
"version": "4.4.5",
"version": "4.4.6",
"homepage": "https://github.com/tangly1024/NotionNext.git",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit dbe1a4e

Please sign in to comment.