Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 17, 2024
2 parents 725130e + 69562d1 commit 22649f8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
24 changes: 16 additions & 8 deletions themes/magzine/components/CategoryGroup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useGlobal } from '@/lib/global'
import CategoryItem from './CategoryItem'
import Link from 'next/link'

/**
* 分类
Expand All @@ -15,15 +15,23 @@ const CategoryGroup = ({ currentCategory, categoryOptions }) => {
<div id='category-list' className='pt-4'>
<div className='text-xl font-bold mb-2'>{locale.COMMON.CATEGORY}</div>
<div className=''>
{categoryOptions?.map(category => {
{categoryOptions?.map((category, index) => {
const selected = currentCategory === category.name
return (
<CategoryItem
key={category.name}
selected={selected}
category={category.name}
categoryCount={category.count}
/>
<Link
key={index}
href={`/category/${category.name}`}
passHref
className={
(selected
? 'bg-gray-600 text-white '
: 'dark:text-gray-400 text-gray-900 ') +
'text-lg hover:underline flex text-md items-center duration-300 cursor-pointer py-1 whitespace-nowrap'
}>
<span>
{category.name} {category?.count && `(${category?.count})`}
</span>
</Link>
)
})}
</div>
Expand Down
2 changes: 1 addition & 1 deletion themes/magzine/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Footer = ({ title }) => {
</div>

{/* 右侧链接区块 */}
<div className='grid grid-cols-1 lg:grid-cols-4 lg:gap-16 gap-8'>
<div className='grid grid-cols-2 lg:grid-cols-4 lg:gap-16 gap-8'>
{MAGZINE_FOOTER_LINKS?.map((group, index) => {
return (
<div key={index}>
Expand Down
4 changes: 2 additions & 2 deletions themes/magzine/components/MenuItemCollapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const MenuItemCollapse = props => {
(selected
? 'bg-gray-600 text-white hover:text-white'
: 'hover:text-gray-600') +
' px-5 w-full text-left duration-200 dark:bg-hexo-black-gray dark:border-black'
' px-7 w-full text-left duration-200 dark:bg-hexo-black-gray dark:border-black'
}
onClick={toggleShow}>
{!hasSubMenu && (
Expand Down Expand Up @@ -77,7 +77,7 @@ export const MenuItemCollapse = props => {
<div
key={sLink.id}
className='
not:last-child:border-b-0 border-b dark:border-gray-800 py-2 px-14 cursor-pointer hover:bg-gray-100 dark:text-gray-200
not:last-child:border-b-0 border-b dark:border-gray-800 py-2 pl-12 cursor-pointer hover:bg-gray-100 dark:text-gray-200
dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'>
<Link href={sLink.href} target={link?.target}>
<div>
Expand Down
6 changes: 5 additions & 1 deletion themes/magzine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ const LayoutSlug = props => {
{/* 上一篇下一篇 */}
<PostNavAround prev={prev} next={next} />

<AdSlot />
{/* 评论区 */}
<Comment frontMatter={post} />
</section>
Expand Down Expand Up @@ -241,6 +240,11 @@ const LayoutSlug = props => {
<PostGroupLatest {...props} vertical={true} />
</div>

{/* Adsense */}
<div>
<AdSlot />
</div>

{/* 文章分类区块 */}
<div>
<CategoryGroup {...props} />
Expand Down

0 comments on commit 22649f8

Please sign in to comment.