Skip to content

Commit

Permalink
fix(docs): search data 404
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Dec 1, 2023
1 parent 3fd9197 commit 029fa44
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
HUGO_ENV: production
run: |
cd docs
patch -p0 < resources/patch_search.txt # https://github.com/alex-shpak/hugo-book/pull/505
hugo \
--gc \
--minify \
Expand Down
22 changes: 22 additions & 0 deletions docs/resources/patch_search.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 029fa44

Please sign in to comment.