Make 404 check work even with link prefixes
This commit is contained in:
parent
8ba3990076
commit
47408c3997
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import { link } from 'gatsby-helpers'
|
||||||
import { rhythm } from 'utils/typography'
|
import { rhythm } from 'utils/typography'
|
||||||
import access from 'safe-access'
|
import access from 'safe-access'
|
||||||
import { config } from 'config'
|
import { config } from 'config'
|
||||||
|
import include from 'underscore.string/include'
|
||||||
|
|
||||||
class BlogIndex extends React.Component {
|
class BlogIndex extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
|
|
@ -15,7 +16,7 @@ class BlogIndex extends React.Component {
|
||||||
access(page, 'data.date')
|
access(page, 'data.date')
|
||||||
).reverse()
|
).reverse()
|
||||||
sortedPages.forEach((page) => {
|
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
|
const title = access(page, 'data.title') || page.path
|
||||||
pageLinks.push(
|
pageLinks.push(
|
||||||
<li
|
<li
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue