mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
some small fix about img font
This commit is contained in:
@@ -87,10 +87,13 @@ const mapImgUrl = (img, block, type = 'block', from) => {
|
||||
ret = BLOG.RANDOM_IMAGE_URL
|
||||
}
|
||||
}
|
||||
// 随机图片接口优化 防止因url一致而随机结果相同
|
||||
const separator = ret.includes('?') ? '&' : '?'
|
||||
// 拼接唯一识别参数,防止请求的图片被缓存
|
||||
ret = `${ret.trim()}${separator}t=${block.id}`
|
||||
|
||||
// 图片url优化,确保每一篇文章的图片url唯一
|
||||
if (ret && ret.length > 4) {
|
||||
// 图片接口拼接唯一识别参数,防止请求的图片被缓,而导致随机结果相同
|
||||
const separator = ret.includes('?') ? '&' : '?'
|
||||
ret = `${ret.trim()}${separator}t=${block.id}`
|
||||
}
|
||||
}
|
||||
|
||||
// 文章封面
|
||||
@@ -101,8 +104,13 @@ const mapImgUrl = (img, block, type = 'block', from) => {
|
||||
return ret
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是emoji图标
|
||||
* @param {*} str
|
||||
* @returns
|
||||
*/
|
||||
function isEmoji(str) {
|
||||
const emojiRegex = /[\u{1F300}-\u{1F6FF}\u{1F1E0}-\u{1F1FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{1F900}-\u{1F9FF}\u{1F018}-\u{1F270}]/u;
|
||||
const emojiRegex = /[\u{1F300}-\u{1F6FF}\u{1F1E0}-\u{1F1FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{1F900}-\u{1F9FF}\u{1F018}-\u{1F270}\u{238C}\u{2B06}\u{2B07}\u{2B05}\u{27A1}\u{2194}-\u{2199}\u{2194}\u{21A9}\u{21AA}\u{2934}\u{2935}\u{25AA}\u{25AB}\u{25FE}\u{25FD}\u{25FB}\u{25FC}\u{25B6}\u{25C0}\u{1F200}-\u{1F251}]/u;
|
||||
return emojiRegex.test(str);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,7 @@ const BlogCard = ({ index, post, showSummary, siteInfo }) => {
|
||||
</Link>}
|
||||
<div className="md:flex-nowrap flex-wrap md:justify-start inline-block">
|
||||
<div>
|
||||
|
||||
{post.tagItems.map((tag) => (
|
||||
{post.tagItems?.map((tag) => (
|
||||
<TagItemMini key={tag.name} tag={tag} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -48,12 +48,14 @@ const LayoutBase = (props) => {
|
||||
const leftAreaSlot = <Live2D />
|
||||
const { onLoading } = useGlobal()
|
||||
|
||||
const FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT = siteConfig('FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT', null, CONFIG)
|
||||
|
||||
// 侧边栏折叠从 本地存储中获取 open 状态的初始值
|
||||
const [isCollapsed, setIsCollapse] = useState(() => {
|
||||
if (typeof window !== 'undefined') {
|
||||
return localStorage.getItem('fukasawa-sidebar-collapse') === 'true' || siteConfig('FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT', null, CONFIG)
|
||||
return localStorage.getItem('fukasawa-sidebar-collapse') === 'true' || FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT
|
||||
}
|
||||
return siteConfig('FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT', null, CONFIG)
|
||||
return FUKASAWA_SIDEBAR_COLLAPSE_SATUS_DEFAULT
|
||||
})
|
||||
|
||||
// 在组件卸载时保存 open 状态到本地存储中
|
||||
|
||||
Reference in New Issue
Block a user