整理lib目录

This commit is contained in:
tangly1024
2024-03-10 13:08:18 +08:00
parent 51743512fa
commit 444e236ca6
55 changed files with 60 additions and 64 deletions

View File

@@ -2,16 +2,19 @@ import BLOG from '@/blog.config'
import { getDataFromCache, setDataToCache } from '@/lib/cache/cache_manager'
import { getPostBlocks, getSingleBlock } from '@/lib/notion/getPostBlocks'
import { idToUuid } from 'notion-utils'
import { deepClone } from '../utils'
import { getAllCategories } from './getAllCategories'
import getAllPageIds from './getAllPageIds'
import { getAllTags } from './getAllTags'
import getPageProperties from './getPageProperties'
import { compressImage, mapImgUrl } from './mapImage'
import { getConfigMapFromConfigPage } from './getNotionConfig'
import { deepClone } from '@/lib/utils'
import { getAllCategories } from '@/lib/notion/getAllCategories'
import getAllPageIds from '@/lib/notion/getAllPageIds'
import { getAllTags } from '@/lib/notion/getAllTags'
import getPageProperties from '@/lib/notion/getPageProperties'
import { compressImage, mapImgUrl } from '@/lib/notion/mapImage'
import { getConfigMapFromConfigPage } from '@/lib/notion/getNotionConfig'
export { getAllTags } from '../notion/getAllTags'
export { getPostBlocks } from '../notion/getPostBlocks'
/**
* 获取博客数据
* 获取博客数据; 基于Notion实现
* @param {*} pageId
* @param {*} from
* @param latestPostCount 截取最新文章数量

View File

@@ -5,7 +5,7 @@ import zhTW from './lang/zh-TW'
import frFR from './lang/fr-FR'
import trTR from './lang/tr-TR'
import jaJP from './lang/ja-JP'
import { getQueryVariable, isBrowser, mergeDeep } from './utils'
import { getQueryVariable, isBrowser, mergeDeep } from '@/lib/utils'
/**
* 在这里配置所有支持的语言

View File

View File

@@ -1,2 +0,0 @@
export { getAllTags } from './notion/getAllTags'
export { getPostBlocks } from './notion/getPostBlocks'

View File

@@ -1,7 +1,7 @@
import BLOG from '@/blog.config'
import getAllPageIds from './getAllPageIds'
import getPageProperties from './getPageProperties'
import { getNotionPageData } from '@/lib/notion/getNotionData'
import { getNotionPageData } from '@/lib/db/getSiteData'
import { delCacheData } from '@/lib/cache/cache_manager'
/**

View File

@@ -1,6 +1,6 @@
import BLOG from '@/blog.config'
import { idToUuid } from 'notion-utils'
import formatDate from '../formatDate'
import formatDate from '../utils/formatDate'
import { getPostBlocks } from './getPostBlocks'
import { defaultMapImageUrl } from 'react-notion-x'

View File

@@ -1,7 +1,7 @@
import { getTextContent, getDateValue } from 'notion-utils'
import { NotionAPI } from 'notion-client'
import BLOG from '@/blog.config'
import formatDate from '../formatDate'
import formatDate from '../utils/formatDate'
// import { createHash } from 'crypto'
import md5 from 'js-md5'
import { mapImgUrl } from './mapImage'

View File

@@ -1,4 +1,4 @@
const { loadExternalResource } = require('./utils');
const { loadExternalResource } = require('../utils');
/**
* WOWjs动画结合animate.css使用很方便

View File

@@ -2,7 +2,7 @@ import fs from 'fs'
import { Feed } from 'feed'
import BLOG from '@/blog.config'
import ReactDOMServer from 'react-dom/server'
import { getPostBlocks } from './notion'
import { getPostBlocks } from '@/lib/db/getSiteData'
import NotionPage from '@/components/NotionPage'
/**