File size: 970 Bytes
2f461e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
author : ['Author Name']
title: "Configure Pagefind"
description: "How to configure Pagefind in Hugo Brewm theme"
date: 2025-01-26
type: post
draft: false
translationKey: pagefind
coffee: 1
tags: ['configuration', 'pagefind']
categories: ['configuration']
---

## Setting up search in Hugo configuration

To enable search functionality, you'll need to modify your `config.toml` file. First, enable the search button using `.params.search`. Then activate `.params.pagefind`, if you skip this step, the theme will default to using DuckDuckGo instead.

```toml
[params]
  search = true
  pagefind = true
```

## Setting up post frontmatter

To make post indexed, you'll need to set `type` to `post` to the frontmatter of each post.

```yaml
---
title: "Post"
type: post
---
```

## Setting up your CI/CD pipeline

To create the search index, add this command to your CI/CD pipeline's build step:

```yaml
- name: Index pagefind
  run: npx pagefind --source "public"
```