Skip to content

Commit

Permalink
Docs: Add some clarification to the getting started guide
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Jul 4, 2022
1 parent 5f30598 commit dac0aa6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ weight: 7

Pagefind runs after your static generator, and outputs a static search bundle to your generated site. Unlike many search libraries, you don't need to build a search index by hand — the index is generated for you from your generated site.

To get started, we'll use the search UI that Pagefind provides out of the box. Add the following snippet to a page of your choice:
Since Pagefind indexes your site _after_ it builds, we'll do things slightly out of order and add search UI first — so that it already exists on our built site when we go to index it.

Pagefind provides a prebuilt search UI out of the box. Add the following snippet to a page of your choice:

```html
<link href="/_pagefind/pagefind-ui.css" rel="stylesheet">
Expand All @@ -21,7 +23,7 @@ To get started, we'll use the search UI that Pagefind provides out of the box. A
</script>
```

> The `/_pagefind/pagefind-ui.css` and `/_pagefind/pagefind-ui.js` assets will be created by Pagefind in the next step.
> The `/_pagefind/pagefind-ui.css` and `/_pagefind/pagefind-ui.js` assets will be created by Pagefind when we index the site.
Now build your site to an output directory — this guide assumes that you're running `hugo` and that your site is output to the `public/` directory. Pagefind works with any set of static HTML files, so adjust these configurations as needed.

Expand All @@ -46,7 +48,7 @@ Created 27 index chunks
Finished in 2.357 seconds
```

We can see that a bunch of content was indexed, and Pagefind will be running a development server (likely on [:1414](http://localhost:1414)).
We can see that a bunch of content was indexed, and Pagefind will be running a preview server (likely on [:1414](http://localhost:1414)).

Loading this in your browser, you should see a search input on your page. Have a play, and bask in how easy that was to integrate.

Expand Down

0 comments on commit dac0aa6

Please sign in to comment.