Skip to content

Commit

Permalink
fix: prerender 404 error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyxh committed May 15, 2024
1 parent b975079 commit b43bb82
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion helpers/data/submited.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@ export default [
"/articles/axios_source_3.html",
"/articles/Pro_Git_reading_comprehension_how_to_achieve_git.html",
"/articles/compatible_discussion.html",
"/articles/serviceless_blog_establishment.html"
"/articles/serviceless_blog_establishment.html",
"/404",
"/404.html",
"/404",
"/404",
"/404"
]
2 changes: 2 additions & 0 deletions helpers/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export async function submit(routes: string[]) {
}
});

submitedList = submitedList.filter((s) => !deleteList.includes(s));

if (updateList.length + deleteList.length === 0) return void 0;
} catch (err) {
return console.log('start err', err);
Expand Down
3 changes: 1 addition & 2 deletions helpers/vite-prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ const excludeOutPathRewrite = [
'/examples',
'/books',
'/coder',
'/profile',
'/404'
'/profile'
];

function getMetaTag(meta: ArticleMeta | undefined, route: ResolveRouteObject) {
Expand Down
2 changes: 1 addition & 1 deletion src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const routes: RouteObject[] = [
element: () => import('@/viewer/Examples')
},
{
path: '404',
path: '404.html',
element: '不存在的页面'
}
]
Expand Down

0 comments on commit b43bb82

Please sign in to comment.