From 952051a80f56ee906fde7dd7d293e88f66720859 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 28 Jan 2022 09:32:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E6=8E=92=E7=8F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/Medium/LayoutBase.js | 4 ++-- themes/Medium/LayoutSlug.js | 24 ++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/themes/Medium/LayoutBase.js b/themes/Medium/LayoutBase.js index 866d7e64..3c62dc54 100644 --- a/themes/Medium/LayoutBase.js +++ b/themes/Medium/LayoutBase.js @@ -11,7 +11,7 @@ import LogoBar from './components/LogoBar' * @constructor */ const LayoutBase = props => { - const { children, meta } = props + const { children, meta, showInfoCard = true } = props return (
@@ -19,7 +19,7 @@ const LayoutBase = props => {
- + {showInfoCard && }
{children} diff --git a/themes/Medium/LayoutSlug.js b/themes/Medium/LayoutSlug.js index cb621b12..cd2a349d 100644 --- a/themes/Medium/LayoutSlug.js +++ b/themes/Medium/LayoutSlug.js @@ -9,6 +9,10 @@ import 'prismjs/components/prism-typescript' import { Code, Collection, CollectionRow, Equation, NotionRenderer } from 'react-notion-x' import LayoutBase from './LayoutBase' import Comment from '@/components/Comment' +import Image from 'next/image' +import { useGlobal } from '@/lib/global' +import formatDate from '@/lib/formatDate' +import Link from 'next/link' const mapPageUrl = id => { return 'https://www.notion.so/' + id.replace(/-/g, '') @@ -27,9 +31,25 @@ export const LayoutSlug = (props) => { post.content = Object.keys(post.blockMap.block) post.toc = getPageTableOfContents(post, post.blockMap) } + const { locale } = useGlobal() + const date = formatDate(post?.date?.start_date || post.createdTime, locale.LOCALE) - return -

{post?.title}

+ return +

{post?.title}

+ +
+ {BLOG.AUTHOR} +
{BLOG.AUTHOR}
+
{date}
+
+ {/* Notion文章主体 */}
{post.blockMap && (