mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
hexo:封装统计卡
This commit is contained in:
@@ -45,9 +45,9 @@ const LayoutBase = (props) => {
|
||||
|
||||
{headerSlot}
|
||||
|
||||
<main id='wrapper' className='flex w-full justify-center py-8 min-h-screen'>
|
||||
<main id='wrapper' className='w-full justify-center py-8 min-h-screen'>
|
||||
|
||||
<div id='container-inner' className='pt-14 w-full mx-auto flex justify-between space-x-4 max-w-7xl'>
|
||||
<div id='container-inner' className='pt-14 w-full mx-auto lg:flex justify-between space-x-4 max-w-7xl'>
|
||||
<div className='flex-grow w-full'>{children}</div>
|
||||
<SideRight {...props}/>
|
||||
</div>
|
||||
|
||||
30
themes/hexo/components/AnalyticsCard.js
Normal file
30
themes/hexo/components/AnalyticsCard.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import Card from './Card'
|
||||
|
||||
export function AnalyticsCard (props) {
|
||||
const { postCount } = props
|
||||
return <Card>
|
||||
<div className='ml-2 mb-3 font-sans'>
|
||||
<i className='fas fa-chart-area' /> 统计
|
||||
</div>
|
||||
<div className='text-xs font-sans font-light justify-center mx-7'>
|
||||
<div className='inline'>
|
||||
<div className='flex justify-between'>
|
||||
<div>文章数:</div>
|
||||
<div>{postCount}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className='hidden busuanzi_container_page_pv ml-2'>
|
||||
<div className='flex justify-between'>
|
||||
<div>访问量:</div>
|
||||
<div className='busuanzi_value_page_pv' />
|
||||
</div>
|
||||
</div>
|
||||
<div className='hidden busuanzi_container_site_uv ml-2'>
|
||||
<div className='flex justify-between'>
|
||||
<div>访客数:</div>
|
||||
<div className='busuanzi_value_site_uv' />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
}
|
||||
@@ -4,11 +4,11 @@ import LatestPostsGroup from './LatestPostsGroup'
|
||||
import TagGroups from './TagGroups'
|
||||
import Catalog from './Catalog'
|
||||
import { InfoCard } from './InfoCard'
|
||||
import { AnalyticsCard } from './AnalyticsCard'
|
||||
|
||||
export default function SideRight (props) {
|
||||
const {
|
||||
post,
|
||||
postCount,
|
||||
currentCategory,
|
||||
categories,
|
||||
latestPosts,
|
||||
@@ -19,33 +19,9 @@ export default function SideRight (props) {
|
||||
} = props
|
||||
|
||||
return (
|
||||
<div className={'w-80 space-y-4 hidden lg:block'}>
|
||||
<div className={'w-80 space-y-4'}>
|
||||
<InfoCard {...props}/>
|
||||
<Card>
|
||||
<div className='ml-2 mb-3 font-sans'>
|
||||
<i className='fas fa-chart-area' /> 统计
|
||||
</div>
|
||||
<div className='text-xs font-sans font-light justify-center mx-7'>
|
||||
<div className='inline'>
|
||||
<div className='flex justify-between'>
|
||||
<div>文章数:</div>
|
||||
<div>{postCount}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className='hidden busuanzi_container_page_pv ml-2'>
|
||||
<div className='flex justify-between'>
|
||||
<div>访问量:</div>
|
||||
<div className='busuanzi_value_page_pv' />
|
||||
</div>
|
||||
</div>
|
||||
<div className='hidden busuanzi_container_site_uv ml-2'>
|
||||
<div className='flex justify-between'>
|
||||
<div>访客数:</div>
|
||||
<div className='busuanzi_value_site_uv' />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
<AnalyticsCard {...props}/>
|
||||
|
||||
{showCategory && (
|
||||
<Card>
|
||||
@@ -68,7 +44,7 @@ export default function SideRight (props) {
|
||||
</Card>}
|
||||
|
||||
{post && post.toc && (
|
||||
<Card className='sticky top-12'>
|
||||
<Card className='sticky top-20'>
|
||||
<Catalog toc={post.toc} />
|
||||
</Card>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user