mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-24 23:16:52 +00:00
fix font-custom
This commit is contained in:
@@ -43,6 +43,12 @@ const CommonHead = ({ meta, children }) => {
|
|||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta name="twitter:description" content={description} />
|
<meta name="twitter:description" content={description} />
|
||||||
<meta name="twitter:title" content={title} />
|
<meta name="twitter:title" content={title} />
|
||||||
|
|
||||||
|
{ BLOG.CUSTOM_FONT
|
||||||
|
? BLOG.CUSTOM_FONT_URL?.map(fontUrl =>
|
||||||
|
<link href={`${fontUrl}`} key={fontUrl} rel="stylesheet"/>)
|
||||||
|
: <link href='https://fonts.font.im/css2?family=Noto+Serif+SC&display=optional' rel="stylesheet"/> }
|
||||||
|
|
||||||
{JSON.parse(BLOG.ANALYTICS_BUSUANZI_ENABLE) && <meta name="referrer" content="no-referrer-when-downgrade" />}
|
{JSON.parse(BLOG.ANALYTICS_BUSUANZI_ENABLE) && <meta name="referrer" content="no-referrer-when-downgrade" />}
|
||||||
{meta?.type === 'Post' && (
|
{meta?.type === 'Post' && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ const MyApp = ({ Component, pageProps }) => {
|
|||||||
{JSON.parse(BLOG.FIREWORKS) && <Fireworks/>}
|
{JSON.parse(BLOG.FIREWORKS) && <Fireworks/>}
|
||||||
</>
|
</>
|
||||||
|
|
||||||
// 延迟加载字体
|
// 延迟加载fontAwesome
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
loadFont()
|
loadExternalResource(BLOG.FONT_AWESOME_PATH, 'css')
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -62,13 +62,4 @@ const MyApp = ({ Component, pageProps }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 延迟加载字体
|
|
||||||
*/
|
|
||||||
const loadFont = () => {
|
|
||||||
loadExternalResource(BLOG.FONT_AWESOME_PATH, 'css')
|
|
||||||
for (const fontUrl of BLOG.CUSTOM_FONT_URL) {
|
|
||||||
loadExternalResource(fontUrl, 'css')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default MyApp
|
export default MyApp
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const BLOG = require('./blog.config')
|
const BLOG = require('./blog.config')
|
||||||
const fontFamilies = require('./lib/font')
|
const { fontFamilies } = require('./lib/font')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
purge: ['./pages/**/*.js', './components/**/*.js', './layouts/**/*.js', './themes/**/*.js'],
|
purge: ['./pages/**/*.js', './components/**/*.js', './layouts/**/*.js', './themes/**/*.js'],
|
||||||
|
|||||||
Reference in New Issue
Block a user