This project is intended in part as a both a learning piece in order to understand how Lunr.js works, but also as a fully functional blog starter with additional site search functionality baked in from the get go.
This project is a fork of Gatsby's official starter blog.
-
Create a Gatsby site.
Use the Gatsby CLI to create a new site, specifying the blog starter.
# create a new Gatsby site using the blog starter gatsby new my-blog-starter https://github.com/lukewhitehouse/gatsby-starter-blog-with-lunr
-
Start developing.
Navigate into your new site’s directory and start it up.
cd my-blog-starter/ gatsby develop
-
Open the source code and start editing!
Your site is now running at
http://localhost:8000
!Note: You'll also see a second link:
http://localhost:8000/___graphql
. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.Open the
my-blog-starter
directory in your code editor of choice and editsrc/pages/index.js
. Save your changes and the browser will update in real time!
As part of this project, a blog post named Gatsby Site Search with Lunr.js was created in order to fork the project from scratch with Gatsby's starter blog. I would recommend reading that to get yourself aquanted.
Aside from that, Lunr also has some great documentation to help you extend the base functionality found in this project moving forward.