Skip to content

Commit

Permalink
chore(website): Patch hugo-book to fix search engine
Browse files Browse the repository at this point in the history
  • Loading branch information
vmercierfr committed Nov 23, 2023
1 parent 351310e commit 9010af6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
submodules: recursive
fetch-depth: 0

- name: Patch Hugo book
run: patch -p0 < themes/patch_book.txt

- name: Create public directory
run: mkdir public

Expand Down
22 changes: 22 additions & 0 deletions themes/patch_book.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- themes/book/assets/search.js 2023-11-23 16:41:11
+++ themes/book/assets/search.js 2023-11-23 16:41:08
@@ -5,7 +5,7 @@
{{ $searchConfig := i18n "bookSearchConfig" | default "{}" }}

(function () {
- const searchDataURL = '{{ $searchData.RelPermalink }}';
+ const searchDataURL = '{{ $searchData.Permalink }}';
const indexConfig = Object.assign({{ $searchConfig }}, {
doc: {
id: 'id',
--- themes/book/assets/search-data.json 2023-11-23 17:13:03
+++ themes/book/assets/search-data.json 2023-11-23 17:13:08
@@ -8,7 +8,7 @@
{{ range $index, $page := $pages }}
{{ if gt $index 0}},{{end}} {
"id": {{ $index }},
- "href": "{{ $page.RelPermalink }}",
+ "href": "{{ $page.Permalink }}",
"title": {{ (partial "docs/title" $page) | jsonify }},
"section": {{ (partial "docs/title" $page.Parent) | jsonify }},
"content": {{ $page.Plain | jsonify }}

0 comments on commit 9010af6

Please sign in to comment.