Handle subroute 404

This commit is contained in:
Eric Jinks 2018-05-02 17:23:42 +10:00
parent c5641eaa4f
commit d88eb8cc13

View file

@ -125,6 +125,7 @@ class App extends Component {
const categoryPosts = posts.filter(post =>
documentHasTerm(post, 'categories', slug)
)
if (!categoryPosts.length) return <NoMatch siteUrl={siteUrl} />
return (
<Blog
posts={categoryPosts}
@ -146,6 +147,7 @@ class App extends Component {
const singlePost = posts[singlePostID]
const nextPost = posts[singlePostID + 1]
const prevPost = posts[singlePostID - 1]
if (!singlePost) return <NoMatch siteUrl={siteUrl} />
return (
<SinglePost
singlePost={singlePost}