mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-22 15:09:43 +00:00
feat 压缩网站Notion头像
This commit is contained in:
@@ -7,7 +7,7 @@ import { getAllCategories } from './getAllCategories'
|
||||
import getAllPageIds from './getAllPageIds'
|
||||
import { getAllTags } from './getAllTags'
|
||||
import getPageProperties from './getPageProperties'
|
||||
import { mapImgUrl } from './mapImage'
|
||||
import { mapImgUrl, compressImage } from './mapImage'
|
||||
|
||||
/**
|
||||
* 获取博客数据
|
||||
@@ -155,7 +155,10 @@ function getBlogInfo({ collection, block }) {
|
||||
const title = collection?.name?.[0][0] || BLOG.TITLE
|
||||
const description = collection?.description ? Object.assign(collection).description[0][0] : BLOG.DESCRIPTION
|
||||
const pageCover = collection?.cover ? (mapImgUrl(collection?.cover, block[idToUuid(BLOG.NOTION_PAGE_ID)]?.value)) : BLOG.HOME_BANNER_IMAGE
|
||||
let icon = collection?.icon ? (mapImgUrl(collection?.icon, collection, 'collection')) : BLOG.AVATAR
|
||||
let icon = collection?.icon ? mapImgUrl(collection?.icon, collection, 'collection') : BLOG.AVATAR
|
||||
// 用户头像压缩一下
|
||||
icon = compressImage(icon)
|
||||
|
||||
// 站点图标不能是emoji情
|
||||
const emojiPattern = /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g
|
||||
if (emojiPattern.test(icon)) {
|
||||
|
||||
Reference in New Issue
Block a user