[Hugo] You must run npx pagefind everytime you build if you want to index your new posts

puzzle creative RJtZiTbAy c unsplash scaled
Genx Avatar
Share This:

1. Build your Hugo site (create/update /public):

hugo

This builds your static site in the public/ directory.

2. Run Pagefind to index the site:

npx pagefind --site public

This command creates the /public/pagefind/ folder, which contains the JavaScript and CSS needed for the search UI.

Important:

You must run both hugo and npx pagefind –site public every time you rebuild your site, every time you add, edit, or remove content in your Hugo site that you want to appear in search results, before deploying or serving from the /public directory.

Related Posts

Genx

in

Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

four × one =

Webmention: Have you posted a response to this article? Let me know the URL: