From 23880a63e5bc812efdb32c27302dc026e22aedd9 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 27 Apr 2022 13:16:54 +0800 Subject: [PATCH] =?UTF-8?q?example=20=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 2 +- themes/example/components/ArticleInfo.js | 62 ++++++++++++------------ themes/example/components/Nav.js | 7 ++- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/blog.config.js b/blog.config.js index 6693a752..ed42761d 100644 --- a/blog.config.js +++ b/blog.config.js @@ -18,7 +18,7 @@ const BLOG = { FACEBOOK_PAGE_ID: process.env.NEXT_PUBLIC_FACEBOOK_PAGE_ID || '', // Facebook Page ID 來啟用 messenger 聊天功能 FACEBOOK_APP_ID: process.env.NEXT_PUBLIC_FACEBOOK_APP_ID || '', // Facebook App ID 來啟用 messenger 聊天功能 获取: https://developers.facebook.com/ - THEME: process.env.NEXT_PUBLIC_THEME || 'next', // 主题, 支持 ['next','hexo',"fukasawa','medium'] + THEME: process.env.NEXT_PUBLIC_THEME || 'next', // 主题, 支持 ['next','hexo',"fukasawa','medium','example'] @see https://preview.tangly1024.com THEME_SWITCH: process.env.NEXT_PUBLIC_THEME_SWITCH || false, // 是否显示切换主题按钮 LANG: 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more. HOME_BANNER_IMAGE: './bg_image.jpg', // 首页背景大图,默认文件:/public/bg_image.jpg 。会被Notion中的封面图覆盖。 diff --git a/themes/example/components/ArticleInfo.js b/themes/example/components/ArticleInfo.js index a0a5c365..7e92e254 100644 --- a/themes/example/components/ArticleInfo.js +++ b/themes/example/components/ArticleInfo.js @@ -9,38 +9,40 @@ export const ArticleInfo = (props) => { const date = formatDate(post?.date?.start_date || post?.createdTime, locale.LOCALE) return
-
- - - - {post.category} - - - | +
+ {post?.type[0] !== 'Page' && <> + + + + {post.category} + + + | + } - {post?.type[0] !== 'Page' && (<> - - - {date} - - - | - - {locale.COMMON.LAST_EDITED_TIME}: {post.lastEditedTime} - - | + {post?.type[0] !== 'Page' && (<> + + + {date} + + + | + + {locale.COMMON.LAST_EDITED_TIME}: {post.lastEditedTime} + + | - )} + )} - - -   - - -
+ + +   + + +
-
+ } diff --git a/themes/example/components/Nav.js b/themes/example/components/Nav.js index 10449dbb..4c3217c0 100644 --- a/themes/example/components/Nav.js +++ b/themes/example/components/Nav.js @@ -1,4 +1,5 @@ import { useGlobal } from '@/lib/global' +import Link from 'next/link' /** * 菜单导航 @@ -23,7 +24,11 @@ export const Nav = (props) => {
{links.map(link => { - return link && {link.name} + return link && + + {link.name} + + })}