diff --git a/.github/actions/deploy-to-github-pages/action.yml b/.github/actions/deploy-to-github-pages/action.yml index 231894a6e5..132d22f2f0 100644 --- a/.github/actions/deploy-to-github-pages/action.yml +++ b/.github/actions/deploy-to-github-pages/action.yml @@ -83,7 +83,7 @@ runs: - name: run Pagefind ${{ env.PAGEFIND_VERSION }} to build the search index shell: bash - run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public + run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public --write-playground - name: Temporarily copy some Rails assets to help the transition shell: bash @@ -126,10 +126,33 @@ runs: -H "Content-Type: application/json" \ -d '{ "purge_everything": true }' - - name: construct `--remap` options for lychee + - name: construct `--remap` options, root-dir for lychee id: remap shell: bash run: | + # Prepare the root-dir for use with the `--root-dir` option + echo "root-dir-arg=$PWD/root-dir" >>$GITHUB_OUTPUT && + case "$base_url" in + https://*/?*|http://*/?*) + # The base URL is not at the top-level of the URL + subdir="${base_url#http*://*/}" + target="root-dir/${subdir%/}" + source="$(echo "${subdir%/}" | sed 's/[^/]*/../g')/public" + mkdir -p "${target%/*}" && + ln -s "$source" "$target" && + echo "root-dir=$target/" >>$GITHUB_OUTPUT + ;; + https://*|http://*) + # The base URL is at the top-level of the URL + ln -s public root-dir && + echo 'root-dir=root-dir/' >>$GITHUB_OUTPUT + ;; + *) + echo "::error::Unexpected base_url '$base_url'" >&2 + echo exit 1 + ;; + esac || exit + echo "result=$(echo "$base_url" | sed 's|^\(.*\)\(/git-scm\.com\)$|^(\1)?\2(.*)|') file://$PWD/public\$2" \ >>$GITHUB_OUTPUT @@ -163,7 +186,7 @@ runs: args: >- --offline --fallback-extensions html - --base '${{ env.base_url }}' + --root-dir '${{ steps.remap.outputs.root-dir-arg }}' --remap '${{ steps.remap.outputs.result }}' ${{ steps.remap.outputs.remap-dotdot }} ${{ steps.remap.outputs.remap-git-scm }} @@ -174,7 +197,7 @@ runs: --exclude file:///Pfad/zum/Repo.git/ --exclude file:///chemin/du/d%C3%A9p%C3%B4t.git/ --exclude file:///srv/git/project.git - public/ + '${{ steps.remap.outputs.root-dir }}' output: lychee.md jobSummary: true fail: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff035e2b6e..41804c1b0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: fi - name: run Pagefind ${{ env.PAGEFIND_VERSION }} to build the search index - run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public + run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public --write-playground - name: build tar archive run: cd public && tar czvf ../pages.tar.gz * diff --git a/hugo.yml b/hugo.yml index 845e25e84a..2c0008acf2 100644 --- a/hugo.yml +++ b/hugo.yml @@ -32,7 +32,7 @@ module: target: content params: hugo_version: 0.148.2 - pagefind_version: 1.3.0 + pagefind_version: 1.4.0 latest_version: 2.51.0 latest_relnote_url: https://raw.github.com/git/git/master/Documentation/RelNotes/2.51.0.adoc latest_release_date: '2025-08-18'