diff --git a/.github/workflows/mod-update.yml b/.github/workflows/mod-update.yml new file mode 100644 index 0000000..a60d2fc --- /dev/null +++ b/.github/workflows/mod-update.yml @@ -0,0 +1,62 @@ +name: Update Hugo dependencies +on: + workflow_dispatch: + schedule: + - cron: '0 3 * * *' # run daily at 03:00 AM + +permissions: + contents: write + pull-requests: write + +jobs: + update-mod: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: lts/* + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + + # [26/AUG/23] Adjusted from npm ci to prevent EBADPLATFORM error due to fsevents + - name: Install npm + run: npm i + + - name: Update Hugo module dependencies + id: mod-updates + run: | + MOD_OUTPUT=$(npm run mod:update 2>&1) + echo "$MOD_OUTPUT" + MOD_UPDATES=$(echo "$MOD_OUTPUT" | grep '^go: upgraded' | sed 's/go: / - /' | sort -u) + echo 'MOD_UPDATES<> $GITHUB_OUTPUT + echo "$MOD_UPDATES" >> "$GITHUB_OUTPUT" + echo 'EOF' >> $GITHUB_OUTPUT + + - name: Create Pull Request + uses: gethinode-actions/create-pull-request@v7 + with: + token: ${{ secrets.HUGO_MOD_PR }} + commit-message: 'fix: update Hugo module dependencies' + committer: GitHub + branch: hugo-mod-dependencies + delete-branch: true + title: 'Update Hugo module dependencies' + body: | + This PR is auto-generated by [create-pull-request][1]. + + Changes to go.mod: + + ${{ steps.mod-updates.outputs.MOD_UPDATES }} + + [1]: https://github.com/peter-evans/create-pull-request + labels: dependencies + add-paths: | + go.mod + go.sum + **/go.mod + **/go.sum diff --git a/assets/js/modules/flexsearch/flexsearch.index.js b/assets/js/modules/flexsearch/flexsearch.index.js index 82b2652..be18845 100644 --- a/assets/js/modules/flexsearch/flexsearch.index.js +++ b/assets/js/modules/flexsearch/flexsearch.index.js @@ -41,7 +41,8 @@ Source: function initIndex() { // https://discourse.gohugo.io/t/range-length-or-last-element/3803/2 // Note: pages without a title (such as browserconfig.xml) are excluded - {{ $list := where site.RegularPages "Title" "!=" "" }} + {{ $sections := where site.Sections "Title" "!=" "" }} + {{ $list := where site.RegularPages "Title" "!=" "" | append $sections }} {{ $list = where $list ".Params.searchExclude" "!=" true }} {{ $len := (len $list) -}} diff --git a/exampleSite/go.sum b/exampleSite/go.sum index 7e5fec8..6195849 100644 --- a/exampleSite/go.sum +++ b/exampleSite/go.sum @@ -1,4 +1,2 @@ -github.com/gethinode/mod-utils/v5 v5.10.0 h1:NlofAfa1YILV9pwS8vMkEwVUdrnKCoIlVwJPm3+UVGs= -github.com/gethinode/mod-utils/v5 v5.10.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= github.com/gethinode/mod-utils/v5 v5.13.0 h1:ztkE1REey94x36UdlZ7yeitpIQid/BcZQh+wtxBTSQ8= github.com/gethinode/mod-utils/v5 v5.13.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= diff --git a/go.mod b/go.mod index 08e003b..c97ecc3 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/gethinode/mod-flexsearch/v4 go 1.19 require ( - github.com/gethinode/mod-utils/v5 v5.13.0 // indirect + github.com/gethinode/mod-utils/v5 v5.20.0 // indirect github.com/nextapps-de/flexsearch v0.0.0-20250907103239-defb38b083f0 // indirect ) diff --git a/go.sum b/go.sum index c82547c..e4d94c4 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ github.com/gethinode/mod-utils/v5 v5.10.0 h1:NlofAfa1YILV9pwS8vMkEwVUdrnKCoIlVwJ github.com/gethinode/mod-utils/v5 v5.10.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= github.com/gethinode/mod-utils/v5 v5.13.0 h1:ztkE1REey94x36UdlZ7yeitpIQid/BcZQh+wtxBTSQ8= github.com/gethinode/mod-utils/v5 v5.13.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= +github.com/gethinode/mod-utils/v5 v5.20.0 h1:K+oBv8kJ4pVj4m1HlxgJiC+DYNX4oumqS6Cvcp2C8Ho= +github.com/gethinode/mod-utils/v5 v5.20.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 h1:H/qVR5O4BXjRjD+5PZB+r4ug2BSJ2Of4RtwOntd+OKo= github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU= github.com/nextapps-de/flexsearch v0.0.0-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg= diff --git a/i18n/de.yaml b/i18n/de.yaml index 10e1019..7bafd0d 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -3,3 +3,5 @@ translation: "Durchsuche diese Seite" - id: ui_no_results translation: "Keine Ergebnisse für" +- id: close + translation: "Schließen" diff --git a/i18n/en.yaml b/i18n/en.yaml index c65a527..5847422 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -3,3 +3,5 @@ translation: "Search this site" - id: ui_no_results translation: "No results for" +- id: close + translation: "Close" diff --git a/i18n/fr.yaml b/i18n/fr.yaml index dcde118..8dfc787 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -3,3 +3,5 @@ translation: "Rechercher" - id: ui_no_results translation: "Aucun résultat pour" +- id: close + translation: "Fermer" diff --git a/i18n/nl.yaml b/i18n/nl.yaml index 6366bc1..f67de37 100644 --- a/i18n/nl.yaml +++ b/i18n/nl.yaml @@ -3,3 +3,5 @@ translation: "Zoeken op deze site" - id: ui_no_results translation: "Geen resultaten voor" +- id: close + translation: "Sluiten" diff --git a/i18n/pl.yaml b/i18n/pl.yaml index 8ef5aae..eacde3d 100644 --- a/i18n/pl.yaml +++ b/i18n/pl.yaml @@ -3,3 +3,5 @@ translation: "Przeszukaj tę stronę" - id: ui_no_results translation: "Brak wyników dla" +- id: close + translation: "Zamknij" diff --git a/i18n/zh-hans.yaml b/i18n/zh-hans.yaml index 0b43366..bab0353 100644 --- a/i18n/zh-hans.yaml +++ b/i18n/zh-hans.yaml @@ -3,3 +3,5 @@ translation: "搜索本站" - id: ui_no_results translation: "没有结果" +- id: close + translation: "关闭" diff --git a/i18n/zh-hant.yaml b/i18n/zh-hant.yaml index f56469b..05e690d 100644 --- a/i18n/zh-hant.yaml +++ b/i18n/zh-hant.yaml @@ -3,3 +3,5 @@ translation: "搜尋本站" - id: ui_no_results translation: "沒有結果" +- id: close + translation: "關閉"