字体调整,配置文件调整

This commit is contained in:
tangly1024
2021-12-13 16:21:54 +08:00
parent 0f46dc518c
commit b2d2afc704
9 changed files with 32 additions and 17 deletions

View File

@@ -57,6 +57,20 @@
- Notion token 的有效期只有 180 天,请确保在 Vercel Dashboard 上手动更新,我们可能会在未来切换到官方 API 来解决这个问题。此外如果数据库是非公开到Notion 中的图片可能无法正常显示到网页上。 - Notion token 的有效期只有 180 天,请确保在 Vercel Dashboard 上手动更新,我们可能会在未来切换到官方 API 来解决这个问题。此外如果数据库是非公开到Notion 中的图片可能无法正常显示到网页上。
- **稍微等等就可以访问了!** 简单吗? - **稍微等等就可以访问了!** 简单吗?
## 快速开发
```bash
yarn # 安装依赖
yarn run dev # 本地开发
yarn run build # 本地打包编译
yarn run start # 本地启动NextJS服务
```
## 引用技术 ## 引用技术
- **生成**: Next.js SSG 和 Incremental Static Regeneration - **生成**: Next.js SSG 和 Incremental Static Regeneration

View File

@@ -9,19 +9,19 @@ const BLOG = {
notionAccessToken: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public notionAccessToken: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public
defaultImgCover: 'https://avatars.githubusercontent.com/u/15920488', // default image cover defaultImgCover: 'https://avatars.githubusercontent.com/u/15920488', // default image cover
appearance: 'auto', // ['light', 'dark', 'auto'], appearance: 'auto', // ['light', 'dark', 'auto'],
font: 'font-sans', // ['font-sans', 'font-serif', 'font-mono'] font: 'font-serif tracking-wider subpixel-antialiased', // 文章字体 ['font-sans', 'font-serif', 'font-mono'] @see https://www.tailwindcss.cn/docs/font-family
lightBackground: '#ffffff', // use hex value, don't forget '#' e.g #fffefc lightBackground: '#ffffff', // use hex value, don't forget '#' e.g #fffefc
darkBackground: '#111827', // use hex value, don't forget '#' darkBackground: '#111827', // use hex value, don't forget '#'
path: '', // leave this empty unless you want to deploy in a folder path: '', // leave this empty unless you want to deploy in a folder
since: 2020, // if leave this empty, current year will be used. since: 2020, // if leave this empty, current year will be used.
postsPerPage: 6, // post counts per page postsPerPage: 6, // post counts per page
sortByDate: false, sortByDate: false,
showAbout: true, // WIP showAbout: true, // WIP 是否显示关于
showArchive: true, // WIP showArchive: true, // WIP 是否显示归档
autoCollapsedNavBar: false, // the automatically collapsed navigation bar autoCollapsedNavBar: false, // the automatically collapsed navigation bar
socialLink: 'https://weibo.com/u/2245301913', socialLink: 'https://weibo.com/u/2245301913',
seo: { seo: {
keywords: ['建站', 'Notion', '赚钱', '写作', '副业'], keywords: ['Notion', '写作', '博客'],
googleSiteVerification: '' // Remove the value or replace it with your own google site verification code googleSiteVerification: '' // Remove the value or replace it with your own google site verification code
}, },
analytics: { analytics: {
@@ -58,10 +58,11 @@ const BLOG = {
repo: 'tangly1024/NotionNext' repo: 'tangly1024/NotionNext'
} }
}, },
isProd: process.env.VERCEL_ENV === 'production', // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables)
googleAdsenseId: 'ca-pub-2708419466378217', // 谷歌广告ID googleAdsenseId: 'ca-pub-2708419466378217', // 谷歌广告ID
DaoVoiceId: '', // 在线聊天 DaoVoice http://dashboard.daovoice.io/get-started DaoVoiceId: '', // 在线聊天 DaoVoice http://dashboard.daovoice.io/get-started
TidioId: '' // 在线聊天 https://www.tidio.com/ TidioId: '', // 在线聊天 https://www.tidio.com/
isProd: process.env.VERCEL_ENV === 'production' // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables)
} }
// export default BLOG // export default BLOG
module.exports = BLOG module.exports = BLOG

View File

@@ -12,7 +12,7 @@ const CategoryGroup = ({ currentCategory, categories }) => {
<div className={(selected <div className={(selected
? 'bg-gray-200 dark:bg-black text-black dark:text-white' ? 'bg-gray-200 dark:bg-black text-black dark:text-white'
: 'dark:text-gray-400 text-gray-500') + : 'dark:text-gray-400 text-gray-500') +
' duration-300 hover:text-blue-500 dark:hover:text-blue-400 hover:underline px-5 cursor-pointer pt-2 font-serif'}> ' duration-300 hover:text-blue-500 dark:hover:text-blue-400 hover:underline px-5 cursor-pointer pt-2 font-light'}>
<FontAwesomeIcon icon={selected ? faFolderOpen : faFolder} className={`${selected ? 'text-black dark:text-white' : 'text-gray-400'} mr-2 w-5`} />{category}({categories[category]})</div> <FontAwesomeIcon icon={selected ? faFolderOpen : faFolder} className={`${selected ? 'text-black dark:text-white' : 'text-gray-400'} mr-2 w-5`} />{category}({categories[category]})</div>
</Link> </Link>
})} })}

View File

@@ -31,7 +31,7 @@ const LatestPostsGroup = ({ posts, sliceCount = 5 }) => {
const selected = currentPath === `${BLOG.path}/article/${post.slug}` const selected = currentPath === `${BLOG.path}/article/${post.slug}`
return ( return (
<Link key={post.id} title={post.title} href={`${BLOG.path}/article/${post.slug}`} passHref> <Link key={post.id} title={post.title} href={`${BLOG.path}/article/${post.slug}`} passHref>
<div className={(selected ? 'bg-gray-200 dark:bg-black ' : '') + ' my-1 px-5 flex justify-between'}> <div className={(selected ? 'bg-gray-200 dark:bg-black ' : '') + ' my-1 px-5 flex font-light justify-between'}>
<div className={ 'text-xs py-1 flex w-40 overflow-x-hidden whitespace-nowrap overflow-hidden ' + <div className={ 'text-xs py-1 flex w-40 overflow-x-hidden whitespace-nowrap overflow-hidden ' +
'hover:text-blue-500 dark:hover:text-blue-400 cursor-pointer hover:underline' + 'hover:text-blue-500 dark:hover:text-blue-400 cursor-pointer hover:underline' +
(selected ? 'dark:text-white text-black ' : 'text-gray-500 dark:text-gray-300') (selected ? 'dark:text-white text-black ' : 'text-gray-500 dark:text-gray-300')

View File

@@ -4,14 +4,15 @@ import { useRouter } from 'next/router'
import { useGlobal } from '@/lib/global' import { useGlobal } from '@/lib/global'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faArchive, faHome, faInfoCircle } from '@fortawesome/free-solid-svg-icons' import { faArchive, faHome, faInfoCircle } from '@fortawesome/free-solid-svg-icons'
import BLOG from 'blog.config'
const MenuButtonGroup = ({ allowCollapse = false }) => { const MenuButtonGroup = ({ allowCollapse = false }) => {
const { locale } = useGlobal() const { locale } = useGlobal()
const router = useRouter() const router = useRouter()
const links = [ const links = [
{ id: 0, icon: faHome, name: locale.NAV.INDEX, to: '/' || '/', show: true }, { id: 0, icon: faHome, name: locale.NAV.INDEX, to: '/' || '/', show: true },
{ id: 1, icon: faArchive, name: locale.NAV.ARCHIVE, to: '/archive', show: true }, { id: 1, icon: faArchive, name: locale.NAV.ARCHIVE, to: '/archive', show: BLOG.showArchive },
{ id: 2, icon: faInfoCircle, name: locale.NAV.ABOUT, to: '/article/about', show: true } { id: 2, icon: faInfoCircle, name: locale.NAV.ABOUT, to: '/article/about', show: BLOG.showAbout }
// { id: 7, icon: 'faGithub', name: 'Github', to: 'https://github.com/tangly1024', show: true }, // { id: 7, icon: 'faGithub', name: 'Github', to: 'https://github.com/tangly1024', show: true },
// { id: 5, icon: 'faWeibo', name: '微博', to: 'https://weibo.com/tangly1024', show: true }, // { id: 5, icon: 'faWeibo', name: '微博', to: 'https://weibo.com/tangly1024', show: true },
// { id: 4, icon: 'faEnvelope', name: locale.NAV.MAIL, to: 'mailto:tlyong1992@hotmail.com', show: true } // { id: 4, icon: 'faEnvelope', name: locale.NAV.MAIL, to: 'mailto:tlyong1992@hotmail.com', show: true }
@@ -27,7 +28,7 @@ const MenuButtonGroup = ({ allowCollapse = false }) => {
if (link.show) { if (link.show) {
const selected = (router.pathname === link.to) || (router.asPath === link.to) const selected = (router.pathname === link.to) || (router.asPath === link.to)
return <Link key={link.id + link.icon} title={link.to} href={link.to} > return <Link key={link.id + link.icon} title={link.to} href={link.to} >
<a className={'py-2 px-5 text-lg hover:bg-blue-400 hover:text-white cursor-pointer duration-100 flex flex-nowrap align-middle ' + <a className={'py-2 px-5 text-lg hover:bg-blue-400 hover:text-white cursor-pointer duration-100 font-light flex flex-nowrap align-middle ' +
(selected ? 'bg-blue-500 text-white ' : ' ')} > (selected ? 'bg-blue-500 text-white ' : ' ')} >
<div className='my-auto w-5 justify-center flex'> <div className='my-auto w-5 justify-center flex'>
<FontAwesomeIcon icon={link.icon} /> <FontAwesomeIcon icon={link.icon} />

View File

@@ -42,7 +42,7 @@ const SearchInput = ({ currentTag, currentSearch }) => {
ref={searchInputRef} ref={searchInputRef}
type='text' type='text'
placeholder={currentTag ? `${locale.SEARCH.TAGS} #${currentTag}` : `${locale.SEARCH.ARTICLES}`} placeholder={currentTag ? `${locale.SEARCH.TAGS} #${currentTag}` : `${locale.SEARCH.ARTICLES}`}
className={'w-full pl-2 transition leading-10 border-gray-300 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'} className={'w-full pl-2 transition font-light leading-10 border-gray-300 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
onKeyUp={handleKeyUp} onKeyUp={handleKeyUp}
onChange={e => updateSearchKey(e.target.value)} onChange={e => updateSearchKey(e.target.value)}
defaultValue={currentSearch} defaultValue={currentSearch}

View File

@@ -83,7 +83,7 @@ const SideBar = ({ tags, currentTag, post, posts, categories, currentCategory, c
{post && ( {post && (
<section id='left-toc' className='sticky pb-20 top-0 bg-white dark:bg-gray-900'> <section id='left-toc' className='sticky pb-20 top-0 bg-white dark:bg-gray-900'>
<div className='border-b text-2xl bg-white font-bold text-black dark:border-gray-700 dark:bg-gray-700 dark:text-white py-6 px-6'> <div className='border-b text-2xl bg-white text-black dark:border-gray-700 dark:bg-gray-700 dark:text-white py-6 px-6'>
{locale.COMMON.TABLE_OF_CONTENTS} {locale.COMMON.TABLE_OF_CONTENTS}
</div> </div>
<Toc toc={post.toc} /> <Toc toc={post.toc} />

View File

@@ -66,7 +66,7 @@ const BaseLayout = ({
const targetRef = useRef(null) const targetRef = useRef(null)
return ( return (
<div id='wrapper' className={[BLOG.font, 'subpixel-antialiased', theme].join(' ')}> <div id='wrapper' className={theme}>
<CommonHead meta={meta} /> <CommonHead meta={meta} />
{/* 顶部导航栏 */} {/* 顶部导航栏 */}
@@ -78,7 +78,6 @@ const BaseLayout = ({
<SideBar post={post} posts={totalPosts} tags={tags} currentSearch={currentSearch} currentTag={currentTag} categories={categories} currentCategory={currentCategory} /> <SideBar post={post} posts={totalPosts} tags={tags} currentSearch={currentSearch} currentTag={currentTag} categories={categories} currentCategory={currentCategory} />
</div> </div>
<div className='flex flex-grow min-h-screen' ref={targetRef}> <div className='flex flex-grow min-h-screen' ref={targetRef}>
{onLoading {onLoading
? <LoadingCover/> ? <LoadingCover/>
: <div className='flex-grow bg-gray-50 dark:bg-black shadow-inner animate__animated animate__fadeIn'> : <div className='flex-grow bg-gray-50 dark:bg-black shadow-inner animate__animated animate__fadeIn'>

View File

@@ -85,13 +85,13 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories
</div> </div>
</section> </section>
<section className='px-1 py-2 my-1 text-sm font-light italic bg-gray-50 text-gray-600 dark:bg-gray-700 dark:text-gray-400'> <section className='px-1 py-2 my-1 text-sm font-light italic bg-gray-50 text-gray-600 dark:bg-gray-700 dark:text-gray-400'>
{post.summary} {post.summary}
</section> </section>
{/* Notion文章主体 */} {/* Notion文章主体 */}
{blockMap && ( {blockMap && (
<NotionRenderer recordMap={blockMap} mapPageUrl={mapPageUrl} <NotionRenderer className={`${BLOG.font}`} recordMap={blockMap} mapPageUrl={mapPageUrl}
components={{ components={{
equation: Equation, equation: Equation,
code: Code, code: Code,