Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

medium 主题文章详情页 #1327

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions themes/medium/components/ArticleInfo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import BLOG from '@/blog.config'
import LazyImage from '@/components/LazyImage'
import formatDate from '@/lib/formatDate'
import Link from 'next/link'

/**
Expand All @@ -11,18 +10,16 @@ import Link from 'next/link'
export default function ArticleInfo(props) {
const { post, siteInfo } = props

const date = formatDate(post?.publishTime || post?.createdTime)

return (<>
{/* title */}
<h1 className="text-3xl pt-12 dark:text-gray-300">{post?.title}</h1>

{/* meta */}
<section className="py-2 items-center text-sm px-1">
<div className='flex flex-wrap text-gray-500 py-1 dark:text-gray-600'>
<span className='whitespace-nowrap'> <i className='far fa-calendar mr-2' />{date}</span>
<span className='whitespace-nowrap'> <i className='far fa-calendar mr-2' />{post?.publishTime}</span>
<span className='mx-1'>|</span>
<span className='whitespace-nowrap mr-2'><i className='far fa-calendar-check mr-2' />{post.lastEditedTime}</span>
<span className='whitespace-nowrap mr-2'><i className='far fa-calendar-check mr-2' />{post?.lastEditedTime}</span>
<div className="hidden busuanzi_container_page_pv font-light mr-2 whitespace-nowrap">
<i className="mr-1 fas fa-eye" /><span className="busuanzi_value_page_pv" />
</div>
Expand Down
4 changes: 4 additions & 0 deletions themes/medium/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import Link from 'next/link'
import { Transition } from '@headlessui/react'
import { Style } from './style'
import replaceSearchResult from '@/components/Mark'
import ArticleInfo from './components/ArticleInfo'

// 主题全局状态
const ThemeGlobalMedium = createContext()
Expand Down Expand Up @@ -161,6 +162,9 @@ const LayoutSlug = props => {

{!lock && <div id='article-wrapper'>

{/* 文章信息 */}
<ArticleInfo {...props}/>

{/* Notion文章主体 */}
<section className="px-1 max-w-4xl">
{post && (<NotionPage post={post} />)}
Expand Down