Merge remote-tracking branch 'origin/release/3.16.4' into release/4.0.0

This commit is contained in:
tangly1024
2023-07-07 21:36:47 +08:00
13 changed files with 52 additions and 15 deletions

View File

@@ -1,2 +1,2 @@
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
NEXT_PUBLIC_VERSION=3.16.3
NEXT_PUBLIC_VERSION=3.16.4

View File

@@ -3,7 +3,7 @@ const BLOG = {
// Important page_idDuplicate Template from https://www.notion.so/tanghh/02ab3b8678004aa69e9e415905ef32a5
NOTION_PAGE_ID:
process.env.NOTION_PAGE_ID || '02ab3b8678004aa69e9e415905ef32a5',
PSEUDO_STATIC: false, // 伪静态路径开启后所有文章URL都以 .html 结尾。
PSEUDO_STATIC: process.env.NEXT_PUBLIC_PSEUDO_STATIC || false, // 伪静态路径开启后所有文章URL都以 .html 结尾。
NEXT_REVALIDATE_SECOND: process.env.NEXT_PUBLIC_REVALIDATE_SECOND || 5, // 更新内容缓存间隔 单位(秒)即每个页面有5秒的纯静态期、此期间无论多少次访问都不会抓取notion数据调大该值有助于节省Vercel资源、同时提升访问速率但也会使文章更新有延迟。
THEME: process.env.NEXT_PUBLIC_THEME || 'hexo', // 主题, 支持 ['next','hexo',"fukasawa','medium','example','matery','gitbook','simple'] @see https://preview.tangly1024.com
THEME_SWITCH: process.env.NEXT_PUBLIC_THEME_SWITCH || false, // 是否显示切换主题按钮
@@ -29,6 +29,8 @@ const BLOG = {
CONTACT_TELEGRAM: process.env.NEXT_PUBLIC_CONTACT_TELEGRAM || '', // 你的telegram 地址 例如 https://t.me/tangly_1024
CONTACT_LINKEDIN: process.env.NEXT_PUBLIC_CONTACT_LINKEDIN || '', // 你的linkedIn 首页
CONTACT_INSTAGRAM: process.env.NEXT_PUBLIC_CONTACT_INSTAGRAM || '', // 您的instagram地址
CONTACT_BILIBILI: process.env.NEXT_PUBLIC_CONTACT_BILIBILI || '', // B站主页
CONTACT_YOUTUBE: process.env.NEXT_PUBLIC_CONTACT_YOUTUBE || '', // Youtube主页
NOTION_HOST: process.env.NEXT_PUBLIC_NOTION_HOST || 'https://www.notion.so', // Notion域名您可以选择用自己的域名进行反向代理如果不懂得什么是反向代理请勿修改此项
@@ -95,7 +97,7 @@ const BLOG = {
PRISM_JS_PATH: 'https://npm.elemecdn.com/prismjs@1.29.0/components/',
PRISM_THEME_PATH:
'https://npm.elemecdn.com/prism-themes/themes/prism-a11y-dark.min.css', // 代码样式主题 更多参考 https://github.com/PrismJS/prism-themes
CODE_MAC_BAR: true, // 代码左上角显示mac的红黄绿图标
CODE_MAC_BAR: process.env.NEXT_PUBLIC_CODE_MAC_BAR || true, // 代码左上角显示mac的红黄绿图标
CODE_LINE_NUMBERS: process.env.NEXT_PUBLIC_CODE_LINE_NUMBERS || 'false', // 是否显示行号
// Mermaid 图表CDN

View File

@@ -21,7 +21,7 @@ import { useRouter } from 'next/navigation'
const PrismMac = () => {
const router = useRouter()
useEffect(() => {
if (BLOG.CODE_MAC_BAR) {
if (JSON.parse(BLOG.CODE_MAC_BAR)) {
loadExternalResource('/css/prism-mac-style.css', 'css')
}
loadExternalResource(BLOG.PRISM_THEME_PATH, 'css')

View File

@@ -76,12 +76,6 @@ export default async function getPageProperties(id, block, schema, authToken, ta
// 映射值用户个性化type和status字段的下拉框选项在此映射回代码的英文标识
mapProperties(properties)
// 开启伪静态路径
if (BLOG.PSEUDO_STATIC) {
if (!properties?.slug?.endsWith('.html') && !properties?.slug?.startsWith('http')) {
properties.slug += '.html'
}
}
properties.publishDate = new Date(properties?.date?.start_date || value.created_time).getTime()
properties.publishTime = formatDate(properties.publishDate, BLOG.LANG)
properties.lastEditedTime = formatDate(new Date(value?.last_edited_time), BLOG.LANG)
@@ -107,6 +101,12 @@ export default async function getPageProperties(id, block, schema, authToken, ta
}
properties.password = properties.password ? md5(properties.slug + properties.password) : ''
// 开启伪静态路径
if (JSON.parse(BLOG.PSEUDO_STATIC)) {
if (!properties?.slug?.endsWith('.html') && !properties?.slug?.startsWith('http')) {
properties.slug += '.html'
}
}
return properties
}

View File

@@ -1,6 +1,6 @@
{
"name": "notion-next",
"version": "3.16.3",
"version": "3.16.4",
"homepage": "https://github.com/tangly1024/NotionNext.git",
"license": "MIT",
"repository": {

View File

@@ -97,7 +97,7 @@ export async function getStaticPaths() {
export async function getStaticProps({ params: { slug } }) {
let fullSlug = slug.join('/')
if (BLOG.PSEUDO_STATIC) {
if (JSON.parse(BLOG.PSEUDO_STATIC)) {
if (!fullSlug.endsWith('.html')) {
fullSlug += '.html'
}

View File

@@ -768,7 +768,7 @@ code[class*='language-'] {
overflow: auto;
font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier,
monospace;
@apply w-full mb-4 dark:bg-black;
@apply w-full mb-0 dark:bg-black !important;
}
.notion-column {
@@ -2016,7 +2016,7 @@ code.language-mermaid {
}
.code-toolbar{
@apply w-full shadow-md;
@apply w-full shadow-md pb-0;
}
.mermaid > svg {

View File

@@ -33,6 +33,12 @@ const SocialButton = () => {
{BLOG.ENABLE_RSS && <a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
<i className='fas fa-rss transform hover:scale-125 duration-150'/>
</a>}
{BLOG.CONTACT_BILIBILI && <a target='_blank' rel='noreferrer' title={'bilibili'} href={BLOG.CONTACT_BILIBILI} >
<i className='fab fa-bilibili transform hover:scale-125 duration-150'/>
</a>}
{BLOG.CONTACT_YOUTUBE && <a target='_blank' rel='noreferrer' title={'youtube'} href={BLOG.CONTACT_YOUTUBE} >
<i className='fab fa-youtube transform hover:scale-125 duration-150'/>
</a>}
</div>
</div>
}

View File

@@ -33,6 +33,12 @@ const SocialButton = () => {
{BLOG.ENABLE_RSS && <a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
<i className='transform hover:scale-125 duration-150 fas fa-rss dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{BLOG.CONTACT_BILIBILI && <a target='_blank' rel='noreferrer' title={'bilibili'} href={BLOG.CONTACT_BILIBILI} >
<i className='transform hover:scale-125 duration-150 fab fa-bilibili dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
{BLOG.CONTACT_YOUTUBE && <a target='_blank' rel='noreferrer' title={'youtube'} href={BLOG.CONTACT_YOUTUBE} >
<i className='transform hover:scale-125 duration-150 fab fa-youtube dark:hover:text-indigo-400 hover:text-indigo-600'/>
</a>}
</div>
</div>
}

View File

@@ -39,7 +39,12 @@ const SocialButton = () => {
{BLOG.ENABLE_RSS && <a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
<i className='transform hover:scale-125 duration-150 fas fa-rss ' />
</a>}
{BLOG.CONTACT_BILIBILI && <a target='_blank' rel='noreferrer' title={'bilibili'} href={BLOG.CONTACT_BILIBILI} >
<i className='fab fa-bilibili transform hover:scale-125 duration-150'/>
</a>}
{BLOG.CONTACT_YOUTUBE && <a target='_blank' rel='noreferrer' title={'youtube'} href={BLOG.CONTACT_YOUTUBE} >
<i className='fab fa-youtube transform hover:scale-125 duration-150'/>
</a>}
<i onClick={toggleShow} className='transform hover:scale-125 duration-150 fas fa-close ' />
</>}

View File

@@ -32,6 +32,12 @@ const SocialButton = () => {
{BLOG.ENABLE_RSS && <a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
<i className='fas fa-rss transform hover:scale-125 duration-150 hover:text-green-600'/>
</a>}
{BLOG.CONTACT_BILIBILI && <a target='_blank' rel='noreferrer' title={'bilibili'} href={BLOG.CONTACT_BILIBILI} >
<i className='fab fa-bilibili transform hover:scale-125 duration-150 hover:text-green-600'/>
</a>}
{BLOG.CONTACT_YOUTUBE && <a target='_blank' rel='noreferrer' title={'youtube'} href={BLOG.CONTACT_YOUTUBE} >
<i className='fab fa-youtube transform hover:scale-125 duration-150 hover:text-green-600'/>
</a>}
</div>
}
export default SocialButton

View File

@@ -33,6 +33,12 @@ const SocialButton = () => {
{BLOG.ENABLE_RSS && <a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
<i className='fas fa-rss transform hover:scale-125 duration-150'/>
</a>}
{BLOG.CONTACT_BILIBILI && <a target='_blank' rel='noreferrer' title={'bilibili'} href={BLOG.CONTACT_BILIBILI} >
<i className='fab fa-bilibili transform hover:scale-125 duration-150'/>
</a>}
{BLOG.CONTACT_YOUTUBE && <a target='_blank' rel='noreferrer' title={'youtube'} href={BLOG.CONTACT_YOUTUBE} >
<i className='fab fa-youtube transform hover:scale-125 duration-150'/>
</a>}
</div>
</div>
}

View File

@@ -33,6 +33,12 @@ const SocialButton = () => {
{BLOG.ENABLE_RSS && <a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
<i className='fas fa-rss transform hover:scale-125 duration-150'/>
</a>}
{BLOG.CONTACT_BILIBILI && <a target='_blank' rel='noreferrer' title={'bilibili'} href={BLOG.CONTACT_BILIBILI} >
<i className='fab fa-bilibili transform hover:scale-125 duration-150'/>
</a>}
{BLOG.CONTACT_YOUTUBE && <a target='_blank' rel='noreferrer' title={'youtube'} href={BLOG.CONTACT_YOUTUBE} >
<i className='fab fa-youtube transform hover:scale-125 duration-150'/>
</a>}
</div>
</div>
}