You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With this topic branch, the server-side search is replaced by a
client-side search that uses Pagefind (https://pagefind.app/) to
generate a nicely-chunked search index that can be loaded on demand,
incrementally, and efficiently.
While Hugo takes about half a minute to run in my setup, building the
search index takes about three minutes, testament of the fact that
generating search indices is a much more complex task than rendering a
static site.
Signed-off-by: Johannes Schindelin <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,19 @@ Side note: What _are_ "ugly URLs"? Hugo, by default, generates "pretty" URLs lik
51
51
52
52
Pro-Tip: Do this in a sparse checkout that excludes large parts of `content/`, to speed up the rendering time.
53
53
54
+
To test the site locally _with_ the search enabled, run this instead:
55
+
56
+
$ hugo
57
+
$ npx -y pagefind --site public
58
+
$ node script/serve-public.js
59
+
60
+
You can also use Pagefind's built-in server (which will be running on http://127.0.0.1:1414), but again, you have to turn off "ugly URLs":
61
+
62
+
$ HUGO_UGLYURLS=false hugo
63
+
$ npx -y pagefind --site public --serve
64
+
65
+
Note that running Pagefind will make the process about 7 times slower, and the site will not be re-rendered and live-reloaded in the browser when you change files in `content/` (unlike with `hugo serve -w`).
66
+
54
67
## Update manual pages
55
68
56
69
(TODO!)
@@ -134,6 +147,10 @@ The [list of GUI clients](https://git-scm.com/downloads/guis) has been construct
134
147
*https://gohugo.io/
135
148
*https://gohugo.io/content-management/shortcodes/
136
149
150
+
### Pagefind (client-side search)
151
+
152
+
*https://pagefind.app/
153
+
137
154
## License
138
155
139
156
The source code for the site is licensed under the MIT license, which you can find in
<aclass="highlight">Search is now client-side only!</a>
17
+
</li>
18
+
<li>
19
+
Since moving from a full Ruby on Rails app to a static site, the search on https://git-scm.com/ is implemented in Javascript, on the client side. Therefore, the server-side search via https://git-scm.com/search?search=<search-term> is no longer supported.
0 commit comments