Skip to content

Commit

Permalink
Merge pull request #1327 from tangly1024/fix/medium-article-info
Browse files Browse the repository at this point in the history
medium 主题文章详情页
  • Loading branch information
tangly1024 committed Jul 24, 2023
2 parents b874821 + 5b9edd3 commit bf0222b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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

0 comments on commit bf0222b

Please sign in to comment.