修复编译异常
This commit is contained in:
tangly1024
2021-12-14 19:32:06 +08:00
parent 3796b0f64a
commit 71924deefd
7 changed files with 10 additions and 21 deletions

View File

@@ -1,5 +1,3 @@
import { useRouter } from 'next/router'
import { useEffect } from 'react'
/**
* 空白博客 列表

View File

@@ -17,13 +17,9 @@ const Pagination = ({ page, showNext }) => {
return (
<div className='my-10 flex justify-between font-medium text-black dark:text-gray-100 space-x-2'>
<Link
href={
{
pathname: (currentPage - 1 === 1 ? `${BLOG.path || '/'}` : `/page/${currentPage - 1}`),
query: router.query.s ? { s: router.query.s } : {}
}
}
>
href={ {
pathname: (currentPage - 1 === 1 ? `${BLOG.path || '/'}` : `/page/${currentPage - 1}`), query: router.query.s ? { s: router.query.s } : {}
} } passHref >
<button
rel='prev'
className={`${currentPage === 1 ? 'invisible' : 'block'} w-full duration-200 px-4 py-2 hover:border-black border-b-2 hover:font-bold`}
@@ -31,12 +27,7 @@ const Pagination = ({ page, showNext }) => {
{locale.PAGINATION.PREV}
</button>
</Link>
<Link href={
{
pathname: `/page/${currentPage + 1}`,
query: router.query.s ? { s: router.query.s } : {}
}
}>
<Link href={ { pathname: `/page/${currentPage + 1}`, query: router.query.s ? { s: router.query.s } : {} } } passHref>
<button
rel='next'
className={`${+showNext ? 'block' : 'invisible'} w-full duration-200 px-4 py-2 hover:border-black border-b-2 hover:font-bold`}

View File

@@ -14,7 +14,7 @@ import {
faWeibo,
faWeixin
} from '@fortawesome/free-brands-svg-icons'
import { faLink, faStar } from '@fortawesome/free-solid-svg-icons'
import { faLink } from '@fortawesome/free-solid-svg-icons'
const ShareBar = ({ post }) => {
const router = useRouter()

View File

@@ -89,7 +89,7 @@ const BaseLayout = ({
<Footer />
<JumpToTopButton targetRef={targetRef} showPercent={true} />
<div className='hidden lg:block fixed right-5 bottom-52 py-2 px-2.5 rounded-full
<div className='hidden lg:block fixed right-5 bottom-52 py-1.5 px-2.5 rounded-full
bg-white text-black shadow-card dark:border-gray-500 dark:bg-gray-700 dark:text-white'>
<DarkModeButton />
</div>

View File

@@ -1,4 +1,4 @@
export default function getMetadata(rawMetadata) {
export default function getMetadata (rawMetadata) {
const metadata = {
locked: rawMetadata?.format?.block_locked,
page_full_width: rawMetadata?.format?.page_full_width,

View File

@@ -5,8 +5,7 @@ const indentLevels = {
sub_sub_header: 2
}
export const getPageTableOfContents = (page,recordMap)=> {
export const getPageTableOfContents = (page, recordMap) => {
// 获取 header sub_header sub_sub_header
const toc = (page.content ?? [])
.map((blockId) => {
@@ -66,4 +65,4 @@ export const getPageTableOfContents = (page,recordMap)=> {
}
return toc
}
}

View File

@@ -1,3 +1,4 @@
// eslint-disable-next-line @next/next/no-document-import-in-page
import Document, { Html, Head, Main, NextScript } from 'next/document'
import BLOG from '@/blog.config'
import ThirdPartyScript from '@/components/ThirdPartyScript'