Skip to content

Commit

Permalink
Theme-Magzine SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Nov 22, 2024
1 parent a07b128 commit 5a985b3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
15 changes: 11 additions & 4 deletions components/ExternalPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useEffect } from 'react'
import { GlobalStyle } from './GlobalStyle'
import { initGoogleAdsense } from './GoogleAdsense'

import Head from 'next/head'
import WebWhiz from './Webwhiz'

/**
Expand Down Expand Up @@ -252,10 +253,16 @@ const ExternalPlugin = props => {
)}

{AD_WWADS_ID && (
<script
type='text/javascript'
src='https://cdn.wwads.cn/js/makemoney.js'
async></script>
<>
<Head>
{/* 提前连接到广告服务器 */}
<link rel='preconnect' href='https://cdn.wwads.cn' />
</Head>
<script
type='text/javascript'
src='https://cdn.wwads.cn/js/makemoney.js'
async></script>
</>
)}

{/* {COMMENT_TWIKOO_ENV_ID && <script defer src={COMMENT_TWIKOO_CDN_URL} />} */}
Expand Down
4 changes: 2 additions & 2 deletions themes/magzine/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ export default function Header(props) {
<div className='flex gap-x-8 h-full'>
<LogoBar {...props} />
{/* 桌面端顶部菜单 */}
<div className='hidden md:flex items-center gap-x-4 py-1'>
<ul className='hidden md:flex items-center gap-x-4 py-1'>
{links &&
links?.map((link, index) => (
<MenuItemDrop key={index} link={link} />
))}
</div>
</ul>
</div>
</>
)}
Expand Down
4 changes: 2 additions & 2 deletions themes/magzine/components/PostListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const PostListPage = ({ page = 1, posts = [], postCount }) => {
<div className='w-full justify-center'>
<div id='posts-wrapper'>
{/* 列表 */}
<ul className='grid grid-cols-1 lg:grid-cols-4 gap-4'>
<div className='grid grid-cols-1 lg:grid-cols-4 gap-4'>
{posts?.map((p, index) => {
return <PostItemCard key={index} post={p} />
})}
</ul>
</div>
</div>
<PaginationSimple page={page} totalPage={totalPage} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions themes/magzine/components/PostListRecommend.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ const PostListRecommend = ({ latestPosts, allNavPages }) => {
<h3 className='text-4xl font-bold'>{title}</h3>
</div>
{/* 列表 */}
<ul className='hidden lg:grid grid-cols-1 lg:grid-cols-4 gap-4'>
<div className='hidden lg:grid grid-cols-1 lg:grid-cols-4 gap-4'>
{recommendPosts?.map((p, index) => {
return <PostItemCard key={index} post={p} />
})}
</ul>
</div>
<div className='block lg:hidden px-2'>
<Swiper posts={recommendPosts} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions themes/magzine/components/PostListSimpleHorizontal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const PostSimpleListHorizontal = ({ title, href, posts }) => {
)}
</div>
{/* 列表 */}
<ul className='grid grid-cols-1 lg:grid-cols-4'>
<div className='grid grid-cols-1 lg:grid-cols-4'>
{posts?.map(p => {
return <PostItemCardSimple key={p.id} post={p} />
})}
</ul>
</div>
{href && (
<Link className='lg:hidden block text-lg underline' href={href}>
<span>查看全部</span>
Expand Down

0 comments on commit 5a985b3

Please sign in to comment.