CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.51k stars 114 forks source link

Configuration error in hugo? #96

Closed dlzmoe closed 2 years ago

dlzmoe commented 2 years ago

I had some issues with hugo, running npx pagefind --source "public", then the terminal prompts x pagefind_extended

Below is my configuration, do I have a problem somewhere?

<link rel="stylesheet" href="{{ .Site.Params.staticPrefix }}{{ "_pagefind/pagefind-ui.css" | relURL }}">
<script src="{{ .Site.Params.staticPrefix }}{{ "_pagefind/pagefind-ui.js" | relURL }}"></script>
<div id="search"></div>
<script>
 window.addEventListener('DOMContentLoaded', (event) => {
   new PagefindUI({ element: "#search" });
 });
</script>
bglw commented 2 years ago

Hello! 👋

I don't recognize that terminal prompt — can you add a screenshot of what shows exactly when you run that command?

Also, what operating system / architecture are you using?

Lastly, running npm install pagefind in a test directory might surface a better error than npx pagefind does, if some error is being hit.

dlzmoe commented 2 years ago

This is a great project.

Sorry to disturb you due to the time difference, Here are some descriptions! I use windows computer!

1.when executing the command image

2.after executing the command image

This is the description from the pagefind documentation.

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.

I imported the css and js as requested, called it, and ran npx pagefind --source "public" . But the result is x pagefind_extended, I don't quite understand what it means to find a result?

But the result is that building the index fails, I don't know what to do, I hope you can give me some advice

bglw commented 2 years ago

No worries — happy to help!

Hmm, I think this might the same issue as #66 which is a Windows issue I haven't had a chance to test the fix for yet.

I'll endeavor to look at this very soon — in the meantime if you download the Windows release directly from https://github.com/CloudCannon/pagefind/releases/tag/v0.8.1 and rename it to pagefind_extended.exe you should be able to run it from your terminal.

Keep you posted — sorry for the delay in fixing this!

bglw commented 2 years ago

👋 Hello! This is fixed in the Pagefind v0.9.1 release 🎉