mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-04 15:10:23 +00:00
stater 主題跳轉
This commit is contained in:
@@ -110,15 +110,16 @@ const LayoutIndex = (props) => {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const LayoutSlug = (props) => {
|
const LayoutSlug = (props) => {
|
||||||
// 如果 是 /article/[slug] 的文章路径则进行重定向到另一个域名
|
const { post } = props
|
||||||
|
|
||||||
|
// 如果 是 /article/[slug] 的文章路径则視情況进行重定向到另一个域名
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
if (siteConfig('STARTER_POST_REDIRECT_ENABLE', null, CONFIG) && isBrowser && router.route === '/[prefix]/[slug]') {
|
if (!post && siteConfig('STARTER_POST_REDIRECT_ENABLE', null, CONFIG) && isBrowser && router.route === '/[prefix]/[slug]') {
|
||||||
const redirectUrl = siteConfig('STARTER_POST_REDIRECT_URL', null, CONFIG) + router.asPath.replace('?theme=landing', '')
|
const redirectUrl = siteConfig('STARTER_POST_REDIRECT_URL', null, CONFIG) + router.asPath.replace('?theme=landing', '')
|
||||||
router.push(redirectUrl)
|
router.push(redirectUrl)
|
||||||
return <div id='theme-starter'><Loading /></div>
|
return <div id='theme-starter'><Loading /></div>
|
||||||
}
|
}
|
||||||
|
|
||||||
const { post } = props
|
|
||||||
return <>
|
return <>
|
||||||
<Banner title={post?.title} description={post?.summary}/>
|
<Banner title={post?.title} description={post?.summary}/>
|
||||||
<div className="container grow">
|
<div className="container grow">
|
||||||
|
|||||||
Reference in New Issue
Block a user