Commit 6635ab1
committed
search: be even more prepared for the transition from the Rails app
In the parent commit, we started supporting to load the client-side
search via the `/search?search=<term>` URL into the interactive search
box served from the Rails app version of the page.
The trick to make this work was to exploit the fact that `/search` will
resolve to a full HTML page in the Hugo/Pagefind version, including the
client-side search code, which finds the search box, interprets its
contents, and peforms the desired functionality.
However, this still shows a quite ugly "full page" inside the search
results <div>.
Even worse: While the user typed less than three characters, this would
show the warning (intended for users who turned off Javascript) that
the search functionality is now client-side and requires Javascript.
Of course, this all only matters as long as the cached versions of the
Rails app site are served while transitioning to the Hugo/Pagefind
version of the site.
For the transition from a Rails app to a static website, let's detect
the situation that we're running "in mixed mode" and replace the full
search page with a small placeholder that is less annoying to the eye.
Signed-off-by: Johannes Schindelin <[email protected]>1 parent be57dbd commit 6635ab1
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments