mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 23:16:52 +00:00
hexo index jumpto comment
This commit is contained in:
@@ -1,39 +1,42 @@
|
|||||||
import CONFIG from './config'
|
import Comment from '@/components/Comment'
|
||||||
import { createContext, useContext, useEffect, useRef } from 'react'
|
import replaceSearchResult from '@/components/Mark'
|
||||||
import Footer from './components/Footer'
|
import NotionPage from '@/components/NotionPage'
|
||||||
import SideRight from './components/SideRight'
|
import ShareBar from '@/components/ShareBar'
|
||||||
import TopNav from './components/TopNav'
|
import { siteConfig } from '@/lib/config'
|
||||||
import { useGlobal } from '@/lib/global'
|
import { useGlobal } from '@/lib/global'
|
||||||
import { isBrowser } from '@/lib/utils'
|
import { isBrowser } from '@/lib/utils'
|
||||||
import BlogPostListPage from './components/BlogPostListPage'
|
import { Transition } from '@headlessui/react'
|
||||||
import BlogPostListScroll from './components/BlogPostListScroll'
|
import dynamic from 'next/dynamic'
|
||||||
import Hero from './components/Hero'
|
import Link from 'next/link'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import Card from './components/Card'
|
import { createContext, useContext, useEffect, useRef } from 'react'
|
||||||
import RightFloatArea from './components/RightFloatArea'
|
|
||||||
import SearchNav from './components/SearchNav'
|
|
||||||
import BlogPostArchive from './components/BlogPostArchive'
|
|
||||||
import { ArticleLock } from './components/ArticleLock'
|
|
||||||
import PostHeader from './components/PostHeader'
|
|
||||||
import JumpToCommentButton from './components/JumpToCommentButton'
|
|
||||||
import TocDrawer from './components/TocDrawer'
|
|
||||||
import TocDrawerButton from './components/TocDrawerButton'
|
|
||||||
import Comment from '@/components/Comment'
|
|
||||||
import NotionPage from '@/components/NotionPage'
|
|
||||||
import ArticleAdjacent from './components/ArticleAdjacent'
|
import ArticleAdjacent from './components/ArticleAdjacent'
|
||||||
import ArticleCopyright from './components/ArticleCopyright'
|
import ArticleCopyright from './components/ArticleCopyright'
|
||||||
|
import { ArticleLock } from './components/ArticleLock'
|
||||||
import ArticleRecommend from './components/ArticleRecommend'
|
import ArticleRecommend from './components/ArticleRecommend'
|
||||||
import ShareBar from '@/components/ShareBar'
|
import BlogPostArchive from './components/BlogPostArchive'
|
||||||
import TagItemMini from './components/TagItemMini'
|
import BlogPostListPage from './components/BlogPostListPage'
|
||||||
import Link from 'next/link'
|
import BlogPostListScroll from './components/BlogPostListScroll'
|
||||||
|
import Card from './components/Card'
|
||||||
|
import Footer from './components/Footer'
|
||||||
|
import Hero from './components/Hero'
|
||||||
|
import JumpToCommentButton from './components/JumpToCommentButton'
|
||||||
|
import PostHeader from './components/PostHeader'
|
||||||
|
import RightFloatArea from './components/RightFloatArea'
|
||||||
|
import SearchNav from './components/SearchNav'
|
||||||
|
import SideRight from './components/SideRight'
|
||||||
import SlotBar from './components/SlotBar'
|
import SlotBar from './components/SlotBar'
|
||||||
import { Transition } from '@headlessui/react'
|
import TagItemMini from './components/TagItemMini'
|
||||||
|
import TocDrawer from './components/TocDrawer'
|
||||||
|
import TocDrawerButton from './components/TocDrawerButton'
|
||||||
|
import TopNav from './components/TopNav'
|
||||||
|
import CONFIG from './config'
|
||||||
import { Style } from './style'
|
import { Style } from './style'
|
||||||
import replaceSearchResult from '@/components/Mark'
|
|
||||||
import { siteConfig } from '@/lib/config'
|
|
||||||
import dynamic from 'next/dynamic'
|
|
||||||
|
|
||||||
const AlgoliaSearchModal = dynamic(() => import('@/components/AlgoliaSearchModal'), { ssr: false })
|
const AlgoliaSearchModal = dynamic(
|
||||||
|
() => import('@/components/AlgoliaSearchModal'),
|
||||||
|
{ ssr: false }
|
||||||
|
)
|
||||||
|
|
||||||
// 主题全局状态
|
// 主题全局状态
|
||||||
const ThemeGlobalHexo = createContext()
|
const ThemeGlobalHexo = createContext()
|
||||||
@@ -50,93 +53,110 @@ const LayoutBase = props => {
|
|||||||
const { onLoading, fullWidth } = useGlobal()
|
const { onLoading, fullWidth } = useGlobal()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const headerSlot = post
|
const headerSlot = post ? (
|
||||||
? <PostHeader {...props} />
|
<PostHeader {...props} />
|
||||||
: (router.route === '/' && siteConfig('HEXO_HOME_BANNER_ENABLE', null, CONFIG)
|
) : router.route === '/' &&
|
||||||
? <Hero {...props} />
|
siteConfig('HEXO_HOME_BANNER_ENABLE', null, CONFIG) ? (
|
||||||
: null)
|
<Hero {...props} />
|
||||||
|
) : null
|
||||||
|
|
||||||
const drawerRight = useRef(null)
|
const drawerRight = useRef(null)
|
||||||
const tocRef = isBrowser ? document.getElementById('article-wrapper') : null
|
const tocRef = isBrowser ? document.getElementById('article-wrapper') : null
|
||||||
|
|
||||||
const floatSlot = <>
|
const floatSlot = (
|
||||||
{post?.toc?.length > 1 && <div className="block lg:hidden">
|
<>
|
||||||
<TocDrawerButton
|
{post?.toc?.length > 1 && (
|
||||||
onClick={() => {
|
<div className='block lg:hidden'>
|
||||||
drawerRight?.current?.handleSwitchVisible()
|
<TocDrawerButton
|
||||||
}}
|
onClick={() => {
|
||||||
/>
|
drawerRight?.current?.handleSwitchVisible()
|
||||||
</div>}
|
}}
|
||||||
<JumpToCommentButton />
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{post && <JumpToCommentButton />}
|
||||||
</>
|
</>
|
||||||
|
)
|
||||||
|
|
||||||
// Algolia搜索框
|
// Algolia搜索框
|
||||||
const searchModal = useRef(null)
|
const searchModal = useRef(null)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeGlobalHexo.Provider value={{ searchModal }}>
|
<ThemeGlobalHexo.Provider value={{ searchModal }}>
|
||||||
<div id='theme-hexo' className={`${siteConfig('FONT_STYLE')} dark:bg-black scroll-smooth`}>
|
<div
|
||||||
<Style/>
|
id='theme-hexo'
|
||||||
|
className={`${siteConfig('FONT_STYLE')} dark:bg-black scroll-smooth`}>
|
||||||
|
<Style />
|
||||||
|
|
||||||
{/* 顶部导航 */}
|
{/* 顶部导航 */}
|
||||||
<TopNav {...props} />
|
<TopNav {...props} />
|
||||||
|
|
||||||
{/* 顶部嵌入 */}
|
{/* 顶部嵌入 */}
|
||||||
<Transition
|
<Transition
|
||||||
|
show={!onLoading}
|
||||||
|
appear={true}
|
||||||
|
enter='transition ease-in-out duration-700 transform order-first'
|
||||||
|
enterFrom='opacity-0 -translate-y-16'
|
||||||
|
enterTo='opacity-100'
|
||||||
|
leave='transition ease-in-out duration-300 transform'
|
||||||
|
leaveFrom='opacity-100'
|
||||||
|
leaveTo='opacity-0 translate-y-16'
|
||||||
|
unmount={false}>
|
||||||
|
{headerSlot}
|
||||||
|
</Transition>
|
||||||
|
|
||||||
|
{/* 主区块 */}
|
||||||
|
<main
|
||||||
|
id='wrapper'
|
||||||
|
className={`${siteConfig('HEXO_HOME_BANNER_ENABLE', null, CONFIG) ? '' : 'pt-16'} bg-hexo-background-gray dark:bg-black w-full py-8 md:px-8 lg:px-24 min-h-screen relative`}>
|
||||||
|
<div
|
||||||
|
id='container-inner'
|
||||||
|
className={
|
||||||
|
(JSON.parse(siteConfig('LAYOUT_SIDEBAR_REVERSE'))
|
||||||
|
? 'flex-row-reverse'
|
||||||
|
: '') +
|
||||||
|
' w-full mx-auto lg:flex lg:space-x-4 justify-center relative z-10'
|
||||||
|
}>
|
||||||
|
<div
|
||||||
|
className={`${className || ''} w-full ${fullWidth ? '' : 'max-w-4xl'} h-full overflow-hidden`}>
|
||||||
|
<Transition
|
||||||
show={!onLoading}
|
show={!onLoading}
|
||||||
appear={true}
|
appear={true}
|
||||||
enter="transition ease-in-out duration-700 transform order-first"
|
enter='transition ease-in-out duration-700 transform order-first'
|
||||||
enterFrom="opacity-0 -translate-y-16"
|
enterFrom='opacity-0 translate-y-16'
|
||||||
enterTo="opacity-100"
|
enterTo='opacity-100'
|
||||||
leave="transition ease-in-out duration-300 transform"
|
leave='transition ease-in-out duration-300 transform'
|
||||||
leaveFrom="opacity-100"
|
leaveFrom='opacity-100 translate-y-0'
|
||||||
leaveTo="opacity-0 translate-y-16"
|
leaveTo='opacity-0 -translate-y-16'
|
||||||
unmount={false}
|
unmount={false}>
|
||||||
>
|
{/* 主区上部嵌入 */}
|
||||||
{headerSlot}
|
{slotTop}
|
||||||
</Transition>
|
|
||||||
|
|
||||||
{/* 主区块 */}
|
{children}
|
||||||
<main id="wrapper" className={`${siteConfig('HEXO_HOME_BANNER_ENABLE', null, CONFIG) ? '' : 'pt-16'} bg-hexo-background-gray dark:bg-black w-full py-8 md:px-8 lg:px-24 min-h-screen relative`}>
|
</Transition>
|
||||||
<div id="container-inner" className={(JSON.parse(siteConfig('LAYOUT_SIDEBAR_REVERSE')) ? 'flex-row-reverse' : '') + ' w-full mx-auto lg:flex lg:space-x-4 justify-center relative z-10'} >
|
|
||||||
<div className={`${className || ''} w-full ${fullWidth ? '' : 'max-w-4xl'} h-full overflow-hidden`}>
|
|
||||||
|
|
||||||
<Transition
|
|
||||||
show={!onLoading}
|
|
||||||
appear={true}
|
|
||||||
enter="transition ease-in-out duration-700 transform order-first"
|
|
||||||
enterFrom="opacity-0 translate-y-16"
|
|
||||||
enterTo="opacity-100"
|
|
||||||
leave="transition ease-in-out duration-300 transform"
|
|
||||||
leaveFrom="opacity-100 translate-y-0"
|
|
||||||
leaveTo="opacity-0 -translate-y-16"
|
|
||||||
unmount={false}
|
|
||||||
>
|
|
||||||
{/* 主区上部嵌入 */}
|
|
||||||
{slotTop}
|
|
||||||
|
|
||||||
{children}
|
|
||||||
</Transition>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 右侧栏 */}
|
|
||||||
<SideRight {...props} className={`space-y-4 lg:w-80 pt-4 ${post ? 'lg:pt-0' : 'lg:pt-4'}`} />
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<div className='block lg:hidden'>
|
|
||||||
<TocDrawer post={post} cRef={drawerRight} targetRef={tocRef} />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 悬浮菜单 */}
|
{/* 右侧栏 */}
|
||||||
<RightFloatArea floatSlot={floatSlot} />
|
<SideRight
|
||||||
|
{...props}
|
||||||
|
className={`space-y-4 lg:w-80 pt-4 ${post ? 'lg:pt-0' : 'lg:pt-4'}`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
{/* 全文搜索 */}
|
<div className='block lg:hidden'>
|
||||||
<AlgoliaSearchModal cRef={searchModal} {...props}/>
|
<TocDrawer post={post} cRef={drawerRight} targetRef={tocRef} />
|
||||||
|
|
||||||
{/* 页脚 */}
|
|
||||||
<Footer title={siteConfig('TITLE') } />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* 悬浮菜单 */}
|
||||||
|
<RightFloatArea floatSlot={floatSlot} />
|
||||||
|
|
||||||
|
{/* 全文搜索 */}
|
||||||
|
<AlgoliaSearchModal cRef={searchModal} {...props} />
|
||||||
|
|
||||||
|
{/* 页脚 */}
|
||||||
|
<Footer title={siteConfig('TITLE')} />
|
||||||
|
</div>
|
||||||
</ThemeGlobalHexo.Provider>
|
</ThemeGlobalHexo.Provider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -147,7 +167,7 @@ const LayoutBase = props => {
|
|||||||
* @param {*} props
|
* @param {*} props
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const LayoutIndex = (props) => {
|
const LayoutIndex = props => {
|
||||||
return <LayoutPostList {...props} className='pt-8' />
|
return <LayoutPostList {...props} className='pt-8' />
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,11 +176,17 @@ const LayoutIndex = (props) => {
|
|||||||
* @param {*} props
|
* @param {*} props
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const LayoutPostList = (props) => {
|
const LayoutPostList = props => {
|
||||||
return <div className='pt-8'>
|
return (
|
||||||
<SlotBar {...props} />
|
<div className='pt-8'>
|
||||||
{siteConfig('POST_LIST_STYLE') === 'page' ? <BlogPostListPage {...props} /> : <BlogPostListScroll {...props} />}
|
<SlotBar {...props} />
|
||||||
|
{siteConfig('POST_LIST_STYLE') === 'page' ? (
|
||||||
|
<BlogPostListPage {...props} />
|
||||||
|
) : (
|
||||||
|
<BlogPostListScroll {...props} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -187,11 +213,20 @@ const LayoutSearch = props => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='pt-8'>
|
<div className='pt-8'>
|
||||||
{!currentSearch
|
{!currentSearch ? (
|
||||||
? <SearchNav {...props} />
|
<SearchNav {...props} />
|
||||||
: <div id="posts-wrapper"> {siteConfig('POST_LIST_STYLE') === 'page' ? <BlogPostListPage {...props} /> : <BlogPostListScroll {...props} />} </div>}
|
) : (
|
||||||
|
<div id='posts-wrapper'>
|
||||||
|
{' '}
|
||||||
|
{siteConfig('POST_LIST_STYLE') === 'page' ? (
|
||||||
|
<BlogPostListPage {...props} />
|
||||||
|
) : (
|
||||||
|
<BlogPostListScroll {...props} />
|
||||||
|
)}{' '}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,21 +235,23 @@ const LayoutSearch = props => {
|
|||||||
* @param {*} props
|
* @param {*} props
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const LayoutArchive = (props) => {
|
const LayoutArchive = props => {
|
||||||
const { archivePosts } = props
|
const { archivePosts } = props
|
||||||
return <div className='pt-8'>
|
return (
|
||||||
<Card className='w-full'>
|
<div className='pt-8'>
|
||||||
<div className="mb-10 pb-20 bg-white md:p-12 p-3 min-h-full dark:bg-hexo-black-gray">
|
<Card className='w-full'>
|
||||||
{Object.keys(archivePosts).map(archiveTitle => (
|
<div className='mb-10 pb-20 bg-white md:p-12 p-3 min-h-full dark:bg-hexo-black-gray'>
|
||||||
<BlogPostArchive
|
{Object.keys(archivePosts).map(archiveTitle => (
|
||||||
key={archiveTitle}
|
<BlogPostArchive
|
||||||
posts={archivePosts[archiveTitle]}
|
key={archiveTitle}
|
||||||
archiveTitle={archiveTitle}
|
posts={archivePosts[archiveTitle]}
|
||||||
/>
|
archiveTitle={archiveTitle}
|
||||||
))}
|
/>
|
||||||
</div>
|
))}
|
||||||
</Card>
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -228,51 +265,60 @@ const LayoutSlug = props => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// 404
|
// 404
|
||||||
if (!post) {
|
if (!post) {
|
||||||
setTimeout(() => {
|
setTimeout(
|
||||||
if (isBrowser) {
|
() => {
|
||||||
const article = document.getElementById('notion-article')
|
if (isBrowser) {
|
||||||
if (!article) {
|
const article = document.getElementById('notion-article')
|
||||||
router.push('/404').then(() => {
|
if (!article) {
|
||||||
console.warn('找不到页面', router.asPath)
|
router.push('/404').then(() => {
|
||||||
})
|
console.warn('找不到页面', router.asPath)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}, siteConfig('POST_WAITING_TIME_FOR_404') * 1000)
|
siteConfig('POST_WAITING_TIME_FOR_404') * 1000
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}, [post])
|
}, [post])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="w-full lg:hover:shadow lg:border rounded-t-xl lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black article">
|
<div className='w-full lg:hover:shadow lg:border rounded-t-xl lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black article'>
|
||||||
{lock && <ArticleLock validPassword={validPassword} />}
|
{lock && <ArticleLock validPassword={validPassword} />}
|
||||||
|
|
||||||
{!lock && <div id="article-wrapper" className="overflow-x-auto flex-grow mx-auto md:w-full md:px-5 ">
|
{!lock && (
|
||||||
|
<div
|
||||||
|
id='article-wrapper'
|
||||||
|
className='overflow-x-auto flex-grow mx-auto md:w-full md:px-5 '>
|
||||||
|
<article
|
||||||
|
itemScope
|
||||||
|
itemType='https://schema.org/Movie'
|
||||||
|
className='subpixel-antialiased overflow-y-hidden'>
|
||||||
|
{/* Notion文章主体 */}
|
||||||
|
<section className='px-5 justify-center mx-auto max-w-2xl lg:max-w-full'>
|
||||||
|
{post && <NotionPage post={post} />}
|
||||||
|
</section>
|
||||||
|
|
||||||
<article itemScope itemType="https://schema.org/Movie" className="subpixel-antialiased overflow-y-hidden" >
|
{/* 分享 */}
|
||||||
{/* Notion文章主体 */}
|
<ShareBar post={post} />
|
||||||
<section className='px-5 justify-center mx-auto max-w-2xl lg:max-w-full'>
|
{post?.type === 'Post' && (
|
||||||
{post && <NotionPage post={post} />}
|
<>
|
||||||
</section>
|
<ArticleCopyright {...props} />
|
||||||
|
<ArticleRecommend {...props} />
|
||||||
|
<ArticleAdjacent {...props} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</article>
|
||||||
|
|
||||||
{/* 分享 */}
|
<div className='pt-4 border-dashed'></div>
|
||||||
<ShareBar post={post} />
|
|
||||||
{post?.type === 'Post' && <>
|
|
||||||
<ArticleCopyright {...props} />
|
|
||||||
<ArticleRecommend {...props} />
|
|
||||||
<ArticleAdjacent {...props} />
|
|
||||||
</>}
|
|
||||||
|
|
||||||
</article>
|
{/* 评论互动 */}
|
||||||
|
<div className='duration-200 overflow-x-auto bg-white dark:bg-hexo-black-gray px-3'>
|
||||||
<div className='pt-4 border-dashed'></div>
|
<Comment frontMatter={post} />
|
||||||
|
|
||||||
{/* 评论互动 */}
|
|
||||||
<div className="duration-200 overflow-x-auto bg-white dark:bg-hexo-black-gray px-3">
|
|
||||||
<Comment frontMatter={post} />
|
|
||||||
</div>
|
|
||||||
</div>}
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</>
|
)}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,18 +343,18 @@ const Layout404 = props => {
|
|||||||
}, 3000)
|
}, 3000)
|
||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="text-black w-full h-screen text-center justify-center content-center items-center flex flex-col">
|
<div className='text-black w-full h-screen text-center justify-center content-center items-center flex flex-col'>
|
||||||
<div className="dark:text-gray-200">
|
<div className='dark:text-gray-200'>
|
||||||
<h2 className="inline-block border-r-2 border-gray-600 mr-2 px-3 py-2 align-top">
|
<h2 className='inline-block border-r-2 border-gray-600 mr-2 px-3 py-2 align-top'>
|
||||||
404
|
404
|
||||||
</h2>
|
</h2>
|
||||||
<div className="inline-block text-left h-32 leading-10 items-center">
|
<div className='inline-block text-left h-32 leading-10 items-center'>
|
||||||
<h2 className="m-0 p-0">页面未找到</h2>
|
<h2 className='m-0 p-0'>页面未找到</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,24 +367,32 @@ const LayoutCategoryIndex = props => {
|
|||||||
const { categoryOptions } = props
|
const { categoryOptions } = props
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
return (
|
return (
|
||||||
<div className='mt-8'>
|
<div className='mt-8'>
|
||||||
<Card className="w-full min-h-screen">
|
<Card className='w-full min-h-screen'>
|
||||||
<div className="dark:text-gray-200 mb-5 mx-3">
|
<div className='dark:text-gray-200 mb-5 mx-3'>
|
||||||
<i className="mr-4 fas fa-th" /> {locale.COMMON.CATEGORY}:
|
<i className='mr-4 fas fa-th' /> {locale.COMMON.CATEGORY}:
|
||||||
</div>
|
|
||||||
<div id="category-list" className="duration-200 flex flex-wrap mx-8">
|
|
||||||
{categoryOptions?.map(category => {
|
|
||||||
return (
|
|
||||||
<Link key={category.name} href={`/category/${category.name}`} passHref legacyBehavior>
|
|
||||||
<div className={' duration-300 dark:hover:text-white px-5 cursor-pointer py-2 hover:text-indigo-400'}>
|
|
||||||
<i className="mr-4 fas fa-folder" /> {category.name}({category.count})
|
|
||||||
</div>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div id='category-list' className='duration-200 flex flex-wrap mx-8'>
|
||||||
|
{categoryOptions?.map(category => {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
key={category.name}
|
||||||
|
href={`/category/${category.name}`}
|
||||||
|
passHref
|
||||||
|
legacyBehavior>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
' duration-300 dark:hover:text-white px-5 cursor-pointer py-2 hover:text-indigo-400'
|
||||||
|
}>
|
||||||
|
<i className='mr-4 fas fa-folder' /> {category.name}(
|
||||||
|
{category.count})
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,30 +405,32 @@ const LayoutTagIndex = props => {
|
|||||||
const { tagOptions } = props
|
const { tagOptions } = props
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
return (
|
return (
|
||||||
<div className='mt-8'>
|
<div className='mt-8'>
|
||||||
<Card className='w-full'>
|
<Card className='w-full'>
|
||||||
<div className="dark:text-gray-200 mb-5 ml-4">
|
<div className='dark:text-gray-200 mb-5 ml-4'>
|
||||||
<i className="mr-4 fas fa-tag" /> {locale.COMMON.TAGS}:
|
<i className='mr-4 fas fa-tag' /> {locale.COMMON.TAGS}:
|
||||||
</div>
|
|
||||||
<div id="tags-list" className="duration-200 flex flex-wrap ml-8">
|
|
||||||
{tagOptions.map(tag => <div key={tag.name} className="p-2">
|
|
||||||
<TagItemMini key={tag.name} tag={tag} />
|
|
||||||
</div>)}
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div id='tags-list' className='duration-200 flex flex-wrap ml-8'>
|
||||||
|
{tagOptions.map(tag => (
|
||||||
|
<div key={tag.name} className='p-2'>
|
||||||
|
<TagItemMini key={tag.name} tag={tag} />
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
CONFIG as THEME_CONFIG,
|
|
||||||
LayoutBase,
|
|
||||||
LayoutIndex,
|
|
||||||
LayoutSearch,
|
|
||||||
LayoutArchive,
|
|
||||||
LayoutSlug,
|
|
||||||
Layout404,
|
Layout404,
|
||||||
|
LayoutArchive,
|
||||||
|
LayoutBase,
|
||||||
LayoutCategoryIndex,
|
LayoutCategoryIndex,
|
||||||
|
LayoutIndex,
|
||||||
LayoutPostList,
|
LayoutPostList,
|
||||||
LayoutTagIndex
|
LayoutSearch,
|
||||||
|
LayoutSlug,
|
||||||
|
LayoutTagIndex,
|
||||||
|
CONFIG as THEME_CONFIG
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user