Skip to content

Commit f98d4e2

Browse files
committed
Added book slugs to books
1 parent e2c6d10 commit f98d4e2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/pages/books.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { graphql } from 'gatsby';
44
import { GatsbyImage } from 'gatsby-plugin-image';
55
import { MDXRenderer } from 'gatsby-plugin-mdx';
66
import { useIntl } from 'react-intl';
7+
import { slugify } from '../utils';
78

89
import HeadMatter from '../components/HeadMatter';
910
import Layout from '../components/Layout';
@@ -39,7 +40,7 @@ const Books = ({ data }) => {
3940
)}
4041
</div>
4142
<div className={classnames(grid.col, css.book)}>
42-
<h3>{book.title}</h3>
43+
<h3 id={slugify(book.title)}>{book.title}</h3>
4344
{book.author && (
4445
<p className={css.author}>
4546
{intl.formatMessage({ id: 'by' })} {book.author}

0 commit comments

Comments
 (0)