mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
little fix
This commit is contained in:
@@ -15,8 +15,11 @@ const Utterances = ({ issueTerm, layout }) => {
|
||||
const [isLoading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const script = document.createElement('script');
|
||||
const anchor = document.getElementById('comments');
|
||||
if(!anchor){
|
||||
return
|
||||
}
|
||||
const script = document.createElement('script');
|
||||
script.onload = () => setLoading(false);
|
||||
script.setAttribute('src', 'https://utteranc.es/client.js');
|
||||
script.setAttribute('crossorigin', 'anonymous');
|
||||
@@ -25,7 +28,7 @@ const Utterances = ({ issueTerm, layout }) => {
|
||||
script.setAttribute('issue-term', 'title');
|
||||
// 初始主题
|
||||
script.setAttribute('theme', isDarkMode ? 'github-dark' : 'github-light');
|
||||
anchor.appendChild(script);
|
||||
anchor?.appendChild(script);
|
||||
|
||||
return () => {
|
||||
// anchor.innerHTML = ''
|
||||
|
||||
@@ -10,10 +10,6 @@ import BlogPostCard from './BlogPostCard'
|
||||
*/
|
||||
const BlogPostItem = (props) => {
|
||||
const { group } = props
|
||||
|
||||
console.log('####### group')
|
||||
console.log(group)
|
||||
|
||||
if (group?.category) {
|
||||
return <>
|
||||
<div id={group?.category} className='category text-lg font-normal pt-9 pb-4 first:pt-4 select-none flex justify-between font-sans text-neutral-800 dark:text-neutral-400 p-2' key={group?.category}>
|
||||
|
||||
@@ -21,7 +21,8 @@ export const MenuItem = ({ link }) => {
|
||||
}
|
||||
|
||||
// #号加标题 快速跳转到指定锚点
|
||||
const url = link?.to && link?.to.length > 0 ? link.to : '#' + link?.title
|
||||
const url = link?.to && link?.to !=='#' ? link.to : ('#' + link.name)
|
||||
console.log(link,url , '#' + link.name)
|
||||
|
||||
return <>
|
||||
{/* 菜单 */}
|
||||
@@ -53,7 +54,7 @@ export const MenuItem = ({ link }) => {
|
||||
{
|
||||
link?.subMenus?.map((sLink, index) => {
|
||||
// #号加标题 快速跳转到指定锚点
|
||||
const sUrl = sLink?.to && sLink?.to.length > 0 ? sLink.to : '#' + sLink?.title
|
||||
const sUrl = sLink?.to && sLink?.to.length !=='#' ? sLink.to : ('#' + sLink.name)
|
||||
return <div key={index} className='nav-submenu'>
|
||||
<Link href={sUrl}>
|
||||
<span className='dark:text-neutral-400 text-gray-500 hover:text-black dark:hover:text-white text-xs font-bold'><i className={`text-xs mr-1 ${sLink?.icon ? sLink?.icon : 'fas fa-hashtag'}`} />{sLink.title}</span>
|
||||
|
||||
@@ -195,7 +195,7 @@ const LayoutPostList = props => {
|
||||
// 顶部如果是按照分类或标签查看文章列表,列表顶部嵌入一个横幅
|
||||
// 如果是搜索,则列表顶部嵌入 搜索框
|
||||
return (
|
||||
<LayoutBase {...props} >
|
||||
<>
|
||||
<div className='w-full max-w-7xl mx-auto justify-center mt-8'>
|
||||
<div id='posts-wrapper' class='card-list grid gap-4 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5'>
|
||||
{posts?.map(post => (
|
||||
@@ -203,7 +203,7 @@ const LayoutPostList = props => {
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</LayoutBase>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ const LayoutSlug = (props) => {
|
||||
const { post, lock, validPassword } = props
|
||||
|
||||
return (
|
||||
<LayoutBase {...props} >
|
||||
<>
|
||||
{/* 文章锁 */}
|
||||
{lock && <ArticleLock validPassword={validPassword} />}
|
||||
|
||||
@@ -250,7 +250,7 @@ const LayoutSlug = (props) => {
|
||||
|
||||
<TocDrawer {...props} />
|
||||
</div>}
|
||||
</LayoutBase>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -271,14 +271,14 @@ const LayoutSearch = (props) => {
|
||||
* @returns
|
||||
*/
|
||||
const LayoutArchive = (props) => {
|
||||
return <LayoutBase {...props}></LayoutBase>
|
||||
return <div {...props}></div>
|
||||
// const { archivePosts } = props
|
||||
|
||||
return <LayoutBase {...props}>
|
||||
return <>
|
||||
<div className="mb-10 pb-20 md:py-12 py-3 min-h-full">
|
||||
{Object.keys(archivePosts)?.map(archiveTitle => <BlogArchiveItem key={archiveTitle} archiveTitle={archiveTitle} archivePosts={archivePosts} />)}
|
||||
</div>
|
||||
</LayoutBase>
|
||||
</>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,7 +296,7 @@ const Layout404 = props => {
|
||||
const LayoutCategoryIndex = (props) => {
|
||||
const { categoryOptions } = props
|
||||
const { locale } = useGlobal()
|
||||
return <LayoutBase {...props}>
|
||||
return <>
|
||||
<div className='bg-white dark:bg-gray-700 py-10'>
|
||||
<div className='dark:text-gray-200 mb-5'>
|
||||
<i className='mr-4 fas fa-th' />{locale.COMMON.CATEGORY}:
|
||||
@@ -318,18 +318,18 @@ const LayoutCategoryIndex = (props) => {
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</LayoutBase>
|
||||
</>
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签列表
|
||||
*/
|
||||
const LayoutTagIndex = (props) => {
|
||||
return <LayoutBase {...props}></LayoutBase>
|
||||
return <div {...props}></div>
|
||||
// const { tagOptions } = props
|
||||
// const { locale } = useGlobal()
|
||||
|
||||
return <LayoutBase {...props}>
|
||||
return <>
|
||||
<div className="bg-white dark:bg-gray-700 py-10">
|
||||
<div className="dark:text-gray-200 mb-5">
|
||||
<i className="mr-4 fas fa-tag" />
|
||||
@@ -345,7 +345,7 @@ const LayoutTagIndex = (props) => {
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</LayoutBase>
|
||||
</>
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user