forked from izuolan/notionic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update blog configuration and remove preview images
- Loading branch information
Showing
4 changed files
with
13 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const BLOG = { | ||
title: 'robin blog', | ||
title: 'robin 的博客', | ||
author: 'robin', | ||
email: '[email protected]', | ||
link: 'https://blog.robin.me', | ||
newsletter: 'Weekly', | ||
description: 'robin blog', | ||
description: '记录生活,记录成长', | ||
lang: 'zh-CN', // ['en-US', 'zh-CN', 'zh-HK', 'zh-TW', 'ja-JP', 'es-ES'] | ||
timezone: 'Asia/Shanghai', // See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for all options. | ||
appearance: 'auto', // ['light', 'dark', 'auto'], | ||
|
@@ -24,7 +24,7 @@ const BLOG = { | |
friends: true | ||
}, | ||
showWeChatPay: false, | ||
previewImagesEnabled: true, | ||
previewImagesEnabled: false, | ||
autoCollapsedNavBar: false, // The automatically collapsed navigation bar | ||
ogImageGenerateHost: 'og-zl.vercel.app', // The link to generate OG image, don't end with a slash | ||
defaultCover: '/cover.jpg', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import BLOG from '@/blog.config' | ||
import { NotionAPI } from 'notion-client' | ||
import { getPreviewImageMap } from './previewImages' | ||
// import { getPreviewImageMap } from './previewImages' | ||
|
||
export async function getPostBlocks(id) { | ||
const authToken = BLOG.notionAccessToken || null | ||
const api = new NotionAPI({ authToken }) | ||
const pageBlock = await api.getPage(id) | ||
if (BLOG.previewImagesEnabled) { | ||
const previewImageMap = await getPreviewImageMap(pageBlock) | ||
pageBlock.preview_images = previewImageMap | ||
} | ||
|
||
// TODO: 暂时不需要预览图 | ||
// if (BLOG.previewImagesEnabled) { | ||
// const previewImageMap = await getPreviewImageMap(pageBlock) | ||
// pageBlock.preview_images = previewImageMap | ||
// } | ||
return pageBlock | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters