mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 15:10:29 +00:00
heo 添加最后更新日期,修复归档日期bug
This commit is contained in:
@@ -2,6 +2,7 @@ import Link from 'next/link'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import CONFIG from '../config'
|
||||
import BLOG from '@/blog.config'
|
||||
import { formatDateFmt } from '@/lib/formatDate'
|
||||
|
||||
export const ArticleInfo = (props) => {
|
||||
const { post } = props
|
||||
@@ -28,7 +29,7 @@ export const ArticleInfo = (props) => {
|
||||
{post?.type !== 'Page' && (<>
|
||||
<span>{locale.COMMON.POST_TIME}:
|
||||
<Link
|
||||
href={`/archive#${post?.publishTime?.substr(0, 7)}`}
|
||||
href={`/archive#${formatDateFmt(post?.publishDate, 'yyyy-MM')}`}
|
||||
passHref
|
||||
className="pl-1 mr-2 cursor-pointer hover:text-gray-700 dark:hover:text-gray-200 border-b dark:border-gray-500 border-dashed">
|
||||
{post?.publishTime}
|
||||
|
||||
@@ -2,6 +2,7 @@ import BLOG from '@/blog.config'
|
||||
import Link from 'next/link'
|
||||
import CONFIG from '../config'
|
||||
import TwikooCommentCount from '@/components/TwikooCommentCount'
|
||||
import { formatDateFmt } from '@/lib/formatDate'
|
||||
|
||||
export const BlogItem = props => {
|
||||
const { post } = props
|
||||
@@ -23,7 +24,7 @@ export const BlogItem = props => {
|
||||
<div className='space-x-2'>
|
||||
<span> <a href={CONFIG.AUTHOR_LINK} className='p-1 hover:text-red-400 transition-all duration-200'><i className="fa-regular fa-user"></i> {BLOG.AUTHOR}</a></span>
|
||||
<span>
|
||||
<Link className='p-1 hover:text-red-400 transition-all duration-200' href={`/archive#${post?.publishTime?.substr(0, 7)}`}>
|
||||
<Link className='p-1 hover:text-red-400 transition-all duration-200' href={`/archive#${formatDateFmt(post?.publishDate, 'yyyy-MM')}`}>
|
||||
<i className="fa-regular fa-clock" /> {post.date?.start_date || post.createdTime}
|
||||
</Link>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user