From 47408c3997611ce1260bff4e9ac7b1805ec2223a Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Sun, 13 Mar 2016 14:12:42 -0700 Subject: [PATCH] Make 404 check work even with link prefixes --- pages/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/index.js b/pages/index.js index 16f408e..97bbae4 100644 --- a/pages/index.js +++ b/pages/index.js @@ -6,6 +6,7 @@ import { link } from 'gatsby-helpers' import { rhythm } from 'utils/typography' import access from 'safe-access' import { config } from 'config' +import include from 'underscore.string/include' class BlogIndex extends React.Component { render () { @@ -15,7 +16,7 @@ class BlogIndex extends React.Component { access(page, 'data.date') ).reverse() sortedPages.forEach((page) => { - if (access(page, 'file.ext') === 'md' && page.path !== '/404/') { + if (access(page, 'file.ext') === 'md' && include(page.path, '/404/')) { const title = access(page, 'data.title') || page.path pageLinks.push(