From 3ce8deff027e42c80eadc9c2acc8b73aac71006a Mon Sep 17 00:00:00 2001 From: rsteube Date: Tue, 17 Sep 2024 18:18:59 +0200 Subject: [PATCH] add og:image --- .github/og-image.sh | 6 ++++++ .github/workflows/doc.yml | 4 ++++ 2 files changed, 10 insertions(+) create mode 100755 .github/og-image.sh 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: |