OleVik / grav-theme-scholar

Scholar is an academic-focused theme, for publishing papers, articles, books, documentation, your blog, and even your resumé, with Grav.
https://olevik.net/staging/grav-skeleton-scholar
MIT License
15 stars 2 forks source link

Can't search within site #10

Closed hellquist closed 4 years ago

hellquist commented 4 years ago

More as an FYI, but the search doesn't actually search -> display anything anywhere when installing the skeleton. It could well be that it actually is doing the search but fails to present the result. The user experience is that it is broken though.

hellquist commented 4 years ago

Hmm, actually I downloaded the skeleton that you had linked in another reply to another issue. That skeleton is 200mb. In that one search is working just fine. The first skeleton I downloaded (1.03?) was only 80mb in comparison. In that one search was not working. Regardless, I don't think this is a bug to report as an issue.

hellquist commented 4 years ago

Ah, haha, sorry for being annoying, I truly love the idea of this theme, I think it is a brilliant thing, and I really want it to work. However, in that big skeleton where the search indeed is searching and then displaying results, the headlines of the results have a "localhost" in the URL path for the relevant page. Seems like a simple omission of a site variable in the code. Just so you know. :)

This means that headlines for search do not work to click on as it will not take me to the correct result.

On a similar note I noticed that "tags" and "category" on the blog posts, where they are linked (not always) also do not lead to a listing of the tag/category.

OleVik commented 4 years ago

Yes, this is as intended. The theme's default engine for searching does not use live data, but statically generated data. Links are by default absolute, not relative, because they need to work outside of non-standard contexts. The same applies to the metadata-links; they point to a search-page that is non-existent apart from dynamically generated routing.

All of which is to say that search-data must be generated when the theme is installed, not before. Accommodations could be made in the Static Generator plugin though, for predetermined base URLs.