Skip to content

Commit 5a985b3

Browse files
committed
Theme-Magzine SEO
1 parent a07b128 commit 5a985b3

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

components/ExternalPlugins.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useEffect } from 'react'
77
import { GlobalStyle } from './GlobalStyle'
88
import { initGoogleAdsense } from './GoogleAdsense'
99

10+
import Head from 'next/head'
1011
import WebWhiz from './Webwhiz'
1112

1213
/**
@@ -252,10 +253,16 @@ const ExternalPlugin = props => {
252253
)}
253254

254255
{AD_WWADS_ID && (
255-
<script
256-
type='text/javascript'
257-
src='https://cdn.wwads.cn/js/makemoney.js'
258-
async></script>
256+
<>
257+
<Head>
258+
{/* 提前连接到广告服务器 */}
259+
<link rel='preconnect' href='https://cdn.wwads.cn' />
260+
</Head>
261+
<script
262+
type='text/javascript'
263+
src='https://cdn.wwads.cn/js/makemoney.js'
264+
async></script>
265+
</>
259266
)}
260267

261268
{/* {COMMENT_TWIKOO_ENV_ID && <script defer src={COMMENT_TWIKOO_CDN_URL} />} */}

themes/magzine/components/Header.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ export default function Header(props) {
150150
<div className='flex gap-x-8 h-full'>
151151
<LogoBar {...props} />
152152
{/* 桌面端顶部菜单 */}
153-
<div className='hidden md:flex items-center gap-x-4 py-1'>
153+
<ul className='hidden md:flex items-center gap-x-4 py-1'>
154154
{links &&
155155
links?.map((link, index) => (
156156
<MenuItemDrop key={index} link={link} />
157157
))}
158-
</div>
158+
</ul>
159159
</div>
160160
</>
161161
)}

themes/magzine/components/PostListPage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ const PostListPage = ({ page = 1, posts = [], postCount }) => {
2525
<div className='w-full justify-center'>
2626
<div id='posts-wrapper'>
2727
{/* 列表 */}
28-
<ul className='grid grid-cols-1 lg:grid-cols-4 gap-4'>
28+
<div className='grid grid-cols-1 lg:grid-cols-4 gap-4'>
2929
{posts?.map((p, index) => {
3030
return <PostItemCard key={index} post={p} />
3131
})}
32-
</ul>
32+
</div>
3333
</div>
3434
<PaginationSimple page={page} totalPage={totalPage} />
3535
</div>

themes/magzine/components/PostListRecommend.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ const PostListRecommend = ({ latestPosts, allNavPages }) => {
2727
<h3 className='text-4xl font-bold'>{title}</h3>
2828
</div>
2929
{/* 列表 */}
30-
<ul className='hidden lg:grid grid-cols-1 lg:grid-cols-4 gap-4'>
30+
<div className='hidden lg:grid grid-cols-1 lg:grid-cols-4 gap-4'>
3131
{recommendPosts?.map((p, index) => {
3232
return <PostItemCard key={index} post={p} />
3333
})}
34-
</ul>
34+
</div>
3535
<div className='block lg:hidden px-2'>
3636
<Swiper posts={recommendPosts} />
3737
</div>

themes/magzine/components/PostListSimpleHorizontal.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ const PostSimpleListHorizontal = ({ title, href, posts }) => {
2828
)}
2929
</div>
3030
{/* 列表 */}
31-
<ul className='grid grid-cols-1 lg:grid-cols-4'>
31+
<div className='grid grid-cols-1 lg:grid-cols-4'>
3232
{posts?.map(p => {
3333
return <PostItemCardSimple key={p.id} post={p} />
3434
})}
35-
</ul>
35+
</div>
3636
{href && (
3737
<Link className='lg:hidden block text-lg underline' href={href}>
3838
<span>查看全部</span>

0 commit comments

Comments
 (0)