diff --git a/.github/og-image.sh b/.github/og-image.sh new file mode 100755 index 0000000..b89730f --- /dev/null +++ b/.github/og-image.sh @@ -0,0 +1,6 @@ +#!/bin/sh +for arg in "$@"; do + link=$(grep --only-matching --extended-regexp --max-count 1 '"[^"]+/banner.png' "$arg") + [ "$link" != "" ] && sed -i "/
/a \ " "$arg" +done +exit 0 diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index cfbc479..712c12e 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -10,9 +10,13 @@ jobs: container: ghcr.io/carapace-sh/carapace steps: - uses: actions/checkout@v4 + - name: "build docs" run: mdbook build docs + - name: "add og:image" + run: sh .github/og-image.sh docs/book/html/*.html + - name: "push gh-pages" if: github.ref == 'refs/heads/master' run: |