From 646a1f7abb414415aabf90e7847c9e413196e5cb Mon Sep 17 00:00:00 2001 From: Vincent Mercier Date: Thu, 23 Nov 2023 16:52:44 +0100 Subject: [PATCH] chore(website): Patch hugo-book to fix search engine --- .github/workflows/release.yaml | 5 ++++- themes/patch_book.txt | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 themes/patch_book.txt diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2914168..58828fd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,7 +25,7 @@ jobs: group: "pages" # Allow one concurrent deployment cancel-in-progress: true env: - HUGO_VERSION: 0.120.4 + HUGO_VERSION: 0.115.4 BASE_URL: https://qonto.github.io/database-monitoring-framework environment: name: github-pages @@ -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 diff --git a/themes/patch_book.txt b/themes/patch_book.txt new file mode 100644 index 0000000..1eea265 --- /dev/null +++ b/themes/patch_book.txt @@ -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 }}