Skip to content

Commit 939515b

Browse files
authored
Merge pull request tangly1024#2325 from tangly1024/feat/theme-matery-fine-tuning
微调matery主题
2 parents 2dd9be9 + 92c0abf commit 939515b

File tree

4 files changed

+337
-250
lines changed

4 files changed

+337
-250
lines changed

themes/matery/components/BlogPostListPage.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import BlogPostCard from './BlogPostCard'
21
import { siteConfig } from '@/lib/config'
2+
import BlogPostCard from './BlogPostCard'
33
import BlogPostListEmpty from './BlogPostListEmpty'
44
import PaginationSimple from './PaginationSimple'
55

@@ -12,7 +12,9 @@ import PaginationSimple from './PaginationSimple'
1212
* @constructor
1313
*/
1414
const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
15-
const totalPage = Math.ceil(postCount / parseInt(siteConfig('POSTS_PER_PAGE')))
15+
const totalPage = Math.ceil(
16+
postCount / parseInt(siteConfig('POSTS_PER_PAGE'))
17+
)
1618
const showPagination = postCount >= parseInt(siteConfig('POSTS_PER_PAGE'))
1719
if (!posts || posts.length === 0 || page > totalPage) {
1820
return <BlogPostListEmpty />
@@ -21,12 +23,17 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
2123
<div className='w-full'>
2224
<div className='pt-6'></div>
2325
{/* 文章列表 */}
24-
<div className="pt-4 flex flex-wrap pb-12" >
25-
{posts?.map(post => (
26-
<div key={post.id} className='xl:w-1/3 md:w-1/2 w-full p-4'> <BlogPostCard index={posts.indexOf(post)} post={post} siteInfo={siteInfo} /></div>
26+
<div className='pt-4 flex flex-wrap pb-12'>
27+
{posts?.map((post, index) => (
28+
<div key={post.id} className='xl:w-1/3 md:w-1/2 w-full p-4'>
29+
{' '}
30+
<BlogPostCard index={index} post={post} siteInfo={siteInfo} />
31+
</div>
2732
))}
2833
</div>
29-
{showPagination && <PaginationSimple page={page} totalPage={totalPage} />}
34+
{showPagination && (
35+
<PaginationSimple page={page} totalPage={totalPage} />
36+
)}
3037
</div>
3138
)
3239
}

themes/matery/components/Footer.js

+46-17
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,60 @@ import { siteConfig } from '@/lib/config'
33
const Footer = ({ title }) => {
44
const d = new Date()
55
const currentYear = d.getFullYear()
6-
const copyrightDate = (function() {
7-
if (Number.isInteger(siteConfig('SINCE')) && siteConfig('SINCE') < currentYear) {
6+
const copyrightDate = (function () {
7+
if (
8+
Number.isInteger(siteConfig('SINCE')) &&
9+
siteConfig('SINCE') < currentYear
10+
) {
811
return siteConfig('SINCE') + '-' + currentYear
912
}
1013
return currentYear
1114
})()
1215

1316
return (
14-
<footer
15-
className='relative z-10 dark:bg-black flex-shrink-0 bg-indigo-700 text-gray-300 justify-center text-center m-auto w-full leading-6 dark:text-gray-100 text-sm p-6'
16-
>
17+
<footer className='relative z-10 dark:bg-black flex-shrink-0 bg-indigo-700 text-gray-300 justify-center text-center m-auto w-full leading-6 dark:text-gray-100 text-sm p-6'>
1718
{/* <DarkModeButton/> */}
18-
19-
<i className='fas fa-copyright' /> {`${copyrightDate}`} <span><i className='mx-1 animate-pulse fas fa-heart'/> <a href={siteConfig('LINK')} className='underline font-bold dark:text-gray-300 '>{siteConfig('AUTHOR')}</a>.<br/>
20-
21-
{siteConfig('BEI_AN') && <><i className='fas fa-shield-alt' /> <a href='https://beian.miit.gov.cn/' className='mr-2'>{siteConfig('BEI_AN')}</a><br/></>}
22-
23-
<span className='hidden busuanzi_container_site_pv'>
24-
<i className='fas fa-eye'/><span className='px-1 busuanzi_value_site_pv'> </span> </span>
25-
<span className='pl-2 hidden busuanzi_container_site_uv'>
26-
<i className='fas fa-users'/> <span className='px-1 busuanzi_value_site_uv'> </span> </span>
27-
<br/>
19+
<i className='fas fa-copyright' /> {`${copyrightDate}`}{' '}
20+
<span>
21+
<span className='w-5 mx-1 text-center'>
22+
<i className=' animate-pulse fas fa-heart' />
23+
</span>{' '}
24+
<a
25+
href={siteConfig('LINK')}
26+
className='underline font-bold dark:text-gray-300 '>
27+
{siteConfig('AUTHOR')}
28+
</a>
29+
.<br />
30+
{siteConfig('BEI_AN') && (
31+
<>
32+
<i className='fas fa-shield-alt' />{' '}
33+
<a href='https://beian.miit.gov.cn/' className='mr-2'>
34+
{siteConfig('BEI_AN')}
35+
</a>
36+
<br />
37+
</>
38+
)}
39+
<span className='hidden busuanzi_container_site_pv'>
40+
<i className='fas fa-eye' />
41+
<span className='px-1 busuanzi_value_site_pv'> </span>{' '}
42+
</span>
43+
<span className='pl-2 hidden busuanzi_container_site_uv'>
44+
<i className='fas fa-users' />{' '}
45+
<span className='px-1 busuanzi_value_site_uv'> </span>{' '}
46+
</span>
47+
<br />
2848
<h1>{title}</h1>
29-
<span className='text-xs '>Powered by <a href='https://github.com/tangly1024/NotionNext' className='underline dark:text-gray-300'>NotionNext {siteConfig('VERSION')}</a>.</span></span><br/>
30-
49+
<span className='text-xs '>
50+
Powered by{' '}
51+
<a
52+
href='https://github.com/tangly1024/NotionNext'
53+
className='underline dark:text-gray-300'>
54+
NotionNext {siteConfig('VERSION')}
55+
</a>
56+
.
57+
</span>
58+
</span>
59+
<br />
3160
</footer>
3261
)
3362
}

themes/matery/components/PostHeader.js

+20-8
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,27 @@ import { siteConfig } from '@/lib/config'
66
* 文章背景图
77
*/
88
export default function PostHeader({ post, siteInfo }) {
9-
const headerImage = post?.pageCoverThumbnail ? post?.pageCoverThumbnail : siteInfo?.pageCover
9+
const headerImage = post?.pageCoverThumbnail
10+
? post?.pageCoverThumbnail
11+
: siteInfo?.pageCover
1012
const title = post?.title
1113
return (
12-
<div id='header' className="flex h-96 justify-center align-middle items-center w-full relative bg-black">
13-
<div className="z-10 leading-snug font-bold xs:text-4xl sm:text-4xl md:text-5xl md:leading-snug text-4xl shadow-text-md flex justify-center text-center text-white">
14-
{siteConfig('POST_TITLE_ICON') && <NotionIcon icon={post?.pageIcon} />}{title}
15-
</div>
16-
<LazyImage alt={title} src={headerImage} className='pointer-events-none select-none w-full h-full object-cover opacity-30 absolute'
17-
placeholder='blur' blurDataURL='/bg_image.jpg' />
18-
</div>
14+
<div
15+
id='header'
16+
className='flex h-96 justify-center align-middle items-center w-full relative bg-black'>
17+
<div
18+
data-wow-delay='.1s'
19+
className='wow fadeInUp z-10 leading-snug font-bold xs:text-4xl sm:text-4xl md:text-5xl md:leading-snug text-4xl shadow-text-md flex justify-center text-center text-white'>
20+
{siteConfig('POST_TITLE_ICON') && <NotionIcon icon={post?.pageIcon} />}
21+
{title}
22+
</div>
23+
<LazyImage
24+
alt={title}
25+
src={headerImage}
26+
className='pointer-events-none select-none w-full h-full object-cover opacity-30 absolute'
27+
placeholder='blur'
28+
blurDataURL={siteConfig('IMG_LAZY_LOAD_PLACEHOLDER')}
29+
/>
30+
</div>
1931
)
2032
}

0 commit comments

Comments
 (0)