lumeland / lume

🔥 Static site generator for Deno 🦕
https://lume.land
MIT License
1.75k stars 74 forks source link

Search plugin seems to be missing pages generated by the multilanguage plugin #583

Closed mindreframer closed 3 months ago

mindreframer commented 3 months ago

Version

https://deno.land/x/lume@v2.1.1

Platform

OSX (12.7.3)

What steps will reproduce the bug?

-> pages with multilang features are missing in the list

How often does it reproduce? Is there a required condition?

consistently

What is the expected behavior?

multilang pages should be included in search with empty string

What do you see instead?

Additional information

Feel free to ask for a bug reproduction in code, if for some reason this bug is not reproducible

mindreframer commented 3 months ago

correction: this only manifests with JSX files. Multilang Markdown files are visible in search.pages result

mindreframer commented 3 months ago

I have made a reproduction repo: https://github.com/mindreframer/lume-bug-page-search

mindreframer commented 3 months ago

And it seems it is not related to the extension. I have markdown files, and some of them are in the search results, some not.

mindreframer commented 3 months ago

The fix/workaround is to include / at the end of the URL:

Then the pages are included in the search result.

oscarotero commented 3 months ago

That's not a bug.

search.pages() only returns HTML pages. This means the url must end with .html or / (which is equivalent to /index.html).

For example: /pathname is a non-HTML page, it's just a file without extension. But /pathname/ is a HTML page because is exported to /pathname/index.html.

mindreframer commented 3 months ago

Thank you for the response! Sorry, been absent last 2 days. OK, good to know, that a missing slash at the end is considered a non-HTML page. Maybe it makes sense to document somewhere, I went through the complete documentation and could not figure out the reason for this behaviour.

And thanks for Lume, I enjoy using it so far!