Skip to content

Commit

Permalink
fix(使所有主题的404能够正常运转)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3e3b766)
  • Loading branch information
qixing-jk committed Nov 9, 2024
1 parent 47b8d97 commit 3374068
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion themes/commerce/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const LayoutSlug = props => {
<div className='w-full max-w-screen-xl mx-auto lg:hover:shadow lg:border lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black article'>
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div
id='article-wrapper'
className='overflow-x-auto flex-grow mx-auto md:w-full md:px-5 '>
Expand Down
2 changes: 1 addition & 1 deletion themes/example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const LayoutSlug = props => {
<>
{lock ? (
<PostLock validPassword={validPassword} />
) : (
) : post && (
<div>
<PostMeta post={post} />
<div id='article-wrapper'>
Expand Down
2 changes: 1 addition & 1 deletion themes/fukasawa/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const LayoutSlug = props => {
<>
{lock ? (
<ArticleLock validPassword={validPassword} />
) : (
) : post && (
<ArticleDetail {...props} />
)}
</>
Expand Down
2 changes: 1 addition & 1 deletion themes/game/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ const LayoutSlug = props => {
<>
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div id='article-wrapper'>
<div className='game-detail-wrapper w-full grow flex'>
<div className={`w-full md:py-2`}>
Expand Down
2 changes: 1 addition & 1 deletion themes/heo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const LayoutSlug = props => {
{/* 文章锁 */}
{lock && <PostLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div className='mx-auto md:w-full md:px-5'>
{/* 文章主体 */}
<article
Expand Down
2 changes: 1 addition & 1 deletion themes/hexo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ const LayoutSlug = props => {
<div className='w-full lg:hover:shadow lg:border rounded-t-xl lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black article'>
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div className='overflow-x-auto flex-grow mx-auto md:w-full md:px-5 '>
<article
id='article-wrapper'
Expand Down
2 changes: 1 addition & 1 deletion themes/magzine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const LayoutSlug = props => {
{/* 文章锁 */}
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div className='w-full max-w-screen-3xl mx-auto'>
{/* 文章信息 */}
<ArticleInfo {...props} />
Expand Down
2 changes: 1 addition & 1 deletion themes/matery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ const LayoutSlug = props => {
className={`${fullWidth ? '' : '-mt-32'} transition-all duration-300 rounded-md mx-3 lg:border lg:rounded-xl lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black`}>
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div className='overflow-x-auto md:w-full px-3 '>
{/* 文章信息 */}
{post?.type && post?.type === 'Post' && (
Expand Down
2 changes: 1 addition & 1 deletion themes/medium/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const LayoutSlug = props => {
{/* 文章锁 */}
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div>
{/* 文章信息 */}
<ArticleInfo {...props} />
Expand Down
2 changes: 1 addition & 1 deletion themes/movie/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ const LayoutSlug = props => {

return (
<>
{!lock ? (
{!lock ? post && (
<div
id='article-wrapper'
className='px-2 max-w-5xl 2xl:max-w-[70%] mx-auto'>
Expand Down
2 changes: 1 addition & 1 deletion themes/nobelium/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const LayoutSlug = props => {
<>
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div className='px-2'>
<>
<ArticleInfo post={post} />
Expand Down
2 changes: 1 addition & 1 deletion themes/photo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ const LayoutSlug = props => {

return (
<>
{!lock ? (
{!lock ? post && (
<div
id='article-wrapper'
className='px-2 max-w-5xl 2xl:max-w-[70%] mx-auto'>
Expand Down
2 changes: 1 addition & 1 deletion themes/plog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const LayoutSlug = props => {
<>
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div className='px-2 my-16 max-w-6xl mx-auto'>
<>
<ArticleInfo post={post} />
Expand Down
52 changes: 27 additions & 25 deletions themes/simple/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,35 +224,37 @@ const LayoutSlug = props => {
<>
{lock && <ArticleLock validPassword={validPassword} />}

<div className={`px-2 ${fullWidth ? '' : 'xl:max-w-4xl 2xl:max-w-6xl'}`}>
{/* 文章信息 */}
<ArticleInfo post={post} />

{/* 广告嵌入 */}
{/* <AdSlot type={'in-article'} /> */}
<WWAds orientation='horizontal' className='w-full' />

<div id='article-wrapper'>
{/* Notion文章主体 */}
{!lock && <NotionPage post={post} />}
</div>
{!lock && post && (
<div className={`px-2 ${fullWidth ? '' : 'xl:max-w-4xl 2xl:max-w-6xl'}`}>
{/* 文章信息 */}
<ArticleInfo post={post} />

{/* 广告嵌入 */}
{/* <AdSlot type={'in-article'} /> */}
<WWAds orientation='horizontal' className='w-full' />

<div id='article-wrapper'>
{/* Notion文章主体 */}
{!lock && <NotionPage post={post} />}
</div>

{/* 分享 */}
<ShareBar post={post} />
{/* 分享 */}
<ShareBar post={post} />

{/* 广告嵌入 */}
<AdSlot type={'in-article'} />
{/* 广告嵌入 */}
<AdSlot type={'in-article'} />

{post?.type === 'Post' && (
<>
<ArticleAround prev={prev} next={next} />
<RecommendPosts recommendPosts={recommendPosts} />
</>
)}
{post?.type === 'Post' && (
<>
<ArticleAround prev={prev} next={next} />
<RecommendPosts recommendPosts={recommendPosts} />
</>
)}

{/* 评论区 */}
<Comment frontMatter={post} />
</div>
{/* 评论区 */}
<Comment frontMatter={post} />
</div>
)}
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion themes/starter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const LayoutSlug = props => {
<div id='container-inner' className='w-full p-4'>
{lock && <ArticleLock validPassword={validPassword} />}

{!lock && (
{!lock && post && (
<div id='article-wrapper' className='mx-auto'>
<NotionPage {...props} />
<Comment frontMatter={post} />
Expand Down

0 comments on commit 3374068

Please sign in to comment.