Skip to content

Commit f8662f5

Browse files
authored
Merge pull request #1144 from ethereum/close-search
Strip URL on search [Fixes #1143]
2 parents cc7fcb5 + f694f29 commit f8662f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/Search/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ const StyledHighlight = styled(Highlight)`
110110
`
111111

112112
const PageHit = (clickHandler) => ({ hit }) => {
113+
// Make url relative, so `handleSelect` is triggered
114+
const url = hit.url.replace("https://ethereum.org", "")
113115
return (
114116
<div>
115-
<GatsbyLink to={hit.url} onClick={clickHandler}>
117+
<GatsbyLink to={url} onClick={clickHandler}>
116118
<PageHeader>
117119
<Highlight attribute="hierarchy.lvl1" hit={hit} tagName="mark" />
118120
</PageHeader>
@@ -138,6 +140,7 @@ const PageHit = (clickHandler) => ({ hit }) => {
138140
)
139141
}
140142

143+
// TODO update to `dev-ethereum-org` once tested
141144
const indices = [
142145
{ name: `dev-ethereum-org`, title: `Pages`, hitComp: `PageHit` },
143146
]

0 commit comments

Comments
 (0)