Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 3, 2024
2 parents 30085ed + dc0a8d8 commit 7b9c304
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export const siteConfig = (key, defaultVal = null, extendConfig = {}) => {
case 'TAG_SORT_BY_COUNT':
case 'THEME':
case 'LINK':
// LINK比较特殊,
if (key === 'LINK') {
if (!extendConfig || Object.keys(extendConfig).length === 0) {
break
}
}
return convertVal(
getValue(extendConfig[key], getValue(defaultVal, BLOG[key]))
)
Expand Down
4 changes: 3 additions & 1 deletion pages/category/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { DynamicLayout } from '@/themes/theme'
*/
export default function Category(props) {
const theme = siteConfig('THEME', BLOG.THEME, props.NOTION_CONFIG)
return <DynamicLayout theme={theme} layoutName='LayoutPostList' {...props} />
return (
<DynamicLayout theme={theme} layoutName='LayoutCategoryIndex' {...props} />
)
}

export async function getStaticProps({ locale }) {
Expand Down
6 changes: 5 additions & 1 deletion pages/sitemap.xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export const getServerSideProps = async ctx => {
pageId: id,
from: 'sitemap.xml'
})
const link = siteConfig('LINK', '', siteData.NOTION_CONFIG)
const link = siteConfig(
'LINK',
siteData?.siteInfo?.link,
siteData.NOTION_CONFIG
)
const localeFields = generateLocalesSitemap(link, siteData.allPages, locale)
fields = fields.concat(localeFields)
}
Expand Down
2 changes: 1 addition & 1 deletion pages/tag/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useRouter } from 'next/router'
const TagIndex = props => {
const router = useRouter()
const theme = siteConfig('THEME', BLOG.THEME, props.NOTION_CONFIG)
return <DynamicLayout theme={theme} layoutName='LayoutPostList' {...props} />
return <DynamicLayout theme={theme} layoutName='LayoutTagIndex' {...props} />
}

export async function getStaticProps(req) {
Expand Down
2 changes: 1 addition & 1 deletion themes/gitbook/components/BottomMenuBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function BottomMenuBar({ post, className }) {
onClick={togglePageNavVisible}
className='inline-flex flex-col items-center justify-center px-5 border-gray-200 border-x hover:bg-gray-50 dark:hover:bg-gray-800 group dark:border-gray-600'>
<i className='fa-book fas w-5 h-5 mb-2 text-gray-500 dark:text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-500' />
<span class='text-sm text-gray-500 dark:text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-500'>
<span className='text-sm text-gray-500 dark:text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-500'>
{locale.COMMON.ARTICLE_LIST}
</span>
</button>
Expand Down

0 comments on commit 7b9c304

Please sign in to comment.