+
{postsToShow.map(post => (
diff --git a/themes/matery/components/FloatDarkModeButton.js b/themes/matery/components/FloatDarkModeButton.js
index a8821123..2e8fad7a 100644
--- a/themes/matery/components/FloatDarkModeButton.js
+++ b/themes/matery/components/FloatDarkModeButton.js
@@ -21,9 +21,8 @@ export default function FloatDarkModeButton() {
return (
-
+
)
}
diff --git a/themes/matery/components/Header.js b/themes/matery/components/Header.js
index 4e84e70c..c21c5523 100644
--- a/themes/matery/components/Header.js
+++ b/themes/matery/components/Header.js
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useState } from 'react'
import Typed from 'typed.js'
import CONFIG_MATERY from '../config_matery'
import throttle from 'lodash.throttle'
+import { useGlobal } from '@/lib/global'
let wrapperTop = 0
let windowTop = 0
@@ -17,6 +18,8 @@ const throttleMs = 200
const Header = props => {
const [typed, changeType] = useState()
const { siteInfo } = props
+ const { locale } = useGlobal()
+
useEffect(() => {
scrollTrigger()
updateHeaderHeight()
@@ -96,8 +99,8 @@ const Header = props => {
{ window.scrollTo({ top: wrapperTop, behavior: 'smooth' }) }}
- className="mt-12 border cursor-pointer w-40 text-center pt-4 pb-3 text-md text-white hover:bg-orange-600 duration-300 rounded-3xl">
- 开始阅读
+ className="mt-12 border cursor-pointer w-40 text-center pt-4 pb-3 text-md text-white hover:bg-orange-600 duration-300 rounded-3xl z-40">
+ {locale.COMMON.START_READING}
diff --git a/themes/matery/components/JumpToCommentButton.js b/themes/matery/components/JumpToCommentButton.js
index 1a11e765..0fe9ee98 100644
--- a/themes/matery/components/JumpToCommentButton.js
+++ b/themes/matery/components/JumpToCommentButton.js
@@ -17,11 +17,10 @@ const JumpToCommentButton = () => {
}
}
- return (
-
-
)
+ return
+
+
}
export default JumpToCommentButton
diff --git a/themes/matery/components/JumpToTopButton.js b/themes/matery/components/JumpToTopButton.js
index 984e76ca..2aa762dd 100644
--- a/themes/matery/components/JumpToTopButton.js
+++ b/themes/matery/components/JumpToTopButton.js
@@ -16,11 +16,14 @@ const JumpToTopButton = ({ showPercent = true, percent }) => {
if (!CONFIG_MATERY.WIDGET_TO_TOP) {
return <>>
}
- return (
window.scrollTo({ top: 0, behavior: 'smooth' })} >
-
- {showPercent && (
{percent}
)}
-
)
+
+ return
window.scrollTo({ top: 0, behavior: 'smooth' })} >
+
+
}
export default JumpToTopButton
diff --git a/themes/matery/components/PaginationSimple.js b/themes/matery/components/PaginationSimple.js
index 6605e64c..3e0ee2e5 100644
--- a/themes/matery/components/PaginationSimple.js
+++ b/themes/matery/components/PaginationSimple.js
@@ -1,4 +1,3 @@
-import BLOG from '@/blog.config'
import Link from 'next/link'
import { useRouter } from 'next/router'
@@ -13,6 +12,7 @@ const PaginationSimple = ({ page, totalPage }) => {
const router = useRouter()
const currentPage = +page
const showNext = currentPage < totalPage
+ const pagePrefix = router.asPath.replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '')
return (
@@ -20,8 +20,8 @@ const PaginationSimple = ({ page, totalPage }) => {
href={{
pathname:
currentPage - 1 === 1
- ? `${BLOG.SUB_PATH || '/'}`
- : `/page/${currentPage - 1}`,
+ ? `${pagePrefix}/`
+ : `${pagePrefix}/page/${currentPage - 1}`,
query: router.query.s ? { s: router.query.s } : {}
}}
passHref
@@ -36,7 +36,7 @@ const PaginationSimple = ({ page, totalPage }) => {
{
{locale.PAGINATION.NEXT}→
- );
+ )
}
export default PaginationSimple
diff --git a/themes/next/components/PaginationSimple.js b/themes/next/components/PaginationSimple.js
index 3a1b0101..39005382 100644
--- a/themes/next/components/PaginationSimple.js
+++ b/themes/next/components/PaginationSimple.js
@@ -1,4 +1,3 @@
-import BLOG from '@/blog.config'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useGlobal } from '@/lib/global'
@@ -14,6 +13,8 @@ const PaginationSimple = ({ page, showNext }) => {
const { locale } = useGlobal()
const router = useRouter()
const currentPage = +page
+ const pagePrefix = router.asPath.replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '')
+
return (
{
href={{
pathname:
currentPage - 1 === 1
- ? `${BLOG.SUB_PATH || '/'}`
- : `/page/${currentPage - 1}`,
+ ? `${pagePrefix}/`
+ : `${pagePrefix}/page/${currentPage - 1}`,
query: router.query.s ? { s: router.query.s } : {}
}}
passHref