diff --git a/_includes/scripts.html b/_includes/scripts.html index bbdaddff0bab..dda8d7565086 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -15,6 +15,8 @@ {% include_cached search/google-search-scripts.html %} {%- when "algolia" -%} {% include_cached search/algolia-search-scripts.html %} + {%- when "pagefind" -%} + {% include_cached search/pagefind-search-scripts.html %} {%- endcase -%} {% endif %} diff --git a/_includes/search/pagefind-search-scripts.html b/_includes/search/pagefind-search-scripts.html new file mode 100644 index 000000000000..4c9af13ee641 --- /dev/null +++ b/_includes/search/pagefind-search-scripts.html @@ -0,0 +1,2 @@ + + diff --git a/_includes/search/search_form.html b/_includes/search/search_form.html index b9de365c6efe..959c12610088 100644 --- a/_includes/search/search_form.html +++ b/_includes/search/search_form.html @@ -22,5 +22,12 @@ {%- when "algolia" -%}
+ {%- when "pagefind" -%} + + {%- endcase -%} diff --git a/docs/_docs/05-configuration.md b/docs/_docs/05-configuration.md index 04b97b1e1a5e..f964d1b9e44e 100644 --- a/docs/_docs/05-configuration.md +++ b/docs/_docs/05-configuration.md @@ -702,6 +702,18 @@ Add a Google search box to your site. **Note:** If your site is new and hasn't been indexed by Google yet, search will be incomplete and won't provide accurate results. {: .notice--info} +#### Pagefind from Cloudcannon + +You can use [Pagefind](https://pagefind.app/) to add search for you static site also. + +First you build your site like normal, and then afterwards you run the following command. + +```bash +npx -y pagefind --site public +``` + +It is important that you run the script after you have build your site (and everytime you rebuild). You can read more in the [Pagefind docs](https://pagefind.app/docs/). + ### SEO, social sharing, and analytics settings All optional, but a good idea to take the time setting up to improve SEO and links shared from the site.