Skip to content

Commit

Permalink
external css 修复
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Jun 17, 2024
1 parent 8efde42 commit be048bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions components/ExternalPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import LA51 from './LA51'
import TianLiGPT from './TianliGPT'
import WebWhiz from './Webwhiz'

import { CUSTOM_EXTERNAL_CSS, CUSTOM_EXTERNAL_JS } from '@/blog.config'
import { convertInnerUrl } from '@/lib/notion/convertInnerUrl'
import { isBrowser, loadExternalResource } from '@/lib/utils'
import { useRouter } from 'next/router'
Expand Down Expand Up @@ -44,8 +43,6 @@ const ExternalPlugin = props => {
const CHATBASE_ID = siteConfig('CHATBASE_ID')
const COMMENT_DAO_VOICE_ID = siteConfig('COMMENT_DAO_VOICE_ID')
const AD_WWADS_ID = siteConfig('AD_WWADS_ID')
// const COMMENT_TWIKOO_ENV_ID = siteConfig('COMMENT_TWIKOO_ENV_ID')
// const COMMENT_TWIKOO_CDN_URL = siteConfig('COMMENT_TWIKOO_CDN_URL')
const COMMENT_ARTALK_SERVER = siteConfig('COMMENT_ARTALK_SERVER')
const COMMENT_ARTALK_JS = siteConfig('COMMENT_ARTALK_JS')
const COMMENT_TIDIO_ID = siteConfig('COMMENT_TIDIO_ID')
Expand All @@ -64,6 +61,8 @@ const ExternalPlugin = props => {
const IMG_SHADOW = siteConfig('IMG_SHADOW')
const ANIMATE_CSS_URL = siteConfig('ANIMATE_CSS_URL')
const MOUSE_FOLLOW = siteConfig('MOUSE_FOLLOW')
const CUSTOM_EXTERNAL_CSS = siteConfig('CUSTOM_EXTERNAL_CSS')
const CUSTOM_EXTERNAL_JS = siteConfig('CUSTOM_EXTERNAL_JS')

// 自定义样式css和js引入
if (isBrowser) {
Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const convertVal = val => {
}

// 配置值前可能有污染的空格
if (!val.indexOf('[') > 0 || val.indexOf('{')) {
if (val.indexOf('[') < 0 && val.indexOf('{') < 0) {
return val
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function isUrl(str) {
// 检查是否外链
export function checkStartWithHttp(str) {
// 检查字符串是否包含http
if (str?.includes('http:') || str?.includes('https:')) {
if (str?.indexOf('http:') === 0 || str?.indexOf('https:') === 0) {
// 如果包含,找到http的位置
return str?.indexOf('http') > -1
} else {
Expand Down

0 comments on commit be048bb

Please sign in to comment.