gitbook 改版

This commit is contained in:
tangly1024.com
2024-09-24 11:39:18 +08:00
parent d94344c14a
commit fd4e96506b
13 changed files with 130 additions and 109 deletions

View File

@@ -3,6 +3,7 @@ import { useGlobal } from '@/lib/global'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import CONFIG from '../config'
import BlogPostCard from './BlogPostCard'
import NavPostItem from './NavPostItem'
/**
@@ -13,7 +14,7 @@ import NavPostItem from './NavPostItem'
* @constructor
*/
const NavPostList = props => {
const { filteredNavPages } = props
const { filteredNavPages, post } = props
const { locale, currentSearch } = useGlobal()
const router = useRouter()
@@ -80,11 +81,22 @@ const NavPostList = props => {
</div>
)
}
// 如果href
const href = siteConfig('GITBOOK_INDEX_PAGE') + ''
const homePost = {
id: '-1',
title: siteConfig('DESCRIPTION'),
href: href.indexOf('/') !== 0 ? '/' + href : href
}
return (
<div
id='posts-wrapper'
className='w-full flex-grow space-y-0.5 tracking-wider'>
className='w-full flex-grow space-y-0.5 pr-4 tracking-wider'>
{/* 当前文章 */}
<BlogPostCard className='text-sm py-2' post={homePost} />
{/* 文章列表 */}
{categoryFolders?.map((group, index) => (
<NavPostItem