Skip to content

Commit 77d8187

Browse files
committed
fix: Default all links to remote until Jekyll is gone
Otherwise Gatsby will attempt to load links even when they're not valid Gatsby pages.
1 parent bf00067 commit 77d8187

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

gatsby/src/components/smartLink.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import React from 'react';
2-
import { Link } from 'gatsby';
1+
import React from "react";
2+
import { Link } from "gatsby";
33

4-
import ExternalLink from './externalLink';
4+
import ExternalLink from "./externalLink";
55

66
// TODO(dcramer): when Gatsby conversion is done, remove remote default
7-
export default ({ to, href, children, remote, ...props }) => {
8-
const realTo = to || href || '';
9-
if (realTo.indexOf('://') !== -1) {
7+
export default ({ to, href, children, remote = true, ...props }) => {
8+
const realTo = to || href || "";
9+
if (realTo.indexOf("://") !== -1) {
1010
return (
1111
<ExternalLink href={realTo} {...props}>
1212
{children}
1313
</ExternalLink>
1414
);
15-
} else if (realTo.indexOf('/') !== 0 || remote) {
15+
} else if (realTo.indexOf("/") !== 0 || remote) {
1616
// this handles cases like anchor tags (where Link messes thats up)
1717
return (
1818
<a href={realTo} {...props}>

0 commit comments

Comments
 (0)