UNPKG

gatsby-remark-dictionary

Version:

Create a dictionary of word and phrases to be converted to highlighted values and links. define once and all phrases will be converted during build time.

15 lines (13 loc) 420 B
import React from 'react'; import { Highlight, Snippet } from 'react-instantsearch-dom'; import { Link } from 'gatsby'; export const PageHit = clickHandler => ({ hit }) => ( <div> <Link to={hit.slug} onClick={clickHandler}> <div> <Highlight attribute="title" hit={hit} tagName="mark" /> </div> </Link> <Snippet attribute="excerpt" hit={hit} tagName="mark" /> </div> );