Skip to content

Commit 054daa7

Browse files
authored
Merge branch 'tangly1024:main' into martini
2 parents 3ce3a86 + e3ce491 commit 054daa7

File tree

17 files changed

+254
-203
lines changed

17 files changed

+254
-203
lines changed

lib/lang/en-US.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export default {
6161
START_READING: 'Start Reading',
6262
MINUTE: 'min',
6363
WORD_COUNT: 'Words',
64-
READ_TIME: 'Read Time'
64+
READ_TIME: 'Read Time',
65+
NEXT_POST: '下一篇'
6566
},
6667
PAGINATION: {
6768
PREV: 'Prev',

lib/lang/zh-CN.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export default {
6262
START_READING: '开始阅读',
6363
MINUTE: '分钟',
6464
WORD_COUNT: '字数',
65-
READ_TIME: '阅读时长'
65+
READ_TIME: '阅读时长',
66+
NEXT_POST:'下一篇'
6667
},
6768
PAGINATION: {
6869
PREV: '上页',

themes/example/components/BlogListPage.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const BlogListPage = props => {
2424
.split('?')[0]
2525
.replace(/\/page\/[1-9]\d*/, '')
2626
.replace(/\/$/, '')
27+
.replace('.html', '')
2728

2829
const showPageCover = siteConfig('EXAMPLE_POST_LIST_COVER', null, CONFIG)
2930

themes/game/components/PaginationSimple.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const PaginationSimple = ({ page, showNext }) => {
1717
.split('?')[0]
1818
.replace(/\/page\/[1-9]\d*/, '')
1919
.replace(/\/$/, '')
20+
.replace('.html', '')
2021

2122
return (
2223
<div className='my-10 flex justify-between font-medium text-black dark:text-gray-100 space-x-2'>

themes/heo/components/Header.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const Header = props => {
140140
{/* 顶部导航菜单栏 */}
141141
<nav
142142
id='nav'
143-
className={`z-20 h-16 top-0 w-full duration-500 transition-all
143+
className={`z-20 h-16 top-0 w-full duration-300 transition-all
144144
${fixedNav ? 'fixed' : 'relative bg-transparent'}
145145
${textWhite ? 'text-white ' : 'text-black dark:text-white'}
146146
${navBgWhite ? 'bg-white dark:bg-[#18171d] shadow' : 'bg-transparent'}`}>
@@ -153,14 +153,18 @@ const Header = props => {
153153
{/* 中间菜单 */}
154154
<div
155155
id='nav-bar-swipe'
156-
className={`hidden lg:flex flex-grow flex-col items-center justify-center h-full relative w-full ${activeIndex === 0 ? 'fade-in-down' : 'fade-in-up'}`}>
157-
{activeIndex === 0 && <MenuListTop {...props} />}
158-
{activeIndex === 1 && (
156+
className={`hidden lg:flex flex-grow flex-col items-center justify-center h-full relative w-full`}>
157+
<div
158+
className={`absolute transition-all duration-700 ${activeIndex === 0 ? 'opacity-100 mt-0' : '-mt-20 opacity-0 invisible'}`}>
159+
<MenuListTop {...props} />
160+
</div>
161+
<div
162+
className={`absolute transition-all duration-700 ${activeIndex === 1 ? 'opacity-100 mb-0' : '-mb-20 opacity-0 invisible'}`}>
159163
<h1 className='font-bold text-center text-light-400 dark:text-gray-400'>
160164
{siteConfig('AUTHOR') || siteConfig('TITLE')}{' '}
161165
{siteConfig('BIO') && <>|</>} {siteConfig('BIO')}
162166
</h1>
163-
)}
167+
</div>
164168
</div>
165169

166170
{/* 右侧固定 */}

themes/heo/components/MenuItemDrop.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export const MenuItemDrop = ({ link }) => {
3636
{hasSubMenu && (
3737
<ul
3838
style={{ backdropFilter: 'blur(3px)' }}
39-
className={`${show ? 'visible opacity-100 top-14' : 'invisible opacity-0 top-20'} drop-shadow-md overflow-hidden rounded-xl bg-white dark:bg-[#1e1e1e] border dark:border-gray-700 transition-all duration-300 z-20 absolute`}>
39+
className={`${show ? 'visible opacity-100 top-14' : 'invisible opacity-0 top-20'} drop-shadow-md overflow-hidden rounded-xl bg-white dark:bg-[#1e1e1e] transition-all duration-300 z-20 absolute`}>
4040
{link.subMenus.map((sLink, index) => {
4141
return (
4242
<li
4343
key={index}
44-
className='cursor-pointer hover:bg-blue-600 dark:hover:bg-yellow-600 hover:text-white text-gray-900 dark:text-gray-100 tracking-widest transition-all duration-200 dark:border-gray-700 py-1 pr-6 pl-3'>
44+
className='cursor-pointer hover:bg-blue-600 dark:hover:bg-yellow-600 hover:text-white text-gray-900 dark:text-gray-100 tracking-widest transition-all duration-200 py-1 pr-6 pl-3'>
4545
<Link href={sLink.href} target={link?.target}>
4646
<span className='text-sm text-nowrap font-extralight'>
4747
{link?.icon && <i className={sLink?.icon}> &nbsp; </i>}

themes/heo/components/PaginationNumber.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const PaginationNumber = ({ page, totalPage }) => {
2121
.split('?')[0]
2222
.replace(/\/page\/[1-9]\d*/, '')
2323
.replace(/\/$/, '')
24+
.replace('.html', '')
2425
const pages = generatePages(pagePrefix, page, currentPage, totalPage)
2526

2627
const [value, setValue] = useState('')

themes/heo/components/PostAdjacent.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { siteConfig } from '@/lib/config'
2+
import { useGlobal } from '@/lib/global'
23
import Link from 'next/link'
34
import { useRouter } from 'next/router'
45
import { useEffect, useState } from 'react'
@@ -12,6 +13,7 @@ import CONFIG from '../config'
1213
export default function PostAdjacent({ prev, next }) {
1314
const [isShow, setIsShow] = useState(false)
1415
const router = useRouter()
16+
const { locale } = useGlobal()
1517

1618
useEffect(() => {
1719
setIsShow(false)
@@ -85,13 +87,13 @@ export default function PostAdjacent({ prev, next }) {
8587

8688
<div
8789
id='pc-next-post'
88-
className={`hidden md:block fixed z-40 right-24 bottom-4 duration-200 transition-all ${isShow ? 'mb-0 opacity-100' : '-mb-24 opacity-0'}`}>
90+
className={`${isShow ? 'mb-5 opacity-100' : '-mb-24 opacity-0'} hidden md:block fixed z-40 right-10 bottom-4 duration-200 transition-all`}>
8991
<Link
9092
href={`/${next.slug}`}
91-
className='cursor-pointer drop-shadow-xl duration transition-all h-24 dark:bg-[#1e1e1e] border dark:border-gray-600 p-3 bg-white dark:text-gray-300 dark:hover:text-yellow-600 hover:font-bold hover:text-blue-600 rounded-lg flex flex-col justify-between'>
92-
<div className='text-xs'>下一篇</div>
93-
<hr />
94-
<div>{next?.title}</div>
93+
className='text-sm block p-4 w-72 h-28 cursor-pointer drop-shadow-xl duration transition-all dark:bg-[#1e1e1e] border dark:border-gray-600 bg-white dark:text-gray-300 dark:hover:text-yellow-600 hover:font-bold hover:text-blue-600 rounded-lg'>
94+
<div className='font-semibold'>{locale.COMMON.NEXT_POST}</div>
95+
<hr className='mt-2 mb-3' />
96+
<div className='line-clamp-2'>{next?.title}</div>
9597
</Link>
9698
</div>
9799
</div>

themes/heo/index.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -291,18 +291,19 @@ const LayoutSlug = props => {
291291
{!lock && (
292292
<div id='article-wrapper' className='mx-auto md:w-full md:px-5'>
293293
{/* 文章主体 */}
294-
<article
295-
itemScope
296-
itemType='https://schema.org/Movie'
297-
data-wow-delay='.2s'
298-
className='wow fadeInUp'>
294+
<article itemScope itemType='https://schema.org/Movie'>
299295
{/* Notion文章主体 */}
300-
<section className='px-5 py-5 justify-center mx-auto'>
296+
<section
297+
className='wow fadeInUp p-5 justify-center mx-auto'
298+
data-wow-delay='.2s'>
301299
<WWAds orientation='horizontal' className='w-full' />
302300
{post && <NotionPage post={post} />}
303301
<WWAds orientation='horizontal' className='w-full' />
304302
</section>
305303

304+
{/* 上一篇\下一篇文章 */}
305+
<PostAdjacent {...props} />
306+
306307
{/* 分享 */}
307308
<ShareBar post={post} />
308309
{post?.type === 'Post' && (
@@ -315,9 +316,6 @@ const LayoutSlug = props => {
315316
)}
316317
</article>
317318

318-
{/* 上一篇\下一篇文章 */}
319-
<PostAdjacent {...props} />
320-
321319
{/* 评论区 */}
322320
{fullWidth ? null : (
323321
<div className={`${commentEnable && post ? '' : 'hidden'}`}>

themes/hexo/components/PaginationNumber.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const PaginationNumber = ({ page, totalPage }) => {
1616
.split('?')[0]
1717
.replace(/\/page\/[1-9]\d*/, '')
1818
.replace(/\/$/, '')
19+
.replace('.html', '')
1920
const pages = generatePages(pagePrefix, page, currentPage, totalPage)
2021

2122
return (

themes/movie/components/PaginationNumber.js

+25-31
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const PaginationNumber = ({ page, totalPage }) => {
2222
.split('?')[0]
2323
.replace(/\/page\/[1-9]\d*/, '')
2424
.replace(/\/$/, '')
25+
.replace('.html', '')
2526
const pages = generatePages(pagePrefix, page, currentPage, totalPage)
2627
if (pages?.length <= 1) {
2728
return <></>
@@ -46,7 +47,7 @@ const PaginationNumber = ({ page, totalPage }) => {
4647
return (
4748
<>
4849
{/* pc端分页按钮 */}
49-
<div className="hidden lg:flex justify-between items-end mt-10 mb-5 font-medium text-black duration-500 dark:text-gray-300 py-3 space-x-2 overflow-x-auto">
50+
<div className='hidden lg:flex justify-between items-end mt-10 mb-5 font-medium text-black duration-500 dark:text-gray-300 py-3 space-x-2 overflow-x-auto'>
5051
{/* 上一页 */}
5152
<Link
5253
href={{
@@ -56,32 +57,29 @@ const PaginationNumber = ({ page, totalPage }) => {
5657
: `${pagePrefix}/page/${currentPage - 1}`,
5758
query: router.query.s ? { s: router.query.s } : {}
5859
}}
59-
rel="prev"
60-
className={`${currentPage === 1 ? 'invisible' : 'block'}`}
61-
>
62-
<div className="relative w-24 h-10 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-lg cursor-pointer group">
63-
<i className="fas fa-angle-left mr-2 transition-all duration-200 transform group-hover:-translate-x-4" />
64-
<div className="absolute translate-x-4 ml-2 opacity-0 transition-all duration-200 group-hover:opacity-100 group-hover:translate-x-0">
60+
rel='prev'
61+
className={`${currentPage === 1 ? 'invisible' : 'block'}`}>
62+
<div className='relative w-24 h-10 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-lg cursor-pointer group'>
63+
<i className='fas fa-angle-left mr-2 transition-all duration-200 transform group-hover:-translate-x-4' />
64+
<div className='absolute translate-x-4 ml-2 opacity-0 transition-all duration-200 group-hover:opacity-100 group-hover:translate-x-0'>
6565
{locale.PAGINATION.PREV}
6666
</div>
6767
</div>
6868
</Link>
6969

7070
{/* 分页 */}
71-
<div className="flex items-center space-x-2">
71+
<div className='flex items-center space-x-2'>
7272
{pages}
7373

7474
{/* 跳转页码 */}
75-
<div className="bg-white hover:bg-gray-100 dark:hover:bg-yellow-600 dark:bg-[#1e1e1e] h-10 border flex justify-center items-center rounded-lg group hover:border-indigo-600 transition-all duration-200">
75+
<div className='bg-white hover:bg-gray-100 dark:hover:bg-yellow-600 dark:bg-[#1e1e1e] h-10 border flex justify-center items-center rounded-lg group hover:border-indigo-600 transition-all duration-200'>
7676
<input
7777
value={value}
78-
className="w-0 group-hover:w-20 group-hover:px-3 transition-all duration-200 bg-gray-100 border-none outline-none h-full rounded-lg"
79-
onInput={handleInputChange}
80-
></input>
78+
className='w-0 group-hover:w-20 group-hover:px-3 transition-all duration-200 bg-gray-100 border-none outline-none h-full rounded-lg'
79+
onInput={handleInputChange}></input>
8180
<div
8281
onClick={jumpToPage}
83-
className="cursor-pointer hover:bg-indigo-600 dark:bg-[#1e1e1e] dark:hover:bg-yellow-600 hover:text-white px-4 py-2 group-hover:px-2 group-hover:mx-1 group-hover:rounded bg-white"
84-
>
82+
className='cursor-pointer hover:bg-indigo-600 dark:bg-[#1e1e1e] dark:hover:bg-yellow-600 hover:text-white px-4 py-2 group-hover:px-2 group-hover:mx-1 group-hover:rounded bg-white'>
8583
<ChevronDoubleRight className={'w-4 h-4'} />
8684
</div>
8785
</div>
@@ -93,12 +91,11 @@ const PaginationNumber = ({ page, totalPage }) => {
9391
pathname: `${pagePrefix}/page/${currentPage + 1}`,
9492
query: router.query.s ? { s: router.query.s } : {}
9593
}}
96-
rel="next"
97-
className={`${+showNext ? 'block' : 'invisible'} `}
98-
>
99-
<div className="relative w-24 h-10 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-lg cursor-pointer group">
100-
<i className="fas fa-angle-right mr-2 transition-all duration-200 transform group-hover:translate-x-6" />
101-
<div className="absolute -translate-x-10 ml-2 opacity-0 transition-all duration-200 group-hover:opacity-100 group-hover:-translate-x-2">
94+
rel='next'
95+
className={`${+showNext ? 'block' : 'invisible'} `}>
96+
<div className='relative w-24 h-10 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-lg cursor-pointer group'>
97+
<i className='fas fa-angle-right mr-2 transition-all duration-200 transform group-hover:translate-x-6' />
98+
<div className='absolute -translate-x-10 ml-2 opacity-0 transition-all duration-200 group-hover:opacity-100 group-hover:-translate-x-2'>
10299
{locale.PAGINATION.NEXT}
103100
</div>
104101
</div>
@@ -107,7 +104,7 @@ const PaginationNumber = ({ page, totalPage }) => {
107104

108105
{/* 移动端分页 */}
109106

110-
<div className="lg:hidden w-full flex flex-row">
107+
<div className='lg:hidden w-full flex flex-row'>
111108
{/* 上一页 */}
112109
<Link
113110
href={{
@@ -117,23 +114,21 @@ const PaginationNumber = ({ page, totalPage }) => {
117114
: `${pagePrefix}/page/${currentPage - 1}`,
118115
query: router.query.s ? { s: router.query.s } : {}
119116
}}
120-
rel="prev"
121-
className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}
122-
>
117+
rel='prev'
118+
className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}>
123119
{locale.PAGINATION.PREV}
124120
</Link>
125121

126-
{showPrev && showNext && <div className="w-12"></div>}
122+
{showPrev && showNext && <div className='w-12'></div>}
127123

128124
{/* 下一页 */}
129125
<Link
130126
href={{
131127
pathname: `${pagePrefix}/page/${currentPage + 1}`,
132128
query: router.query.s ? { s: router.query.s } : {}
133129
}}
134-
rel="next"
135-
className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}
136-
>
130+
rel='next'
131+
className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}>
137132
{locale.PAGINATION.NEXT}
138133
</Link>
139134
</div>
@@ -163,8 +158,7 @@ function getPageElement(page, currentPage, pagePrefix) {
163158
? 'bg-indigo-600 dark:bg-yellow-600 text-white '
164159
: 'dark:bg-[#1e1e1e] bg-white') +
165160
' hover:border-indigo-600 dark:hover:bg-yellow-600 dark:border-gray-600 px-4 border py-2 rounded-lg drop-shadow-sm duration-200 transition-colors'
166-
}
167-
>
161+
}>
168162
{page}
169163
</Link>
170164
)
@@ -197,7 +191,7 @@ function generatePages(pagePrefix, page, currentPage, totalPage) {
197191
}
198192
if (startPage > 2) {
199193
pages.push(
200-
<div key={-1} className="-mt-2 mx-1">
194+
<div key={-1} className='-mt-2 mx-1'>
201195
...{' '}
202196
</div>
203197
)

0 commit comments

Comments
 (0)